Skip to content

Commit bbe07fa

Browse files
authored
Merge pull request #9076 from gottesmm/tbi_fixes_4.0_branch
2 parents 105cf60 + e0a9c35 commit bbe07fa

File tree

2 files changed

+43
-25
lines changed

2 files changed

+43
-25
lines changed

test/Misc/tbi.sil

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// *NOTE* This is an end to end test. Specifically, we are ensuring that the
2+
// driver is properly generated -enable-aarch64-tbi and also that the frontend
3+
// respects this option and that we get the proper tbi behavior.
4+
5+
// RUN: %swiftc_driver -parse-sil -target arm64-apple-ios8.0 -target-cpu cyclone \
6+
// RUN: -O -S %s -parse-as-library -parse-stdlib -module-name Swift \
7+
// RUN: -Xfrontend -enable-sil-ownership | \
8+
// RUN: %FileCheck --check-prefix=TBI %s
9+
10+
// RUN: %swiftc_driver -parse-sil -target arm64-apple-ios7.0 -target-cpu cyclone \
11+
// RUN: -O -S %s -parse-as-library -parse-stdlib -module-name Swift \
12+
// RUN: -Xfrontend -enable-sil-ownership | \
13+
// RUN: %FileCheck --check-prefix=NO_TBI %s
14+
15+
// REQUIRES: CODEGENERATOR=AArch64
16+
17+
// Verify that TBI is on by default in Swift on targets that support it. For our
18+
// purposes this means iOS8.0 or later.
19+
20+
// NO_TBI-LABEL: .globl _testTBI
21+
// NO_TBI: _testTBI
22+
// NO_TBI-NEXT: and
23+
// NO_TBI-NEXT: ldr
24+
// NO_TBI-NEXT: ret
25+
26+
// TBI-LABEL: .globl _testTBI
27+
// TBI: _testTBI:
28+
// TBI-NEXT: ldr
29+
// TBI-NEXT: ret
30+
31+
sil_stage canonical
32+
33+
import Builtin
34+
35+
sil @testTBI : $@convention(thin) (Builtin.Int64) -> Builtin.Int64 {
36+
bb0(%0 : @trivial $Builtin.Int64):
37+
%1 = integer_literal $Builtin.Int64, 0x00FFFFFFFFFFFFFF
38+
%2 = builtin "and_Int64"(%0 : $Builtin.Int64, %1 : $Builtin.Int64) : $Builtin.Int64
39+
%3 = builtin "inttoptr_Int64"(%2 : $Builtin.Int64) : $Builtin.RawPointer
40+
%4 = pointer_to_address %3 : $Builtin.RawPointer to [strict] $*Builtin.Int64
41+
%5 = load [trivial] %4 : $*Builtin.Int64
42+
return %5 : $Builtin.Int64
43+
}

test/Misc/tbi.swift

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)