1 ; RUN: opt < %s -argpromotion -S | FileCheck %s
3 ; ArgumentPromotion should preserve the default function address space
4 ; from the data layout.
6 target datalayout = "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8"
8 @g = common global i32 0, align 4
12 %call = call i32 @foo(i32* @g)
13 ; CHECK: %call = call addrspace(1) i32 @foo()
17 ; CHECK: define internal i32 @foo() addrspace(1)
18 define internal i32 @foo(i32*) {
20 %retval = alloca i32, align 4
21 call void asm sideeffect "ldr r0, [r0] \0Abx lr \0A", ""()