1 ; RUN: llc %s -mtriple=aarch64-none-linux-gnu -aarch64-enable-global-merge -global-merge-on-external -disable-post-ra -o - | FileCheck %s 2 ; RUN: llc %s -mtriple=aarch64-linux-gnuabi -aarch64-enable-global-merge -global-merge-on-external -disable-post-ra -o - | FileCheck %s 3 ; RUN: llc %s -mtriple=aarch64-apple-ios -aarch64-enable-global-merge -global-merge-on-external -disable-post-ra -o - | FileCheck %s --check-prefix=CHECK-APPLE-IOS 4 5 @x = global [1000 x i32] zeroinitializer, align 1 6 @y = global [1000 x i32] zeroinitializer, align 1 7 @z = internal global i32 1, align 4 8 9 define void @f1(i32 %a1, i32 %a2, i32 %a3) { 10 ;CHECK-APPLE-IOS: adrp x8, __MergedGlobals_x@PAGE 11 ;CHECK-APPLE-IOS-NOT: adrp 12 ;CHECK-APPLE-IOS: add x8, x8, __MergedGlobals_x@PAGEOFF 13 ;CHECK-APPLE-IOS: adrp x9, _y@PAGE+12 14 ;CHECK-APPLE-IOS: str w1, [x9] 15 %x3 = getelementptr inbounds [1000 x i32], [1000 x i32]* @x, i32 0, i64 3 16 %y3 = getelementptr inbounds [1000 x i32], [1000 x i32]* @y, i32 0, i64 3 17 store i32 %a1, i32* %x3, align 4 18 store i32 %a2, i32* %y3, align 4 19 store i32 %a3, i32* @z, align 4 20 ret void 21 } 22 23 ;CHECK: .type .L_MergedGlobals,@object // @_MergedGlobals 24 ;CHECK: .p2align 2 25 ;CHECK: .L_MergedGlobals: 26 ;CHECK: .size .L_MergedGlobals, 4004 27 28 ;CHECK-APPLE-IOS: .zerofill __DATA,__common,_y,4000,2 29 30 ;CHECK-APPLE-IOS: .p2align 2 31 ;CHECK-APPLE-IOS: __MergedGlobals_x: 32 ;CHECK-APPLE-IOS: .long 1 33 ;CHECK-APPLE-IOS: .space 4000 34 35 36 ;CHECK: .set z, .L_MergedGlobals 37 ;CHECK: .globl x 38 ;CHECK: .set x, .L_MergedGlobals+4 39 ;CHECK: .size x, 4000 40 41 ;CHECK-APPLE-IOS-NOT: .set _z, __MergedGlobals_x 42 ;CHECK-APPLE-IOS:.globl _x 43 ;CHECK-APPLE-IOS:.set _x, __MergedGlobals_x+4 44