Skip to content

Commit d042375

Browse files
authored
Merge pull request #20641 from moiseev/varargs
[test] Fix VarArgs test for architectures without Float80
2 parents a79c141 + e25a63a commit d042375

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

test/stdlib/VarArgs.swift

Lines changed: 11 additions & 7 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)
@@ -12,7 +12,7 @@ typealias CGFloat = Double
1212
#endif
1313

1414
func my_printf(_ format: String, _ arguments: CVarArg...) {
15-
withVaList(arguments) {
15+
_ = withVaList(arguments) {
1616
vprintf(format, $0)
1717
}
1818
}
@@ -36,7 +36,7 @@ func test_varArgs1() {
3636
}
3737

3838
// CHECK: dig it: 0 0 -1 1 -2 2 -3 3 -4 4 -5 5 -6 6 -7 7 -8 8 -9 9 -10 10 -11 11
39-
withVaList(args) {
39+
_ = withVaList(args) {
4040
vprintf(format + "\n", $0)
4141
}
4242
}
@@ -60,7 +60,7 @@ func test_varArgs3() {
6060
#endif
6161

6262
// CHECK: {{pointers: '(0x)?0*12345670' '(0x)?0*12345671' '(0x)?0*12345672' '(0x)?0*12345673' '(0x)?0*12345674'}}
63-
withVaList(args) {
63+
_ = withVaList(args) {
6464
vprintf(format, $0)
6565
}
6666
}
@@ -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)