summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/FunctionAttrs
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
commit0186347c4c0efe83ee1683a2cb437e014ec55b68 (patch)
tree448ec1552cd70b533d3c46c4bc837b0c4364d302 /llvm/test/Transforms/FunctionAttrs
parente441264019180f9a6a58d732b09cfc96207b42aa (diff)
downloadbcm5719-llvm-0186347c4c0efe83ee1683a2cb437e014ec55b68.tar.gz
bcm5719-llvm-0186347c4c0efe83ee1683a2cb437e014ec55b68.zip
Fix a bug in mayHaveSideEffects. Functions that do not return are now considered as instructions with side effects.
rdar://13227456 llvm-svn: 175553
Diffstat (limited to 'llvm/test/Transforms/FunctionAttrs')
-rw-r--r--llvm/test/Transforms/FunctionAttrs/noreturn.ll18
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/test/Transforms/FunctionAttrs/noreturn.ll b/llvm/test/Transforms/FunctionAttrs/noreturn.ll
new file mode 100644
index 00000000000..470ebcb1d3c
--- /dev/null
+++ b/llvm/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
+}
+
OpenPOWER on IntegriCloud