[memprof] Remove an unused using directive (#117004)
[llvm-project.git] / lld / test / ELF / build-id.s
blob581f600881a27c2a5d5db4fd33cdf646e876cfac
1 # REQUIRES: x86
3 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
5 # RUN: ld.lld --build-id %t -o %t2
6 # RUN: llvm-readobj -S %t2 | FileCheck -check-prefix=ALIGN %s
8 # RUN: ld.lld --build-id %t -o %t2
9 # RUN: llvm-objdump -s %t2 | FileCheck --check-prefix=SHA1 %s
10 # RUN: ld.lld --build-id %t -o %t2 --threads=1
11 # RUN: llvm-objdump -s %t2 | FileCheck --check-prefix=SHA1 %s
13 # RUN: ld.lld --build-id=fast %t -o %t2
14 # RUN: llvm-objdump -s %t2 | FileCheck --check-prefix=FAST %s
16 # RUN: ld.lld --build-id=md5 %t -o %t2
17 # RUN: llvm-objdump -s %t2 | FileCheck --check-prefix=MD5 %s
18 # RUN: ld.lld --build-id=md5 %t -o %t2 --threads=1
19 # RUN: llvm-objdump -s %t2 | FileCheck --check-prefix=MD5 %s
21 # RUN: ld.lld --build-id=sha1 %t -o %t2
22 # RUN: llvm-objdump -s %t2 | FileCheck --check-prefix=SHA1 %s
23 # RUN: ld.lld --build-id=sha1 %t -o %t2 --threads=1
24 # RUN: llvm-objdump -s %t2 | FileCheck --check-prefix=SHA1 %s
26 # RUN: ld.lld --build-id=tree %t -o %t2
27 # RUN: llvm-objdump -s %t2 | FileCheck --check-prefix=SHA1 %s
28 # RUN: ld.lld --build-id=tree %t -o %t2 --threads=1
29 # RUN: llvm-objdump -s %t2 | FileCheck --check-prefix=SHA1 %s
31 # RUN: ld.lld --build-id=uuid %t -o %t2
32 # RUN: llvm-objdump -s %t2 | FileCheck --check-prefix=UUID %s
34 # RUN: ld.lld --build-id=0x12345678 %t -o %t2
35 # RUN: llvm-objdump -s %t2 | FileCheck --check-prefix=HEX %s
37 # RUN: ld.lld %t -o %t2
38 # RUN: llvm-objdump -s %t2 | FileCheck --check-prefix=NONE %s
40 # RUN: ld.lld --build-id=md5 --build-id=none %t -o %t2
41 # RUN: llvm-objdump -s %t2 | FileCheck --check-prefix=NONE %s
42 # RUN: ld.lld --build-id --build-id=none %t -o %t2
43 # RUN: llvm-objdump -s %t2 | FileCheck --check-prefix=NONE %s
44 # RUN: ld.lld --build-id=none --build-id %t -o %t2
45 # RUN: llvm-objdump -s %t2 | FileCheck --check-prefix=SHA1 %s
47 .globl _start
48 _start:
49 nop
51 .section .note.test, "a", @note
52 .quad 42
54 # ALIGN: Name: .note.gnu.build-id
55 # ALIGN-NEXT: Type: SHT_NOTE
56 # ALIGN-NEXT: Flags [
57 # ALIGN-NEXT: SHF_ALLOC
58 # ALIGN-NEXT: ]
59 # ALIGN-NEXT: Address:
60 # ALIGN-NEXT: Offset: [[_:0x[0-9A-Z]*(0|4|8|C)$]]
61 # ALIGN-NEXT: Size:
62 # ALIGN-NEXT: Link:
63 # ALIGN-NEXT: Info:
64 # ALIGN-NEXT: AddressAlignment: 4
66 # FAST: Contents of section .note.test:
67 # FAST: Contents of section .note.gnu.build-id:
68 # FAST-NEXT: 04000000 08000000 03000000 474e5500 ............GNU.
69 # FAST-NEXT: 630bc2f5 a2584763
71 # MD5: Contents of section .note.gnu.build-id:
72 # MD5-NEXT: 04000000 10000000 03000000 474e5500 ............GNU.
73 # MD5-NEXT: dbf0bc13 b3ff11e9 fde6e17c 0304983c
75 # SHA1: Contents of section .note.gnu.build-id:
76 # SHA1-NEXT: 04000000 14000000 03000000 474e5500 ............GNU.
77 # SHA1-NEXT: 1215775f d3b60050 70afd970 e8a10972
79 # UUID: Contents of section .note.gnu.build-id:
80 # UUID-NEXT: 04000000 10000000 03000000 474e5500 ............GNU.
82 # HEX: Contents of section .note.gnu.build-id:
83 # HEX-NEXT: 04000000 04000000 03000000 474e5500 ............GNU.
84 # HEX-NEXT: 12345678
86 # NONE-NOT: Contents of section .note.gnu.build-id:
88 # RUN: ld.lld --build-id=sha1 -z separate-loadable-segments %t -o %t2
89 # RUN: llvm-readelf -x .note.gnu.build-id %t2 | FileCheck --check-prefix=SEPARATE %s
91 # SEPARATE: Hex dump of section '.note.gnu.build-id':
92 # SEPARATE-NEXT: 0x00200198 04000000 14000000 03000000 474e5500
93 # SEPARATE-NEXT: 0x002001a8 5cd067a4 2631c0fd 42029037 4b8e0938
95 # RUN: ld.lld --build-id=sha1 --no-rosegment %t -o %t2
96 # RUN: llvm-readelf -x .note.gnu.build-id %t2 | FileCheck --check-prefix=NORO %s
98 # NORO: Hex dump of section '.note.gnu.build-id':
99 # NORO-NEXT: 0x00200160 04000000 14000000 03000000 474e5500
100 # NORO-NEXT: 0x00200170 a328cc99 45bfc3fc a9fc8615 37102f9d