summaryrefslogtreecommitdiffstats
path: root/llvm/test/Verifier/operand-bundles.ll
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2015-09-24 23:34:52 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2015-09-24 23:34:52 +0000
commitb513a9fa4f1b68d10f658848e5bff39dab4bb8bd (patch)
tree3433cf0682329f82b9839ceeff71586505b63ab8 /llvm/test/Verifier/operand-bundles.ll
parentf021808d606eb35434fe54ae3ad2e1992af527b3 (diff)
downloadbcm5719-llvm-b513a9fa4f1b68d10f658848e5bff39dab4bb8bd.tar.gz
bcm5719-llvm-b513a9fa4f1b68d10f658848e5bff39dab4bb8bd.zip
[Bitcode][Asm] Teach LLVM to read and write operand bundles.
Summary: This also adds the first set of tests for operand bundles. The optimizer has not been audited to ensure that it does the right thing with operand bundles. Depends on D12456. Reviewers: reames, chandlerc, majnemer, dexonsmith, kmod, JosephTremoulet, rnk, bogner Subscribers: maksfb, llvm-commits Differential Revision: http://reviews.llvm.org/D12457 llvm-svn: 248551
Diffstat (limited to 'llvm/test/Verifier/operand-bundles.ll')
-rw-r--r--llvm/test/Verifier/operand-bundles.ll36
1 files changed, 36 insertions, 0 deletions
diff --git a/llvm/test/Verifier/operand-bundles.ll b/llvm/test/Verifier/operand-bundles.ll
new file mode 100644
index 00000000000..0aba61cccb8
--- /dev/null
+++ b/llvm/test/Verifier/operand-bundles.ll
@@ -0,0 +1,36 @@
+; RUN: not opt -verify < %s 2>&1 | FileCheck %s
+
+; Operand bundles uses are like regular uses, and need to be dominated
+; by their defs.
+
+declare void @g()
+
+define void @f0(i32* %ptr) {
+; CHECK: Instruction does not dominate all uses!
+; CHECK-NEXT: %x = add i32 42, 1
+; CHECK-NEXT: call void @g() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
+
+ entry:
+ %l = load i32, i32* %ptr
+ call void @g() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.0, i64 100, i32 %l) ]
+ %x = add i32 42, 1
+ ret void
+}
+
+define void @f1(i32* %ptr) personality i8 3 {
+; CHECK: Instruction does not dominate all uses!
+; CHECK-NEXT: %x = add i32 42, 1
+; CHECK-NEXT: invoke void @g() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
+
+ entry:
+ %l = load i32, i32* %ptr
+ invoke void @g() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.0, i64 100, i32 %l) ] to label %normal unwind label %exception
+
+exception:
+ %cleanup = landingpad i8 cleanup
+ br label %normal
+
+normal:
+ %x = add i32 42, 1
+ ret void
+}
OpenPOWER on IntegriCloud