Files
swift-mirror/test/IRGen/empty_array.sil
Manman Ren e94aae06da [Function Attribute] add target-cpu and target-features sets if they're non-null.
All llvm::Functions created during IRGen will have target-cpu and target-features
attributes if they are non-null.

Update testing cases to expect the attribute in function definition.
Add testing case function-target-features.swift to verify target-cpu and
target-features.

rdar://20772331


Swift SVN r28186
2015-05-05 23:19:48 +00:00

29 lines
1.3 KiB
Plaintext

// RUN: %swift -target x86_64-apple-macosx10.9 -module-name main %s -emit-ir -o - | FileCheck -check-prefix=CHECK-64 %s
// RUN: %swift -target i386-apple-ios7.1 %s -module-name main -emit-ir -o - | FileCheck -check-prefix=CHECK-32 %s
// RUN: %swift -target x86_64-apple-ios7.1 %s -module-name main -emit-ir -o - | FileCheck -check-prefix=CHECK-64 %s
// RUN: %swift -target armv7-apple-ios7.1 %s -module-name main -emit-ir -o - | FileCheck -check-prefix=CHECK-32 %s
// RUN: %swift -target arm64-apple-ios7.1 %s -module-name main -emit-ir -o - | FileCheck -check-prefix=CHECK-64 %s
// RUN: %swift -target x86_64-unknown-linux-gnu -disable-objc-interop %s -module-name main -emit-ir -o - | FileCheck -check-prefix=CHECK-64 %s
// REQUIRES: X86
// REQUIRES: ARM
sil_stage canonical
import Builtin
// CHECK-32-LABEL: define void @empty_array(%swift.opaque*) {{.*}} {
// CHECK-32: %1 = bitcast %swift.opaque* %0 to i8*
// CHECK-32: %2 = getelementptr inbounds i8, i8* %1, i32 0
// CHECK-64-LABEL: define void @empty_array(%swift.opaque*) {{.*}} {
// CHECK-64: %1 = bitcast %swift.opaque* %0 to i8*
// CHECK-64: %2 = getelementptr inbounds i8, i8* %1, i64 0
sil @empty_array : $@convention(thin) (@in ()) -> () {
entry(%0 : $*()):
%1 = integer_literal $Builtin.Word, 1
%2 = index_addr %0 : $*(), %1 : $Builtin.Word
return undef : $()
}