File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 1
1
// RUN: %target-build-swift -target arm64-apple-ios8.0 -target-cpu cyclone \
2
- // RUN: -O -S %s -parse-as-library | \
2
+ // RUN: -O -S %s -parse-as-library -parse-stdlib | \
3
3
// RUN: FileCheck --check-prefix=TBI %s
4
4
5
5
// RUN: %target-build-swift -target arm64-apple-ios7.0 -target-cpu cyclone \
6
- // RUN: -O -S %s -parse-as-library | \
6
+ // RUN: -O -S %s -parse-as-library -parse-stdlib | \
7
7
// RUN: FileCheck --check-prefix=NO_TBI %s
8
8
9
9
// REQUIRES: CPU=arm64, OS=ios
10
10
11
11
// Verify that TBI is on by default in Swift on targets that support it. For our
12
12
// purposes this means iOS8.0 or later.
13
13
14
+ import Swift
15
+
14
16
func f( i: Int ) -> Int8 {
15
17
let j = i & 0xff_ffff_ffff_ffff
16
18
// TBI-NOT: and
17
19
// NO_TBI: and
18
- let p = UnsafeMutablePointer < Int8 > ( bitPattern: j)
20
+ guard let p = UnsafeMutablePointer < Int8 > ( bitPattern: j) else {
21
+ // Make sure we optimize away this branch.
22
+ Builtin . unreachable ( )
23
+ }
19
24
return p [ 0 ]
20
25
}
You can’t perform that action at this time.
0 commit comments