From 03544ec2a43fab162d25cf44627d1d08430bcccd Mon Sep 17 00:00:00 2001 From: Nadav Rotem Date: Tue, 19 Feb 2013 20:02:09 +0000 Subject: 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 --- test/Transforms/FunctionAttrs/noreturn.ll | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/Transforms/FunctionAttrs/noreturn.ll (limited to 'test/Transforms/FunctionAttrs') 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 +} + -- cgit v1.1