Skip to content

Commit e25a63a

Browse files
committed
Fix VarArgs test for architectures without Float80
Since FileCheck does not know anything about the `#if` blocks in the code, it tries to match the expected string against the output that is simply never produced. Solving this by giving it an expected string even on the architectures that don't provide Float80. Fixes <rdar://problem/45654446>
1 parent cf9208d commit e25a63a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

test/stdlib/VarArgs.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %target-run-stdlib-swift -parse-stdlib %s | %FileCheck %s
22
// REQUIRES: executable_test
3-
// REQUIRES: rdar45654446
3+
44
import Swift
55

66
#if _runtime(_ObjC)
@@ -117,26 +117,30 @@ func test_varArgs5() {
117117
}
118118

119119
// CHECK: rdar-32547102: 0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0
120-
withVaList(args) {
120+
_ = withVaList(args) {
121121
vprintf(format + "\n", $0)
122122
}
123123
}
124124
test_varArgs5()
125125

126-
#if !os(Windows) && (arch(i386) || arch(x86_64))
127126
func test_varArgs6() {
128127
// Verify alignment of va_list contents when `Float80` is present.
129128
let i8 = Int8(1)
130129
let f32 = Float(1.1)
131130
let f64 = Double(2.2)
131+
#if !os(Windows) && (arch(i386) || arch(x86_64))
132132
let f80 = Float80(4.5)
133133
my_printf("a %g %d %g %d %Lg %d %g a\n", f32, i8, f64, i8, f80, i8, f32)
134134
my_printf("b %d %g %d %g %d %Lg %d %g b\n", i8, f32, i8, f64, i8, f80, i8, f32)
135+
#else // just a dummy to make FileCheck happy, since it ignores `#if`s
136+
let dummy = Double(4.5)
137+
my_printf("a %g %d %g %d %g %d %g a\n", f32, i8, f64, i8, dummy, i8, f32)
138+
my_printf("b %d %g %d %g %d %g %d %g b\n", i8, f32, i8, f64, i8, dummy, i8, f32)
139+
#endif
135140
// CHECK: a 1.1 1 2.2 1 4.5 1 1.1 a
136141
// CHECK: b 1 1.1 1 2.2 1 4.5 1 1.1 b
137142
}
138143
test_varArgs6()
139-
#endif
140144

141145

142146
// CHECK: done.

0 commit comments

Comments
 (0)