Skip to content

Commit 0b74374

Browse files
authored
Merge pull request #79964 from mikeash/fix-varargs-test
[Test] Gate new VarArgs test on new runtime.
2 parents 4c1f1e6 + acbc484 commit 0b74374

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

test/stdlib/VarArgs.swift

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,21 @@ test_varArgs6()
174174

175175
func test_varArgs7() {
176176
#if canImport(Darwin) && arch(arm64)
177-
// Test a workaround for format specifiers and no arguments. We supply eight
178-
// words of zeroed memory to give this predictable behavior.
179-
my_printf("No parameters: %ld %ld %ld %ld %ld %ld %ld %ld\n")
177+
let canTest = if #available(SwiftStdlib 6.2, *) { false } else { true }
180178
#else
181179
// va_list is more complicated on other targets so that behavior is not the
182-
// same, skip the test by doing a fake print of the expected output.
183-
my_printf("No parameters: 0 0 0 0 0 0 0 0\n")
180+
// same, skip the test by doing a fake print of the expected output. Also
181+
// skip the test if we're testing against an older runtime without the fix.
182+
let canTest = false
184183
#endif
184+
185+
if canTest {
186+
// Test a workaround for format specifiers and no arguments. We supply eight
187+
// words of zeroed memory to give this predictable behavior.
188+
my_printf("No parameters: %ld %ld %ld %ld %ld %ld %ld %ld\n")
189+
} else {
190+
my_printf("No parameters: 0 0 0 0 0 0 0 0\n")
191+
}
185192
// CHECK: No parameters: 0 0 0 0 0 0 0 0
186193
}
187194
test_varArgs7()

0 commit comments

Comments
 (0)