aboutsummaryrefslogtreecommitdiffstats
path: root/test/Assembler
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2014-04-23 16:57:46 -0700
committerStephen Hines <srhines@google.com>2014-04-24 15:53:16 -0700
commit36b56886974eae4f9c5ebc96befd3e7bfe5de338 (patch)
treee6cfb69fbbd937f450eeb83bfb83b9da3b01275a /test/Assembler
parent69a8640022b04415ae9fac62f8ab090601d8f889 (diff)
downloadexternal_llvm-36b56886974eae4f9c5ebc96befd3e7bfe5de338.zip
external_llvm-36b56886974eae4f9c5ebc96befd3e7bfe5de338.tar.gz
external_llvm-36b56886974eae4f9c5ebc96befd3e7bfe5de338.tar.bz2
Update to LLVM 3.5a.
Change-Id: Ifadecab779f128e62e430c2b4f6ddd84953ed617
Diffstat (limited to 'test/Assembler')
-rw-r--r--test/Assembler/2007-09-10-AliasFwdRef.ll4
-rw-r--r--test/Assembler/ConstantExprFoldSelect.ll8
-rw-r--r--test/Assembler/addrspacecast-alias.ll6
-rw-r--r--test/Assembler/atomic.ll10
-rw-r--r--test/Assembler/functionlocal-metadata.ll2
-rw-r--r--test/Assembler/getInt.ll3
-rw-r--r--test/Assembler/inalloca.ll16
-rw-r--r--test/Assembler/invalid-name.ll6
-rw-r--r--test/Assembler/invalid_cast3.ll7
9 files changed, 56 insertions, 6 deletions
diff --git a/test/Assembler/2007-09-10-AliasFwdRef.ll b/test/Assembler/2007-09-10-AliasFwdRef.ll
index b21491b..2ebfc27 100644
--- a/test/Assembler/2007-09-10-AliasFwdRef.ll
+++ b/test/Assembler/2007-09-10-AliasFwdRef.ll
@@ -6,4 +6,6 @@
-declare extern_weak i32 @pthread_cancel(i32)
+define weak i32 @pthread_cancel(i32) {
+ ret i32 0
+}
diff --git a/test/Assembler/ConstantExprFoldSelect.ll b/test/Assembler/ConstantExprFoldSelect.ll
new file mode 100644
index 0000000..b000e02
--- /dev/null
+++ b/test/Assembler/ConstantExprFoldSelect.ll
@@ -0,0 +1,8 @@
+; RUN: llvm-as < %s | llvm-dis | FileCheck %s
+; PR18319
+
+define void @function() {
+ %c = trunc <4 x i16> select (<4 x i1> <i1 undef, i1 undef, i1 false, i1 true>, <4 x i16> <i16 undef, i16 2, i16 3, i16 4>, <4 x i16> <i16 -1, i16 -2, i16 -3, i16 -4>) to <4 x i8>
+; CHECK: <i16 undef, i16 -2, i16 -3, i16 4>
+ ret void
+}
diff --git a/test/Assembler/addrspacecast-alias.ll b/test/Assembler/addrspacecast-alias.ll
new file mode 100644
index 0000000..6623a25
--- /dev/null
+++ b/test/Assembler/addrspacecast-alias.ll
@@ -0,0 +1,6 @@
+; RUN: llvm-as -disable-output %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)*)
diff --git a/test/Assembler/atomic.ll b/test/Assembler/atomic.ll
index b245cde..a2ae58e 100644
--- a/test/Assembler/atomic.ll
+++ b/test/Assembler/atomic.ll
@@ -10,10 +10,12 @@ define void @f(i32* %x) {
store atomic i32 3, i32* %x release, align 4
; CHECK: store atomic volatile i32 3, i32* %x singlethread monotonic, align 4
store atomic volatile i32 3, i32* %x singlethread monotonic, align 4
- ; CHECK: cmpxchg i32* %x, i32 1, i32 0 singlethread monotonic
- cmpxchg i32* %x, i32 1, i32 0 singlethread monotonic
- ; CHECK: cmpxchg volatile i32* %x, i32 0, i32 1 acq_rel
- cmpxchg volatile i32* %x, i32 0, i32 1 acq_rel
+ ; CHECK: cmpxchg i32* %x, i32 1, i32 0 singlethread monotonic monotonic
+ cmpxchg i32* %x, i32 1, i32 0 singlethread monotonic monotonic
+ ; CHECK: cmpxchg volatile i32* %x, i32 0, i32 1 acq_rel acquire
+ cmpxchg volatile i32* %x, i32 0, i32 1 acq_rel acquire
+ ; CHECK: cmpxchg i32* %x, i32 42, i32 0 acq_rel monotonic
+ cmpxchg i32* %x, i32 42, i32 0 acq_rel monotonic
; CHECK: atomicrmw add i32* %x, i32 10 seq_cst
atomicrmw add i32* %x, i32 10 seq_cst
; CHECK: atomicrmw volatile xchg i32* %x, i32 10 monotonic
diff --git a/test/Assembler/functionlocal-metadata.ll b/test/Assembler/functionlocal-metadata.ll
index 0d93bfd..f9b1d74 100644
--- a/test/Assembler/functionlocal-metadata.ll
+++ b/test/Assembler/functionlocal-metadata.ll
@@ -53,4 +53,4 @@ declare void @llvm.dbg.value(metadata, i64, metadata) nounwind readnone
; CHECK: ![[ID0]] = metadata !{i32 662302, i32 26, metadata ![[ID1]], null}
; CHECK: ![[ID1]] = metadata !{i32 4, metadata !"foo"}
; CHECK: ![[ID2]] = metadata !{metadata !"bar"}
-; CHECK; ![[ID3]] = metadata !{metadata !"foo"}
+; CHECK: ![[ID3]] = metadata !{metadata !"foo"}
diff --git a/test/Assembler/getInt.ll b/test/Assembler/getInt.ll
new file mode 100644
index 0000000..8e2537a
--- /dev/null
+++ b/test/Assembler/getInt.ll
@@ -0,0 +1,3 @@
+; RUN: not opt < %s 2>&1 | grep 'not a number, or does not fit in an unsigned int'
+
+target datalayout = "p:4294967296:64:64"
diff --git a/test/Assembler/inalloca.ll b/test/Assembler/inalloca.ll
new file mode 100644
index 0000000..ff7a87e
--- /dev/null
+++ b/test/Assembler/inalloca.ll
@@ -0,0 +1,16 @@
+; RUN: llvm-as %s -o /dev/null
+
+define void @a() {
+entry:
+ %0 = alloca inalloca i32
+ %1 = alloca inalloca [2 x i32]
+ %2 = alloca inalloca i32, i32 2
+ %3 = alloca inalloca i32, i32 2, align 16
+ %4 = alloca inalloca i32, i32 2, align 16, !foo !0
+ %5 = alloca i32, i32 2, align 16, !foo !0
+ %6 = alloca i32, i32 2, align 16
+ ret void
+}
+
+!0 = metadata !{i32 662302, null}
+!foo = !{ !0 }
diff --git a/test/Assembler/invalid-name.ll b/test/Assembler/invalid-name.ll
new file mode 100644
index 0000000..d9d7a11
--- /dev/null
+++ b/test/Assembler/invalid-name.ll
@@ -0,0 +1,6 @@
+; RUN: not llvm-as %s 2>&1 | FileCheck %s
+
+; CHECK: expected function name
+define void @"zed\00bar"() {
+ ret void
+}
diff --git a/test/Assembler/invalid_cast3.ll b/test/Assembler/invalid_cast3.ll
new file mode 100644
index 0000000..cc956ce
--- /dev/null
+++ b/test/Assembler/invalid_cast3.ll
@@ -0,0 +1,7 @@
+; RUN: not llvm-as < %s 2>&1 | FileCheck %s
+
+; CHECK: invalid cast opcode for cast from '<4 x i32*>' to '<2 x i32*>'
+define <2 x i32*> @illegal_vector_pointer_bitcast_num_elements(<4 x i32*> %c) {
+ %bc = bitcast <4 x i32*> %c to <2 x i32*>
+ ret <2 x i32*> %bc
+}