1 ; RUN: llc < %s -mtriple=arm-eabi -arm-global-merge | FileCheck %s --check-prefix=CHECK-MERGE 2 ; RUN: llc < %s -mtriple=arm-eabi -arm-global-merge -global-merge-on-external=true | FileCheck %s --check-prefix=CHECK-MERGE 3 ; RUN: llc < %s -mtriple=arm-eabi -arm-global-merge -global-merge-on-external=false | FileCheck %s --check-prefix=CHECK-NO-MERGE 4 ; RUN: llc < %s -mtriple=arm-macho -arm-global-merge | FileCheck %s --check-prefix=CHECK-NO-MERGE 5 6 @x = global i32 0, align 4 7 @y = global i32 0, align 4 8 @z = global i32 0, align 4 9 10 define void @f1(i32 %a1, i32 %a2) { 11 ;CHECK: f1: 12 ;CHECK: ldr {{r[0-9]+}}, [[LABEL1:\.LCPI[0-9]+_[0-9]]] 13 ;CHECK: [[LABEL1]]: 14 ;CHECK-MERGE: .long .L_MergedGlobals 15 ;CHECK-NO-MERGE: .long {{_?x}} 16 store i32 %a1, i32* @x, align 4 17 store i32 %a2, i32* @y, align 4 18 ret void 19 } 20 21 define void @g1(i32 %a1, i32 %a2) { 22 ;CHECK: g1: 23 ;CHECK: ldr {{r[0-9]+}}, [[LABEL2:\.LCPI[0-9]+_[0-9]]] 24 ;CHECK: [[LABEL2]]: 25 ;CHECK-MERGE: .long .L_MergedGlobals 26 ;CHECK-NO-MERGE: .long {{_?y}} 27 store i32 %a1, i32* @y, align 4 28 store i32 %a2, i32* @z, align 4 29 ret void 30 } 31 32 ;CHECK-NO-MERGE-NOT: .globl .L_MergedGlobals 33 34 ;CHECK-MERGE: .type .L_MergedGlobals,%object 35 ;CHECK-MERGE: .local .L_MergedGlobals 36 ;CHECK-MERGE: .comm .L_MergedGlobals,12,4 37 38 ;CHECK-MERGE: .globl x 39 ;CHECK-MERGE: x = .L_MergedGlobals 40 ;CHECK-MERGE: .size x, 4 41 ;CHECK-MERGE: .globl y 42 ;CHECK-MERGE: y = .L_MergedGlobals+4 43 ;CHECK-MERGE: .size y, 4 44 ;CHECK-MERGE: .globl z 45 ;CHECK-MERGE: z = .L_MergedGlobals+8 46 ;CHECK-MERGE: .size z, 4 47