[lld-macho][nfc] Use %X in mapfile test
authorJez Ng <jezng@fb.com>
Fri, 4 Mar 2022 19:20:53 +0000 (14:20 -0500)
committerJez Ng <jezng@fb.com>
Fri, 4 Mar 2022 19:21:17 +0000 (14:21 -0500)
LLD (and ld64) emits uppercase hex addresses in the mapfile. The
map-file.s test passes right now because the addresses we emit happen
not to include any alphabets, but that can easily change.

I noticed this while dealing with
https://github.com/llvm/llvm-project/issues/54184.

Reviewed By: #lld-macho, thakis

Differential Revision: https://reviews.llvm.org/D120941

lld/test/MachO/map-file.s

index 11ad7f0..8b05857 100644 (file)
 # CHECK-NEXT: [  2] {{.*}}{{/|\\}}map-file.s.tmp/foo.o
 
 # CHECK-NEXT: # Sections:
-# CHECK-NEXT: # Address    Size              Segment    Section
-# CHECK-NEXT: 0x[[#TEXT]]  0x{{[0-9a-f]+}}   __TEXT  __text
-# CHECK-NEXT: 0x[[#DATA]]  0x{{[0-9a-f]+}}   __TEXT  obj
-# CHECK-NEXT: 0x[[#BSS]]   0x{{[0-9a-f]+}}   __DATA  __common
+# CHECK-NEXT: # Address       Size              Segment  Section
+# CHECK-NEXT: 0x[[#%X,TEXT]]  0x{{[0-9a-f]+}}   __TEXT   __text
+# CHECK-NEXT: 0x[[#%X,DATA]]  0x{{[0-9a-f]+}}   __TEXT   obj
+# CHECK-NEXT: 0x[[#%X,BSS]]   0x{{[0-9a-f]+}}   __DATA   __common
 
 # CHECK-NEXT: # Symbols:
-# CHECK-NEXT: # Address        File  Name
-# CHECK-NEXT: 0x[[#MAIN]]      [  1]  _main
-# CHECK-NEXT: 0x[[#FOO]]       [  2]  _foo
-# CHECK-NEXT: 0x[[#NUMBER]]    [  1]  _number
+# CHECK-NEXT: # Address           File   Name
+# CHECK-NEXT: 0x[[#%X,MAIN]]      [  1]  _main
+# CHECK-NEXT: 0x[[#%X,FOO]]       [  2]  _foo
+# CHECK-NEXT: 0x[[#%X,NUMBER]]    [  1]  _number
 
 # RUN: %lld -map %t/c-string-literal-map %t/c-string-literal.o -o %t/c-string-literal-out
 # RUN: FileCheck --check-prefix=CSTRING %s < %t/c-string-literal-map