aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2013-02-19 20:02:09 +0000
committerNadav Rotem <nrotem@apple.com>2013-02-19 20:02:09 +0000
commit03544ec2a43fab162d25cf44627d1d08430bcccd (patch)
treef2fba81aeee9fe84179a7af0dbdfcfe078b2e8f8 /test/Transforms
parenta175396816a9b28835acfe2cd07250881f1fee6c (diff)
downloadexternal_llvm-03544ec2a43fab162d25cf44627d1d08430bcccd.zip
external_llvm-03544ec2a43fab162d25cf44627d1d08430bcccd.tar.gz
external_llvm-03544ec2a43fab162d25cf44627d1d08430bcccd.tar.bz2
Fix a bug in mayHaveSideEffects. Functions that do not return are now considered as instructions with side effects.
rdar://13227456 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175553 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r--test/Transforms/FunctionAttrs/noreturn.ll18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/Transforms/FunctionAttrs/noreturn.ll b/test/Transforms/FunctionAttrs/noreturn.ll
new file mode 100644
index 0000000..470ebcb
--- /dev/null
+++ b/test/Transforms/FunctionAttrs/noreturn.ll
@@ -0,0 +1,18 @@
+; RUN: opt < %s -functionattrs -instcombine -S | FileCheck %s
+
+define void @endless_loop() noreturn nounwind readnone ssp uwtable {
+entry:
+ br label %while.body
+
+while.body:
+ br label %while.body
+}
+;CHECK: @main
+;CHECK: endless_loop
+;CHECK: ret
+define i32 @main() noreturn nounwind ssp uwtable {
+entry:
+ tail call void @endless_loop()
+ unreachable
+}
+