summaryrefslogtreecommitdiffstats
path: root/test/Assembler
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2011-10-20 21:10:27 +0000
committerdim <dim@FreeBSD.org>2011-10-20 21:10:27 +0000
commit7b3392326c40c3c20697816acae597ba7b3144eb (patch)
tree2cbcf22585e99f8a87d12d5ff94f392c0d266819 /test/Assembler
parent1176aa52646fe641a4243a246aa7f960c708a274 (diff)
downloadFreeBSD-src-7b3392326c40c3c20697816acae597ba7b3144eb.zip
FreeBSD-src-7b3392326c40c3c20697816acae597ba7b3144eb.tar.gz
Vendor import of llvm release_30 branch r142614:
http://llvm.org/svn/llvm-project/llvm/branches/release_30@142614
Diffstat (limited to 'test/Assembler')
-rw-r--r--test/Assembler/2003-06-17-InvokeDisassemble.ll10
-rw-r--r--test/Assembler/AutoUpgradeIntrinsics.ll13
-rw-r--r--test/Assembler/atomic.ll26
3 files changed, 46 insertions, 3 deletions
diff --git a/test/Assembler/2003-06-17-InvokeDisassemble.ll b/test/Assembler/2003-06-17-InvokeDisassemble.ll
index 922a996..8a9670e 100644
--- a/test/Assembler/2003-06-17-InvokeDisassemble.ll
+++ b/test/Assembler/2003-06-17-InvokeDisassemble.ll
@@ -1,9 +1,13 @@
; RUN: llvm-as < %s | llvm-dis
define void @test() {
- invoke void @test( )
- to label %Next unwind label %Next
+ invoke void @test( )
+ to label %Next unwind label %Next
Next: ; preds = %0, %0
- ret void
+ %lpad = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+ cleanup
+ ret void
}
+
+declare i32 @__gxx_personality_v0(...)
diff --git a/test/Assembler/AutoUpgradeIntrinsics.ll b/test/Assembler/AutoUpgradeIntrinsics.ll
index eb4ac76..daffa3d 100644
--- a/test/Assembler/AutoUpgradeIntrinsics.ll
+++ b/test/Assembler/AutoUpgradeIntrinsics.ll
@@ -40,3 +40,16 @@ define void @p(i8* %ptr) {
tail call void @llvm.prefetch(i8* %ptr, i32 0, i32 1)
ret void
}
+
+declare i32 @nest_f(i8* nest, i32)
+declare i8* @llvm.init.trampoline(i8*, i8*, i8*)
+
+define void @test_trampolines() {
+; CHECK: call void @llvm.init.trampoline(i8* null, i8* bitcast (i32 (i8*, i32)* @nest_f to i8*), i8* null)
+; CHECK: call i8* @llvm.adjust.trampoline(i8* null)
+
+ call i8* @llvm.init.trampoline(i8* null,
+ i8* bitcast (i32 (i8*, i32)* @nest_f to i8*),
+ i8* null)
+ ret void
+}
diff --git a/test/Assembler/atomic.ll b/test/Assembler/atomic.ll
new file mode 100644
index 0000000..b245cde
--- /dev/null
+++ b/test/Assembler/atomic.ll
@@ -0,0 +1,26 @@
+; RUN: opt < %s | opt -S | FileCheck %s
+; Basic smoke test for atomic operations.
+
+define void @f(i32* %x) {
+ ; CHECK: load atomic i32* %x unordered, align 4
+ load atomic i32* %x unordered, align 4
+ ; CHECK: load atomic volatile i32* %x singlethread acquire, align 4
+ load atomic volatile i32* %x singlethread acquire, align 4
+ ; CHECK: store atomic i32 3, i32* %x release, align 4
+ 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: 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
+ atomicrmw volatile xchg i32* %x, i32 10 monotonic
+ ; CHECK: fence singlethread release
+ fence singlethread release
+ ; CHECK: fence seq_cst
+ fence seq_cst
+ ret void
+}
OpenPOWER on IntegriCloud