summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test')
-rwxr-xr-xllvm/test/Verifier/inalloca-vararg.ll9
-rw-r--r--llvm/test/Verifier/inalloca1.ll3
-rw-r--r--llvm/test/Verifier/inalloca2.ll6
3 files changed, 15 insertions, 3 deletions
diff --git a/llvm/test/Verifier/inalloca-vararg.ll b/llvm/test/Verifier/inalloca-vararg.ll
new file mode 100755
index 00000000000..6729c428304
--- /dev/null
+++ b/llvm/test/Verifier/inalloca-vararg.ll
@@ -0,0 +1,9 @@
+; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
+
+declare void @h(i32, ...)
+define void @i() {
+ %args = alloca i32
+ call void (i32, ...)* @h(i32 1, i32* inalloca %args, i32 3)
+; CHECK: inalloca isn't on the last argument!
+ ret void
+}
diff --git a/llvm/test/Verifier/inalloca1.ll b/llvm/test/Verifier/inalloca1.ll
index 9408c95ee31..38b5507abba 100644
--- a/llvm/test/Verifier/inalloca1.ll
+++ b/llvm/test/Verifier/inalloca1.ll
@@ -17,3 +17,6 @@ declare void @e(i64* readonly inalloca %p)
declare void @f(void ()* inalloca %p)
; CHECK: do not support unsized types
+
+declare void @g(i32* inalloca %p, i32 %p2)
+; CHECK: inalloca isn't on the last parameter!
diff --git a/llvm/test/Verifier/inalloca2.ll b/llvm/test/Verifier/inalloca2.ll
index acdd9ae3a66..ed65667dc30 100644
--- a/llvm/test/Verifier/inalloca2.ll
+++ b/llvm/test/Verifier/inalloca2.ll
@@ -1,4 +1,6 @@
-; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
+; This used to be invalid, but now it's valid. Ensure the verifier
+; doesn't reject it.
+; RUN: llvm-as %s -o /dev/null
declare void @doit(i64* inalloca %a)
@@ -7,7 +9,6 @@ entry:
%a = alloca [2 x i32]
%b = bitcast [2 x i32]* %a to i64*
call void @doit(i64* inalloca %b)
-; CHECK: Inalloca argument is not an alloca!
ret void
}
@@ -16,6 +17,5 @@ entry:
%a = alloca i64
call void @doit(i64* inalloca %a)
call void @doit(i64* inalloca %a)
-; CHECK: Allocas can be used at most once with inalloca!
ret void
}
OpenPOWER on IntegriCloud