1
1
// RUN: %target-run-stdlib-swift -parse-stdlib %s | %FileCheck %s
2
2
// REQUIRES: executable_test
3
- // REQUIRES: rdar45654446
3
+
4
4
import Swift
5
5
6
6
#if _runtime(_ObjC)
@@ -12,7 +12,7 @@ typealias CGFloat = Double
12
12
#endif
13
13
14
14
func my_printf( _ format: String , _ arguments: CVarArg ... ) {
15
- withVaList ( arguments) {
15
+ _ = withVaList ( arguments) {
16
16
vprintf ( format, $0)
17
17
}
18
18
}
@@ -36,7 +36,7 @@ func test_varArgs1() {
36
36
}
37
37
38
38
// 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) {
40
40
vprintf ( format + " \n " , $0)
41
41
}
42
42
}
@@ -60,7 +60,7 @@ func test_varArgs3() {
60
60
#endif
61
61
62
62
// CHECK: {{pointers: '(0x)?0*12345670' '(0x)?0*12345671' '(0x)?0*12345672' '(0x)?0*12345673' '(0x)?0*12345674'}}
63
- withVaList ( args) {
63
+ _ = withVaList ( args) {
64
64
vprintf ( format, $0)
65
65
}
66
66
}
@@ -117,26 +117,30 @@ func test_varArgs5() {
117
117
}
118
118
119
119
// 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) {
121
121
vprintf ( format + " \n " , $0)
122
122
}
123
123
}
124
124
test_varArgs5 ( )
125
125
126
- #if !os(Windows) && (arch(i386) || arch(x86_64))
127
126
func test_varArgs6( ) {
128
127
// Verify alignment of va_list contents when `Float80` is present.
129
128
let i8 = Int8 ( 1 )
130
129
let f32 = Float ( 1.1 )
131
130
let f64 = Double ( 2.2 )
131
+ #if !os(Windows) && (arch(i386) || arch(x86_64))
132
132
let f80 = Float80 ( 4.5 )
133
133
my_printf ( " a %g %d %g %d %Lg %d %g a \n " , f32, i8, f64, i8, f80, i8, f32)
134
134
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
135
140
// CHECK: a 1.1 1 2.2 1 4.5 1 1.1 a
136
141
// CHECK: b 1 1.1 1 2.2 1 4.5 1 1.1 b
137
142
}
138
143
test_varArgs6 ( )
139
- #endif
140
144
141
145
142
146
// CHECK: done.
0 commit comments