1 ; RUN: llc %s -mtriple=aarch64-none-linux-gnu -enable-global-merge -global-merge-on-external -o - | FileCheck %s 2 ; RUN: llc %s -mtriple=aarch64-linux-gnuabi -enable-global-merge -global-merge-on-external -o - | FileCheck %s 3 ; RUN: llc %s -mtriple=aarch64-apple-ios -enable-global-merge -global-merge-on-external -o - | FileCheck %s --check-prefix=CHECK-APPLE-IOS 4 5 @x = global i32 0, align 4 6 @y = global i32 0, align 4 7 @z = global i32 0, align 4 8 9 define void @f1(i32 %a1, i32 %a2) { 10 ;CHECK-APPLE-IOS-LABEL: _f1: 11 ;CHECK-APPLE-IOS: adrp x8, __MergedGlobals_x@PAGE 12 ;CHECK-APPLE-IOS: add x8, x8, __MergedGlobals_x@PAGEOFF 13 ;CHECK-APPLE-IOS-NOT: adrp 14 store i32 %a1, i32* @x, align 4 15 store i32 %a2, i32* @y, align 4 16 ret void 17 } 18 19 define void @g1(i32 %a1, i32 %a2) { 20 ;CHECK-APPLE-IOS-LABEL: _g1: 21 ;CHECK-APPLE-IOS: adrp x8, __MergedGlobals_x@PAGE 22 ;CHECK-APPLE-IOS: add x8, x8, __MergedGlobals_x@PAGEOFF 23 ;CHECK-APPLE-IOS-NOT: adrp 24 store i32 %a1, i32* @y, align 4 25 store i32 %a2, i32* @z, align 4 26 ret void 27 } 28 29 ;CHECK: .type _MergedGlobals_x,@object // @_MergedGlobals_x 30 ;CHECK: .globl _MergedGlobals_x 31 ;CHECK: .align 3 32 ;CHECK: _MergedGlobals_x: 33 ;CHECK: .size _MergedGlobals_x, 12 34 35 ;CHECK: .globl x 36 ;CHECK: x = _MergedGlobals_x 37 ;CHECK: .globl y 38 ;CHECK: y = _MergedGlobals_x+4 39 ;CHECK: .globl z 40 ;CHECK: z = _MergedGlobals_x+8 41 42 ;CHECK-APPLE-IOS: .globl __MergedGlobals_x ; @_MergedGlobals_x 43 ;CHECK-APPLE-IOS: .zerofill __DATA,__common,__MergedGlobals_x,12,3 44 45 ;CHECK-APPLE-IOS: .globl _x 46 ;CHECK-APPLE-IOS: _x = __MergedGlobals_x 47 ;CHECK-APPLE-IOS: .globl _y 48 ;CHECK-APPLE-IOS: _y = __MergedGlobals_x+4 49 ;CHECK-APPLE-IOS: .globl _z 50 ;CHECK-APPLE-IOS: _z = __MergedGlobals_x+8 51 ;CHECK-APPLE-IOS: .subsections_via_symbols 52