aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/NaCl/replace-ptrs-with-ints.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Transforms/NaCl/replace-ptrs-with-ints.ll b/test/Transforms/NaCl/replace-ptrs-with-ints.ll
index bab6101848..d7e85f6da6 100644
--- a/test/Transforms/NaCl/replace-ptrs-with-ints.ll
+++ b/test/Transforms/NaCl/replace-ptrs-with-ints.ll
@@ -447,6 +447,8 @@ define void @debug_value(i32 %val, i8* %ptr) {
declare void @llvm.lifetime.start(i64 %size, i8* %ptr)
+declare void @llvm.invariant.start(i64 %size, i8* %ptr)
+declare void @llvm.invariant.end(i64 %size, i8* %ptr)
; GVN can introduce the following horrible corner case of a lifetime
; marker referencing a PHI node. But we convert the phi to i32 type,
@@ -486,6 +488,16 @@ define void @alloca_lifetime_via_bitcast() {
; CHECK-NEXT: %buf = alloca [4 x i8]
; CHECK-NEXT: ret void
+define void @strip_invariant_markers() {
+ %buf = alloca i8
+ call void @llvm.invariant.start(i64 1, i8* %buf)
+ call void @llvm.invariant.end(i64 1, i8* %buf)
+ ret void
+}
+; CHECK: define void @strip_invariant_markers() {
+; CHECK-NEXT: %buf = alloca [1 x i8]
+; CHECK-NEXT: ret void
+
; "nocapture" and "noalias" only apply to pointers, so must be stripped.
define void @nocapture_attr(i8* nocapture noalias %ptr) {