2 # RUN: rm -rf %t; split-file %s %t
4 # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin19.0.0 %t/main.s -o %t/main.o
5 # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin19.0.0 %t/f2.s -o %t/f2.o
6 # RUN: %lld -arch arm64 -lSystem --icf=all -o %t/main %t/main.o %t/f2.o
7 # RUN: llvm-objdump -d --syms --print-imm-hex %t/main | FileCheck %s
9 # CHECK-LABEL: SYMBOL TABLE:
10 # CHECK: [[#%x,F1_REF:]] g F __TEXT,__text _f1
11 # CHECK: [[#%x,F1_REF:]] g F __TEXT,__text _f2
13 # CHECK-LABEL: Disassembly of section __TEXT,__text:
15 # CHECK: bl 0x[[#%x,F1_REF:]]
16 # CHECK: bl 0x[[#%x,F1_REF:]]
20 .subsections_via_symbols
25 .quad 0xffffffffffffffff
33 .quad 0xeeeeeeeeeeeeeeee
45 .globl _main, _f1, _f2
47 ## Test that loading from __literalN sections at non-literal boundaries
48 ## doesn't confuse ICF. This function should be folded with the identical
49 ## _f2 in f2 (which uses literals of the same value in a different isec).
51 adrp x9
, L_align16@PAGE
+ 4
52 add x9
, x9
, L_align16@PAGEOFF
+ 4
55 adrp x9
, L_align8@PAGE
+ 4
56 add x9
, x9
, L_align8@PAGEOFF
+ 4
59 adrp x9
, L_align4@PAGE
+ 2
60 add x9
, x9
, L_align4@PAGEOFF
+ 2
71 .subsections_via_symbols
76 .quad 0xffffffffffffffff
84 .quad 0xeeeeeeeeeeeeeeee
97 adrp x9
, L_align16@PAGE
+ 4
98 add x9
, x9
, L_align16@PAGEOFF
+ 4
101 adrp x9
, L_align8@PAGE
+ 4
102 add x9
, x9
, L_align8@PAGEOFF
+ 4
105 adrp x9
, L_align4@PAGE
+ 2
106 add x9
, x9
, L_align4@PAGEOFF
+ 2