summaryrefslogtreecommitdiffstats
path: root/llvm/test/Feature
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-10-16 18:24:11 +0000
committerChris Lattner <sabre@nondot.org>2004-10-16 18:24:11 +0000
commitaef20fbbb95f8f982ec5db80993799cc13a0c830 (patch)
tree7739950ddfea4faf18ddc6311c0fcfdf349cab1f /llvm/test/Feature
parentfcfe78eaf81d6d27a47b15704c4d64cfc56b2b98 (diff)
downloadbcm5719-llvm-aef20fbbb95f8f982ec5db80993799cc13a0c830.tar.gz
bcm5719-llvm-aef20fbbb95f8f982ec5db80993799cc13a0c830.zip
testcases for undefined and unreachable
llvm-svn: 17058
Diffstat (limited to 'llvm/test/Feature')
-rw-r--r--llvm/test/Feature/undefined.ll15
-rw-r--r--llvm/test/Feature/unreachable.ll13
2 files changed, 28 insertions, 0 deletions
diff --git a/llvm/test/Feature/undefined.ll b/llvm/test/Feature/undefined.ll
new file mode 100644
index 00000000000..a71b906dcc0
--- /dev/null
+++ b/llvm/test/Feature/undefined.ll
@@ -0,0 +1,15 @@
+
+%X = global int undef
+
+implementation
+
+declare int "atoi"(sbyte *)
+
+int %test() {
+ ret int undef
+}
+
+int %test2() {
+ %X = add int undef, 1
+ ret int %X
+}
diff --git a/llvm/test/Feature/unreachable.ll b/llvm/test/Feature/unreachable.ll
new file mode 100644
index 00000000000..84c4552a627
--- /dev/null
+++ b/llvm/test/Feature/unreachable.ll
@@ -0,0 +1,13 @@
+
+implementation
+
+declare void %bar()
+
+int %foo() { ;; Calling this function has undefined behavior
+ unreachable
+}
+
+double %xyz() {
+ call void %bar()
+ unreachable ;; Bar must not return.
+}
OpenPOWER on IntegriCloud