- Fix for bug 36078. - Prevent the functionattrs, function-attrs, globalopt and argpromotion passes from changing naked functions. - These passes can perform some alterations to the functions that should not be applied. An example is removing parameters that are seemingly not used because they are only referenced in the inline assembly. Another example is marking the function as fastcc. llvm-svn: 325788
24 lines
504 B
LLVM
24 lines
504 B
LLVM
; RUN: opt < %s -globalopt -S | FileCheck %s
|
|
|
|
; Check that naked functions don't get marked with fast calling conventions
|
|
|
|
@g = common global i32 0, align 4
|
|
|
|
define i32 @bar() {
|
|
entry:
|
|
%call = call i32 @foo(i32* @g)
|
|
; CHECK: %call = call i32 @foo(i32* @g)
|
|
ret i32 %call
|
|
}
|
|
|
|
define internal i32 @foo(i32*) #0 {
|
|
entry:
|
|
%retval = alloca i32, align 4
|
|
call void asm sideeffect "ldr r0, [r0] \0Abx lr \0A", ""()
|
|
unreachable
|
|
}
|
|
|
|
; CHECK: define internal i32 @foo(i32*)
|
|
|
|
attributes #0 = { naked }
|