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 ; ArgumentPromotion should preserve the default function address space
6 ; from the data layout.
8 target datalayout = "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8"
10 @g = common global i32 0, align 4
13 ; CHECK: @g = common global i32 0, align 4
16 ; CHECK-LABEL: define {{[^@]+}}@bar() addrspace(1) {
18 ; CHECK-NEXT: [[CALL:%.*]] = call addrspace(1) i32 @foo() #[[ATTR1:[0-9]+]]
19 ; CHECK-NEXT: unreachable
23 %call = call i32 @foo(ptr @g)
27 define internal i32 @foo(ptr) {
28 ; CHECK: Function Attrs: noreturn memory(readwrite, argmem: none)
29 ; CHECK-LABEL: define {{[^@]+}}@foo
30 ; CHECK-SAME: () addrspace(1) #[[ATTR0:[0-9]+]] {
32 ; CHECK-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
33 ; CHECK-NEXT: [[RETVAL1:%.*]] = alloca i8, i32 0, align 4
34 ; CHECK-NEXT: call addrspace(0) void asm sideeffect "ldr r0, [r0] \0Abx lr \0A", ""()
35 ; CHECK-NEXT: unreachable
38 %retval = alloca i32, align 4
39 call void asm sideeffect "ldr r0, [r0] \0Abx lr \0A", ""()
44 ; CHECK: attributes #[[ATTR0]] = { noreturn memory(readwrite, argmem: none) }
45 ; CHECK: attributes #[[ATTR1]] = { noreturn }
47 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: