summaryrefslogtreecommitdiffstats
path: root/llvm/test/Other
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
commit1249adf160fbb596f83749361725922aba600d03 (patch)
treea5ea60e9baf36426dcd6b3744248cb4eaa415d5f /llvm/test/Other
parent5f81b9f3f610400f09becc5d1cf005ed45c9c984 (diff)
downloadbcm5719-llvm-1249adf160fbb596f83749361725922aba600d03.tar.gz
bcm5719-llvm-1249adf160fbb596f83749361725922aba600d03.zip
Implement checking of the tail keyword.
llvm-svn: 104744
Diffstat (limited to 'llvm/test/Other')
-rw-r--r--llvm/test/Other/lint.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/test/Other/lint.ll b/llvm/test/Other/lint.ll
index d0db5e46c66..eb0b7629e43 100644
--- a/llvm/test/Other/lint.ll
+++ b/llvm/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
+}
OpenPOWER on IntegriCloud