mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
Test the noreturn function optimization
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21586 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
16
test/Transforms/PruneEH/simplenoreturntest.ll
Normal file
16
test/Transforms/PruneEH/simplenoreturntest.ll
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
; RUN: llvm-as < %s | opt -prune-eh | llvm-dis | not grep 'ret int'
|
||||||
|
|
||||||
|
void %noreturn() {
|
||||||
|
unwind
|
||||||
|
}
|
||||||
|
|
||||||
|
int %caller() {
|
||||||
|
; noreturn never returns, so the ret is unreachable.
|
||||||
|
call void %noreturn()
|
||||||
|
ret int 17
|
||||||
|
}
|
||||||
|
|
||||||
|
int %caller2() {
|
||||||
|
%T = call int %caller()
|
||||||
|
ret int %T ;; this is also unreachable!
|
||||||
|
}
|
Reference in New Issue
Block a user