1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes
2 ; RUN: opt < %s -passes=argpromotion -S | FileCheck %s
4 ; Don't promote paramaters of/arguments to naked functions
6 @g = common global i32 0, align 4
9 ; CHECK-LABEL: define {{[^@]+}}@bar() {
11 ; CHECK-NEXT: [[CALL:%.*]] = call i32 @foo(ptr @g)
12 ; CHECK-NEXT: ret i32 [[CALL]]
15 %call = call i32 @foo(ptr @g)
19 define internal i32 @foo(ptr) #0 {
20 ; CHECK-LABEL: define {{[^@]+}}@foo
21 ; CHECK-SAME: (ptr [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] {
23 ; CHECK-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
24 ; CHECK-NEXT: call void asm sideeffect "ldr r0, [r0] \0Abx lr \0A", ""()
25 ; CHECK-NEXT: unreachable
28 %retval = alloca i32, align 4
29 call void asm sideeffect "ldr r0, [r0] \0Abx lr \0A", ""()
34 attributes #0 = { naked }