mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-10-06 14:57:41 +00:00
testcases for undefined and unreachable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17058 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9270efcc5f
commit
9bbcf09431
15
test/Feature/undefined.ll
Normal file
15
test/Feature/undefined.ll
Normal file
@ -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
|
||||
}
|
13
test/Feature/unreachable.ll
Normal file
13
test/Feature/unreachable.ll
Normal file
@ -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.
|
||||
}
|
Loading…
Reference in New Issue
Block a user