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