1; RUN: llc %s -mtriple=aarch64-none-linux-gnu -aarch64-global-merge -global-merge-on-external -disable-post-ra -o - | FileCheck %s 2; RUN: llc %s -mtriple=aarch64-linux-gnuabi -aarch64-global-merge -global-merge-on-external -disable-post-ra -o - | FileCheck %s 3; RUN: llc %s -mtriple=aarch64-apple-ios -aarch64-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 9define void @f1(i32 %a1, i32 %a2, i32 %a3) { 10;CHECK-APPLE-IOS: adrp x8, l__MergedGlobals@PAGE 11;CHECK-APPLE-IOS-NOT: adrp 12;CHECK-APPLE-IOS: add x8, x8, l__MergedGlobals@PAGEOFF 13;CHECK-APPLE-IOS: adrp x9, l__MergedGlobals.1@PAGE 14;CHECK-APPLE-IOS: add x9, x9, l__MergedGlobals.1@PAGEOFF 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 4 25;CHECK: .L_MergedGlobals: 26;CHECK: .size .L_MergedGlobals, 4004 27 28;CHECK: .type .L_MergedGlobals.1,@object // @_MergedGlobals.1 29;CHECK: .local .L_MergedGlobals.1 30;CHECK: .comm .L_MergedGlobals.1,4000,16 31 32;CHECK-APPLE-IOS: .p2align 4 33;CHECK-APPLE-IOS: l__MergedGlobals: 34;CHECK-APPLE-IOS: .long 1 35;CHECK-APPLE-IOS: .space 4000 36 37;CHECK-APPLE-IOS: .zerofill __DATA,__bss,l__MergedGlobals.1,4000,4 38 39;CHECK: z = .L_MergedGlobals 40;CHECK: .globl x 41;CHECK: x = .L_MergedGlobals+4 42;CHECK: .size x, 4000 43;CHECK: .globl y 44;CHECK: y = .L_MergedGlobals.1 45;CHECK: .size y, 4000 46 47;CHECK-APPLE-IOS-NOT: _z = l__MergedGlobals 48;CHECK-APPLE-IOS:.globl _x 49;CHECK-APPLE-IOS: _x = l__MergedGlobals+4 50;CHECK-APPLE-IOS:.globl _y 51;CHECK-APPLE-IOS: _y = l__MergedGlobals.1 52