// RUN: %target-build-swift -target arm64-apple-ios8.0 -target-cpu cyclone \
// RUN:                          -O -emit-ir %s -parse-as-library | \
// RUN:   FileCheck --check-prefix=BOTH --check-prefix=TBI %s

// RUN: %target-build-swift -target arm64-apple-ios8.0 -target-cpu cyclone \
// RUN:     -Xcc -Xclang -Xcc -target-feature -Xcc -Xclang -Xcc +tbi \
// RUN:     -O -emit-ir %s -parse-as-library | \
// RUN:   FileCheck --check-prefix=BOTH --check-prefix=NO_TBI %s

// REQUIRES: CPU=arm64, OS=ios

// Verify that TBI is on by default in Swift.

func f(i: Int) -> Int8 {
  let j = i & 0xff_ffff_ffff_ffff
// TBI-NOT: and
// NO_TBI: and
  let p = UnsafeMutablePointer<Int8>(bitPattern: j)
  return p[0]
}

// RUN: %target-build-swift -target arm64-apple-ios8.0 -target-cpu cyclone \
// RUN:                          -O -S %s -parse-as-library | \
// RUN:   FileCheck --check-prefix=BOTH --check-prefix=TBI %s

// RUN: %target-build-swift -target arm64-apple-ios8.0 -target-cpu cyclone \
// RUN:     -target-feature -tbi -O -S %s -parse-as-library | \
// RUN:   FileCheck --check-prefix=BOTH --check-prefix=NO_TBI %s

// REQUIRES: CPU=arm64, OS=ios

// Verify that TBI is on by default in Swift.

func f(i: Int) -> Int8 {
  let j = i & 0xff_ffff_ffff_ffff
// TBI-NOT: and
// NO_TBI: and
  let p = UnsafeMutablePointer<Int8>(bitPattern: j)
  return p[0]
}

--- 
+++ 
@@ -1,9 +1,10 @@
 // RUN: %target-build-swift -target arm64-apple-ios8.0 -target-cpu cyclone \
-// RUN:                          -O -S %s -parse-as-library | \
+// RUN:                          -O -emit-ir %s -parse-as-library | \
 // RUN:   FileCheck --check-prefix=BOTH --check-prefix=TBI %s
 
 // RUN: %target-build-swift -target arm64-apple-ios8.0 -target-cpu cyclone \
-// RUN:     -target-feature -tbi -O -S %s -parse-as-library | \
+// RUN:     -Xcc -Xclang -Xcc -target-feature -Xcc -Xclang -Xcc +tbi \
+// RUN:     -O -emit-ir %s -parse-as-library | \
 // RUN:   FileCheck --check-prefix=BOTH --check-prefix=NO_TBI %s
 
 // REQUIRES: CPU=arm64, OS=ios
[test] Fix test that explicitly wants to turn off TBI on arm64.

...by horribly stacking -Xcc on top of -Xclang to pass a Clang cc1 argument.

Swift SVN r22672
