diff options
Diffstat (limited to 'test/Bitcode')
-rw-r--r-- | test/Bitcode/attributes.ll | 5 | ||||
-rw-r--r-- | test/Bitcode/deprecated-linker_private-linker_private_weak.ll | 17 | ||||
-rw-r--r-- | test/Bitcode/local-linkage-default-visibility.3.4.ll | 79 | ||||
-rw-r--r-- | test/Bitcode/local-linkage-default-visibility.3.4.ll.bc | bin | 0 -> 924 bytes | |||
-rw-r--r-- | test/Bitcode/old-aliases.ll | 22 | ||||
-rw-r--r-- | test/Bitcode/old-aliases.ll.bc | bin | 0 -> 368 bytes | |||
-rw-r--r-- | test/Bitcode/tailcall.ll | 17 | ||||
-rw-r--r-- | test/Bitcode/upgrade-global-ctors.ll | 3 | ||||
-rw-r--r-- | test/Bitcode/upgrade-global-ctors.ll.bc | bin | 0 -> 316 bytes |
9 files changed, 143 insertions, 0 deletions
diff --git a/test/Bitcode/attributes.ll b/test/Bitcode/attributes.ll index 545f1cb..02e1bb1 100644 --- a/test/Bitcode/attributes.ll +++ b/test/Bitcode/attributes.ll @@ -218,6 +218,11 @@ define void @f36(i8* inalloca) { ret void } +define nonnull i8* @f37(i8* nonnull %a) { +; CHECK: define nonnull i8* @f37(i8* nonnull %a) { + ret i8* %a +} + ; CHECK: attributes #0 = { noreturn } ; CHECK: attributes #1 = { nounwind } ; CHECK: attributes #2 = { readnone } diff --git a/test/Bitcode/deprecated-linker_private-linker_private_weak.ll b/test/Bitcode/deprecated-linker_private-linker_private_weak.ll new file mode 100644 index 0000000..12a527c --- /dev/null +++ b/test/Bitcode/deprecated-linker_private-linker_private_weak.ll @@ -0,0 +1,17 @@ +; RUN: llvm-as -o - %s | llvm-dis | FileCheck %s +; RUN: llvm-as -o /dev/null %s 2>&1 | FileCheck %s -check-prefix CHECK-WARNINGS + +@.linker_private = linker_private unnamed_addr constant [15 x i8] c"linker_private\00", align 64 +@.linker_private_weak = linker_private_weak unnamed_addr constant [20 x i8] c"linker_private_weak\00", align 64 + +; CHECK: @.linker_private = private unnamed_addr constant [15 x i8] c"linker_private\00", align 64 +; CHECK: @.linker_private_weak = private unnamed_addr constant [20 x i8] c"linker_private_weak\00", align 64 + +; CHECK-WARNINGS: warning: '.linker_private' is deprecated, treating as PrivateLinkage +; CHECK-WARNINGS: @.linker_private = linker_private unnamed_addr constant [15 x i8] c"linker_private\00", align 64 +; CHECK-WARNINGS: ^ + +; CHECK-WARNINGS: warning: '.linker_private_weak' is deprecated, treating as PrivateLinkage +; CHECK-WARNINGS: @.linker_private_weak = linker_private_weak unnamed_addr constant [20 x i8] c"linker_private_weak\00", align 64 +; CHECK-WARNINGS: ^ + diff --git a/test/Bitcode/local-linkage-default-visibility.3.4.ll b/test/Bitcode/local-linkage-default-visibility.3.4.ll new file mode 100644 index 0000000..45a7b12 --- /dev/null +++ b/test/Bitcode/local-linkage-default-visibility.3.4.ll @@ -0,0 +1,79 @@ +; RUN: llvm-dis < %s.bc | FileCheck %s + +; local-linkage-default-visibility.3.4.ll.bc was generated by passing this file +; to llvm-as-3.4. The test checks that LLVM upgrades visibility of symbols +; with local linkage to default visibility. + +@default.internal.var = internal global i32 0 +; CHECK: @default.internal.var = internal global i32 0 + +@hidden.internal.var = internal hidden global i32 0 +; CHECK: @hidden.internal.var = internal global i32 0 + +@protected.internal.var = internal protected global i32 0 +; CHECK: @protected.internal.var = internal global i32 0 + +@default.private.var = private global i32 0 +; CHECK: @default.private.var = private global i32 0 + +@hidden.private.var = private hidden global i32 0 +; CHECK: @hidden.private.var = private global i32 0 + +@protected.private.var = private protected global i32 0 +; CHECK: @protected.private.var = private global i32 0 + +@global = global i32 0 + +@default.internal.alias = alias internal i32* @global +; CHECK: @default.internal.alias = alias internal i32* @global + +@hidden.internal.alias = hidden alias internal i32* @global +; CHECK: @hidden.internal.alias = alias internal i32* @global + +@protected.internal.alias = protected alias internal i32* @global +; CHECK: @protected.internal.alias = alias internal i32* @global + +@default.private.alias = alias private i32* @global +; CHECK: @default.private.alias = alias private i32* @global + +@hidden.private.alias = hidden alias private i32* @global +; CHECK: @hidden.private.alias = alias private i32* @global + +@protected.private.alias = protected alias private i32* @global +; CHECK: @protected.private.alias = alias private i32* @global + +define internal void @default.internal() { +; CHECK: define internal void @default.internal +entry: + ret void +} + +define internal hidden void @hidden.internal() { +; CHECK: define internal void @hidden.internal +entry: + ret void +} + +define internal protected void @protected.internal() { +; CHECK: define internal void @protected.internal +entry: + ret void +} + +define private void @default.private() { +; CHECK: define private void @default.private +entry: + ret void +} + +define private hidden void @hidden.private() { +; CHECK: define private void @hidden.private +entry: + ret void +} + +define private protected void @protected.private() { +; CHECK: define private void @protected.private +entry: + ret void +} diff --git a/test/Bitcode/local-linkage-default-visibility.3.4.ll.bc b/test/Bitcode/local-linkage-default-visibility.3.4.ll.bc Binary files differnew file mode 100644 index 0000000..6e49f7e --- /dev/null +++ b/test/Bitcode/local-linkage-default-visibility.3.4.ll.bc diff --git a/test/Bitcode/old-aliases.ll b/test/Bitcode/old-aliases.ll new file mode 100644 index 0000000..4ef47c0 --- /dev/null +++ b/test/Bitcode/old-aliases.ll @@ -0,0 +1,22 @@ +; RUN: llvm-dis < %s.bc | FileCheck %s + +; old-aliases.bc consist of this file assembled with an old llvm-as (3.5 trunk) +; from when aliases contained a ConstantExpr. + +@v1 = global i32 0 +; CHECK: @v1 = global i32 0 + +@v2 = global [1 x i32] zeroinitializer +; CHECK: @v2 = global [1 x i32] zeroinitializer + +@v3 = alias bitcast (i32* @v1 to i16*) +; CHECK: @v3 = alias i16, i32* @v1 + +@v4 = alias getelementptr ([1 x i32]* @v2, i32 0, i32 0) +; CHECK: @v4 = alias i32, [1 x i32]* @v2 + +@v5 = alias i32 addrspace(2)* addrspacecast (i32 addrspace(0)* @v1 to i32 addrspace(2)*) +; CHECK: @v5 = alias addrspace(2) i32, i32* @v1 + +@v6 = alias i16* @v3 +; CHECK: @v6 = alias i16, i32* @v1 diff --git a/test/Bitcode/old-aliases.ll.bc b/test/Bitcode/old-aliases.ll.bc Binary files differnew file mode 100644 index 0000000..1f157b2 --- /dev/null +++ b/test/Bitcode/old-aliases.ll.bc diff --git a/test/Bitcode/tailcall.ll b/test/Bitcode/tailcall.ll new file mode 100644 index 0000000..765b470 --- /dev/null +++ b/test/Bitcode/tailcall.ll @@ -0,0 +1,17 @@ +; RUN: llvm-as < %s | llvm-dis | FileCheck %s + +; Check that musttail and tail roundtrip. + +declare cc8191 void @t1_callee() +define cc8191 void @t1() { +; CHECK: tail call cc8191 void @t1_callee() + tail call cc8191 void @t1_callee() + ret void +} + +declare cc8191 void @t2_callee() +define cc8191 void @t2() { +; CHECK: musttail call cc8191 void @t2_callee() + musttail call cc8191 void @t2_callee() + ret void +} diff --git a/test/Bitcode/upgrade-global-ctors.ll b/test/Bitcode/upgrade-global-ctors.ll new file mode 100644 index 0000000..bd253a8 --- /dev/null +++ b/test/Bitcode/upgrade-global-ctors.ll @@ -0,0 +1,3 @@ +; RUN: llvm-dis < %s.bc| FileCheck %s + +; CHECK: @llvm.global_ctors = appending global [0 x { i32, void ()*, i8* }] zeroinitializer diff --git a/test/Bitcode/upgrade-global-ctors.ll.bc b/test/Bitcode/upgrade-global-ctors.ll.bc Binary files differnew file mode 100644 index 0000000..927fd91 --- /dev/null +++ b/test/Bitcode/upgrade-global-ctors.ll.bc |