diff options
author | Duncan Sands <baldrick@free.fr> | 2007-12-10 19:09:40 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2007-12-10 19:09:40 +0000 |
commit | cbb8badce8838ece47cb806a0399c77d76a7e11b (patch) | |
tree | 778a2f778908ed6a3d1f6aee778559a87954d383 /test/Transforms/PruneEH | |
parent | 1eff70451fbb079c1d5b8f45ff8c8a2b8f74d7ba (diff) | |
download | external_llvm-cbb8badce8838ece47cb806a0399c77d76a7e11b.zip external_llvm-cbb8badce8838ece47cb806a0399c77d76a7e11b.tar.gz external_llvm-cbb8badce8838ece47cb806a0399c77d76a7e11b.tar.bz2 |
Make PruneEH update the nounwind/noreturn attributes
on functions as it calculates them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44802 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/PruneEH')
-rw-r--r-- | test/Transforms/PruneEH/simplenoreturntest.ll | 20 | ||||
-rw-r--r-- | test/Transforms/PruneEH/simpletest.ll | 19 | ||||
-rw-r--r-- | test/Transforms/PruneEH/simpletest.llx | 15 |
3 files changed, 27 insertions, 27 deletions
diff --git a/test/Transforms/PruneEH/simplenoreturntest.ll b/test/Transforms/PruneEH/simplenoreturntest.ll index 4a998b1..d2bd50c 100644 --- a/test/Transforms/PruneEH/simplenoreturntest.ll +++ b/test/Transforms/PruneEH/simplenoreturntest.ll @@ -1,17 +1,13 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -prune-eh | llvm-dis | \ -; RUN: not grep {ret i32} +; RUN: llvm-as < %s | opt -prune-eh | llvm-dis | not grep {ret i32} -void %noreturn() { - unwind -} +declare void @noreturn() noreturn; -int %caller() { - ; noreturn never returns, so the ret is unreachable. - call void %noreturn() - ret int 17 +define i32 @caller() { + call void @noreturn( ) + ret i32 17 } -int %caller2() { - %T = call int %caller() - ret int %T ;; this is also unreachable! +define i32 @caller2() { + %T = call i32 @caller( ) ; <i32> [#uses=1] + ret i32 %T } diff --git a/test/Transforms/PruneEH/simpletest.ll b/test/Transforms/PruneEH/simpletest.ll new file mode 100644 index 0000000..678e8d7 --- /dev/null +++ b/test/Transforms/PruneEH/simpletest.ll @@ -0,0 +1,19 @@ +; RUN: llvm-as < %s | opt -prune-eh | llvm-dis | not grep invoke + +declare void @nounwind() nounwind + +define internal void @foo() { + call void @nounwind() + ret void +} + +define i32 @caller() { + invoke void @foo( ) + to label %Normal unwind label %Except + +Normal: ; preds = %0 + ret i32 0 + +Except: ; preds = %0 + ret i32 1 +} diff --git a/test/Transforms/PruneEH/simpletest.llx b/test/Transforms/PruneEH/simpletest.llx deleted file mode 100644 index c368534..0000000 --- a/test/Transforms/PruneEH/simpletest.llx +++ /dev/null @@ -1,15 +0,0 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -prune-eh | llvm-dis | not grep invoke - -implementation - -internal void %foo() { - ret void ; does not throw -} - -int %caller() { - invoke void %foo() to label %Normal except label %Except -Normal: - ret int 0 -Except: - ret int 1 -} |