llvm-6502/test/Transforms/PruneEH/pr23971.ll
David Majnemer 1166ce2460 [PruneEH] A naked, noinline function can return via InlineAsm
The PruneEH pass tries to annotate functions as 'noreturn' if it doesn't
see a ReturnInst.  However, a naked function containing inline assembly
can contain control flow leaving the function.

This fixes PR23971.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240876 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-27 07:52:53 +00:00

22 lines
412 B
LLVM

; RUN: opt -S -prune-eh < %s | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define void @f() #0 {
entry:
call void asm sideeffect "ret\0A\09", "~{dirflag},~{fpsr},~{flags}"()
unreachable
}
define i32 @g() {
entry:
call void @f()
ret i32 42
}
; CHECK-LABEL: define i32 @g()
; CHECK: ret i32 42
attributes #0 = { naked noinline }