diff options
Diffstat (limited to 'test/Assembler')
21 files changed, 104 insertions, 12 deletions
diff --git a/test/Assembler/2009-04-25-AliasGEP.ll b/test/Assembler/2009-04-25-AliasGEP.ll deleted file mode 100644 index 6d07208..0000000 --- a/test/Assembler/2009-04-25-AliasGEP.ll +++ /dev/null @@ -1,8 +0,0 @@ -; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis -; PR4066 -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" -target triple = "i386-apple-darwin9" - %struct.i2c_device_id = type { } -@w83l785ts_id = internal constant [0 x %struct.i2c_device_id] zeroinitializer, align 1 ; <[0 x %struct.i2c_device_id]*> [#uses=1] - -@__mod_i2c_device_table = alias getelementptr ([0 x %struct.i2c_device_id]* @w83l785ts_id, i32 0, i32 0) ; <%struct.i2c_device_id*> [#uses=0] diff --git a/test/Assembler/addrspacecast-alias.ll b/test/Assembler/addrspacecast-alias.ll index 6623a25..052a141 100644 --- a/test/Assembler/addrspacecast-alias.ll +++ b/test/Assembler/addrspacecast-alias.ll @@ -1,6 +1,7 @@ -; RUN: llvm-as -disable-output %s +; RUN: llvm-as < %s | llvm-dis | FileCheck %s ; Test that global aliases are allowed to be constant addrspacecast @i = internal addrspace(1) global i8 42 -@ia = alias internal i8 addrspace(2)* addrspacecast (i8 addrspace(1)* @i to i8 addrspace(2)*) +@ia = alias internal addrspace(2) i8 addrspace(3)*, i8 addrspace(1)* @i +; CHECK: @ia = alias internal addrspace(2) i8 addrspace(3)*, i8 addrspace(1)* @i diff --git a/test/Assembler/alias-addrspace.ll b/test/Assembler/alias-addrspace.ll new file mode 100644 index 0000000..6d378e4 --- /dev/null +++ b/test/Assembler/alias-addrspace.ll @@ -0,0 +1,6 @@ +; RUN: not llvm-as %s 2>&1 | FileCheck %s + +@foo = global i32 42 +@bar = alias internal addrspace(1) i32* @foo + +CHECK: error: A type is required if addrspace is given diff --git a/test/Assembler/alias-redefinition.ll b/test/Assembler/alias-redefinition.ll new file mode 100644 index 0000000..19ad85b --- /dev/null +++ b/test/Assembler/alias-redefinition.ll @@ -0,0 +1,7 @@ +; RUN: not llvm-as %s 2>&1 | FileCheck %s + +; CHECK: error: redefinition of global named '@bar' + +@foo = global i32 0 +@bar = alias i32* @foo +@bar = alias i32* @foo diff --git a/test/Assembler/alias-to-alias.ll b/test/Assembler/alias-to-alias.ll new file mode 100644 index 0000000..1ea99bb --- /dev/null +++ b/test/Assembler/alias-to-alias.ll @@ -0,0 +1,5 @@ +; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s +; CHECK: Alias must point to function or variable + +@b1 = alias i32* @c1 +@c1 = alias i32* @b1 diff --git a/test/Assembler/alias-to-alias2.ll b/test/Assembler/alias-to-alias2.ll new file mode 100644 index 0000000..a8a0196 --- /dev/null +++ b/test/Assembler/alias-to-alias2.ll @@ -0,0 +1,7 @@ +; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s +; CHECK: error: Alias is pointed by alias b1 + +@g = global i32 42 + +@b1 = alias i32* @c1 +@c1 = alias i32* @g diff --git a/test/Assembler/alias-type.ll b/test/Assembler/alias-type.ll new file mode 100644 index 0000000..ead3e95 --- /dev/null +++ b/test/Assembler/alias-type.ll @@ -0,0 +1,6 @@ +; RUN: not llvm-as %s 2>&1 | FileCheck %s + +@foo = global i32 42 +@bar = alias i32 @foo + +CHECK: error: An alias must have pointer type diff --git a/test/Assembler/half-constprop.ll b/test/Assembler/half-constprop.ll index 03ccdda..9e24f72 100644 --- a/test/Assembler/half-constprop.ll +++ b/test/Assembler/half-constprop.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -O3 | llvm-dis | FileCheck %s +; RUN: opt < %s -O3 -S | FileCheck %s ; Testing half constant propagation. define half @abc() nounwind { diff --git a/test/Assembler/half-conv.ll b/test/Assembler/half-conv.ll index bf9ae57..70a6b86 100644 --- a/test/Assembler/half-conv.ll +++ b/test/Assembler/half-conv.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -O3 | llvm-dis | FileCheck %s +; RUN: opt < %s -O3 -S | FileCheck %s ; Testing half to float conversion. define float @abc() nounwind { diff --git a/test/Assembler/internal-hidden-alias.ll b/test/Assembler/internal-hidden-alias.ll new file mode 100644 index 0000000..660514b --- /dev/null +++ b/test/Assembler/internal-hidden-alias.ll @@ -0,0 +1,6 @@ +; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s + +@global = global i32 0 + +@alias = hidden alias internal i32* @global +; CHECK: symbol with local linkage must have default visibility diff --git a/test/Assembler/internal-hidden-function.ll b/test/Assembler/internal-hidden-function.ll new file mode 100644 index 0000000..193ed7c --- /dev/null +++ b/test/Assembler/internal-hidden-function.ll @@ -0,0 +1,7 @@ +; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s + +define internal hidden void @function() { +; CHECK: symbol with local linkage must have default visibility +entry: + ret void +} diff --git a/test/Assembler/internal-hidden-variable.ll b/test/Assembler/internal-hidden-variable.ll new file mode 100644 index 0000000..eddd067 --- /dev/null +++ b/test/Assembler/internal-hidden-variable.ll @@ -0,0 +1,4 @@ +; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s + +@var = internal hidden global i32 0 +; CHECK: symbol with local linkage must have default visibility diff --git a/test/Assembler/internal-protected-alias.ll b/test/Assembler/internal-protected-alias.ll new file mode 100644 index 0000000..d785826 --- /dev/null +++ b/test/Assembler/internal-protected-alias.ll @@ -0,0 +1,6 @@ +; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s + +@global = global i32 0 + +@alias = protected alias internal i32* @global +; CHECK: symbol with local linkage must have default visibility diff --git a/test/Assembler/internal-protected-function.ll b/test/Assembler/internal-protected-function.ll new file mode 100644 index 0000000..944cb75 --- /dev/null +++ b/test/Assembler/internal-protected-function.ll @@ -0,0 +1,7 @@ +; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s + +define internal protected void @function() { +; CHECK: symbol with local linkage must have default visibility +entry: + ret void +} diff --git a/test/Assembler/internal-protected-variable.ll b/test/Assembler/internal-protected-variable.ll new file mode 100644 index 0000000..df02275 --- /dev/null +++ b/test/Assembler/internal-protected-variable.ll @@ -0,0 +1,4 @@ +; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s + +@var = internal protected global i32 0 +; CHECK: symbol with local linkage must have default visibility diff --git a/test/Assembler/private-hidden-alias.ll b/test/Assembler/private-hidden-alias.ll new file mode 100644 index 0000000..58be92a --- /dev/null +++ b/test/Assembler/private-hidden-alias.ll @@ -0,0 +1,6 @@ +; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s + +@global = global i32 0 + +@alias = hidden alias private i32* @global +; CHECK: symbol with local linkage must have default visibility diff --git a/test/Assembler/private-hidden-function.ll b/test/Assembler/private-hidden-function.ll new file mode 100644 index 0000000..dd73f04 --- /dev/null +++ b/test/Assembler/private-hidden-function.ll @@ -0,0 +1,7 @@ +; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s + +define private hidden void @function() { +; CHECK: symbol with local linkage must have default visibility +entry: + ret void +} diff --git a/test/Assembler/private-hidden-variable.ll b/test/Assembler/private-hidden-variable.ll new file mode 100644 index 0000000..ce6bfa9 --- /dev/null +++ b/test/Assembler/private-hidden-variable.ll @@ -0,0 +1,4 @@ +; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s + +@var = private hidden global i32 0 +; CHECK: symbol with local linkage must have default visibility diff --git a/test/Assembler/private-protected-alias.ll b/test/Assembler/private-protected-alias.ll new file mode 100644 index 0000000..a72c248 --- /dev/null +++ b/test/Assembler/private-protected-alias.ll @@ -0,0 +1,6 @@ +; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s + +@global = global i32 0 + +@alias = protected alias private i32* @global +; CHECK: symbol with local linkage must have default visibility diff --git a/test/Assembler/private-protected-function.ll b/test/Assembler/private-protected-function.ll new file mode 100644 index 0000000..5dbb420 --- /dev/null +++ b/test/Assembler/private-protected-function.ll @@ -0,0 +1,7 @@ +; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s + +define private protected void @function() { +; CHECK: symbol with local linkage must have default visibility +entry: + ret void +} diff --git a/test/Assembler/private-protected-variable.ll b/test/Assembler/private-protected-variable.ll new file mode 100644 index 0000000..c4458f5 --- /dev/null +++ b/test/Assembler/private-protected-variable.ll @@ -0,0 +1,4 @@ +; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s + +@var = private protected global i32 0 +; CHECK: symbol with local linkage must have default visibility |