1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals
2 ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT
3 ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC
5 ; Don't promote paramaters of/arguments to naked functions
7 @g = common global i32 0, align 4
10 ; CHECK: @g = common global i32 0, align 4
13 ; CHECK-LABEL: define {{[^@]+}}@bar() {
15 ; CHECK-NEXT: [[CALL:%.*]] = call i32 @foo(ptr noundef nonnull align 4 dereferenceable(4) @g)
16 ; CHECK-NEXT: ret i32 [[CALL]]
19 %call = call i32 @foo(ptr @g)
23 define internal i32 @foo(ptr) #0 {
24 ; CHECK: Function Attrs: naked
25 ; CHECK-LABEL: define {{[^@]+}}@foo
26 ; CHECK-SAME: (ptr [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] {
28 ; CHECK-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
29 ; CHECK-NEXT: call void asm sideeffect "ldr r0, [r0] \0Abx lr \0A", ""()
30 ; CHECK-NEXT: unreachable
33 %retval = alloca i32, align 4
34 call void asm sideeffect "ldr r0, [r0] \0Abx lr \0A", ""()
39 attributes #0 = { naked }
41 ; CHECK: attributes #[[ATTR0]] = { naked }
43 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: