1 # RUN: yaml2obj %s -o %t.o
2 # RUN: llvm-readobj --notes %t.o | FileCheck %s --check-prefix=LLVM
3 # RUN: llvm-readelf --notes %t.o | FileCheck %s --check-prefix=GNU
5 # GNU: Displaying notes found in: .note.foo
6 # GNU-NEXT: Owner Data size Description
7 # GNU-NEXT: AMDGPU 0x000000fb NT_AMDGPU_METADATA (AMDGPU Metadata)
8 # GNU-NEXT: AMDGPU Metadata:
10 # GNU-NEXT: amdhsa.kernels:
11 # GNU-NEXT: - .group_segment_fixed_size: 2
12 # GNU-NEXT: .kernarg_segment_align: 4
13 # GNU-NEXT: .kernarg_segment_size: 1
14 # GNU-NEXT: .max_flat_workgroup_size: 8
15 # GNU-NEXT: .name: foo
16 # GNU-NEXT: .private_segment_fixed_size: 3
17 # GNU-NEXT: .sgpr_count: 6
18 # GNU-NEXT: .symbol: foo
19 # GNU-NEXT: .uses_dynamic_stack: true
20 # GNU-NEXT: .vgpr_count: 7
21 # GNU-NEXT: .wavefront_size: 5
22 # GNU-NEXT: amdhsa.version:
28 # GNU-NEXT: Displaying notes found in: .note.unknown
29 # GNU-NEXT: Owner Data size Description
30 # GNU-NEXT: AMDGPU 0x00000002 Unknown note type: (0x00000101)
31 # GNU-NEXT: description data: ab cd
35 # LLVM-NEXT: NoteSection {
36 # LLVM-NEXT: Name: .note.foo
40 # LLVM-NEXT: Owner: AMDGPU
41 # LLVM-NEXT: Data size: 0xFB
42 # LLVM-NEXT: Type: NT_AMDGPU_METADATA (AMDGPU Metadata)
43 # LLVM-NEXT: AMDGPU Metadata: ---
44 # LLVM-NEXT: amdhsa.kernels:
45 # LLVM-NEXT: - .group_segment_fixed_size: 2
46 # LLVM-NEXT: .kernarg_segment_align: 4
47 # LLVM-NEXT: .kernarg_segment_size: 1
48 # LLVM-NEXT: .max_flat_workgroup_size: 8
49 # LLVM-NEXT: .name: foo
50 # LLVM-NEXT: .private_segment_fixed_size: 3
51 # LLVM-NEXT: .sgpr_count: 6
52 # LLVM-NEXT: .symbol: foo
53 # LLVM-NEXT: .uses_dynamic_stack: true
54 # LLVM-NEXT: .vgpr_count: 7
55 # LLVM-NEXT: .wavefront_size: 5
56 # LLVM-NEXT: amdhsa.version:
63 # LLVM-NEXT: NoteSection {
64 # LLVM-NEXT: Name: .note.unknown
65 # LLVM-NEXT: Offset: 0x150
66 # LLVM-NEXT: Size: 0x18
68 # LLVM-NEXT: Owner: AMDGPU
69 # LLVM-NEXT: Data size: 0x2
70 # LLVM-NEXT: Type: Unknown (0x00000101)
71 # LLVM-NEXT: Description data (
72 # LLVM-NEXT: 0000: ABCD |..|
78 ## Use yaml2obj instead of llvm-mc for more test portability. This was
79 ## generated by grabbing section data from an object built via:
80 # $ llvm-mc -filetype=obj -triple amdgcn-amd-amdhsa %s -o %t.o
89 # .kernarg_segment_size: 1
90 # .group_segment_fixed_size: 2
91 # .private_segment_fixed_size: 3
92 # .uses_dynamic_stack: true
93 # .kernarg_segment_align: 4
97 # .max_flat_workgroup_size: 8
98 # .end_amdgpu_metadata
100 ## Here's one way to get the contents of .note.foo in the test input from %t.o:
101 # $ llvm-objcopy -O binary --only-section=.note %t.o note.out
102 # $ xxd -p note.out | tr -d '\n' | tr a-z A-Z
112 Content: 07000000FB00000020000000414D44475055000082AE616D646873612E6B65726E656C73918BB92E67726F75705F7365676D656E745F66697865645F73697A6502B62E6B65726E6172675F7365676D656E745F616C69676E04B52E6B65726E6172675F7365676D656E745F73697A6501B82E6D61785F666C61745F776F726B67726F75705F73697A6508A52E6E616D65A3666F6FBB2E707269766174655F7365676D656E745F66697865645F73697A6503AB2E736770725F636F756E7406A72E73796D626F6CA3666F6FB32E757365735F64796E616D69635F737461636BC3AB2E766770725F636F756E7407AF2E7761766566726F6E745F73697A6505AE616D646873612E76657273696F6E92010000
113 - Name: .note.unknown
117 Type: NT_GNU_BUILD_ATTRIBUTE_FUNC