From 9bbcf09431cd203239de81b07f948c9537591e6d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 16 Oct 2004 18:24:11 +0000 Subject: [PATCH] testcases for undefined and unreachable git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17058 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Feature/undefined.ll | 15 +++++++++++++++ test/Feature/unreachable.ll | 13 +++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 test/Feature/undefined.ll create mode 100644 test/Feature/unreachable.ll diff --git a/test/Feature/undefined.ll b/test/Feature/undefined.ll new file mode 100644 index 00000000000..a71b906dcc0 --- /dev/null +++ b/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/test/Feature/unreachable.ll b/test/Feature/unreachable.ll new file mode 100644 index 00000000000..84c4552a627 --- /dev/null +++ b/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. +} -- 2.34.1