summaryrefslogtreecommitdiff
path: root/test/Other/lint.ll
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-05-26 21:46:36 +0000
committerDan Gohman <gohman@apple.com>2010-05-26 21:46:36 +0000
commit113b3e2c6e30efd7c852d31e98b2d21778e52d1e (patch)
treec71326c36125e3458551aaccbfb383febf704c8c /test/Other/lint.ll
parentf86a619314d431ea5ccb1becb38d8a015f6c5501 (diff)
downloadllvm-113b3e2c6e30efd7c852d31e98b2d21778e52d1e.tar.gz
llvm-113b3e2c6e30efd7c852d31e98b2d21778e52d1e.tar.bz2
llvm-113b3e2c6e30efd7c852d31e98b2d21778e52d1e.tar.xz
Implement checking of the tail keyword.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104744 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Other/lint.ll')
-rw-r--r--test/Other/lint.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Other/lint.ll b/test/Other/lint.ll
index d0db5e46c6..eb0b7629e4 100644
--- a/test/Other/lint.ll
+++ b/test/Other/lint.ll
@@ -77,8 +77,20 @@ define void @not_vararg(i8* %p) nounwind {
ret void
}
+; CHECK: Undefined behavior: Branch to non-blockaddress
define void @use_indbr() {
indirectbr i8* bitcast (i32()* @foo to i8*), [label %block]
block:
unreachable
}
+
+; CHECK: Undefined behavior: Call with "tail" keyword references alloca or va_arg
+; CHECK: Undefined behavior: Call with "tail" keyword references alloca or va_arg
+declare void @tailcallee(i8*)
+define void @use_tail(i8* %valist) {
+ %t = alloca i8
+ tail call void @tailcallee(i8* %t)
+ %s = va_arg i8* %valist, i8*
+ tail call void @tailcallee(i8* %s)
+ ret void
+}