1// REQUIRES: x86-registered-target
2// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o %t.o
3
4// RUN: llvm-readobj --notes %t.o | FileCheck %s --check-prefix=LLVM
5// RUN: llvm-readelf --notes %t.o | FileCheck %s --check-prefix=GNU
6
7// GNU:      Displaying notes found in: .note.no.desc
8// GNU-NEXT:   Owner                Data size        Description
9// GNU-NEXT:   AMD                  0x00000000       NT_AMD_AMDGPU_HSA_METADATA (HSA Metadata)
10// GNU-NEXT:     HSA Metadata:
11// GNU-NEXT: {{^ +$}}
12// GNU-NEXT:   AMD                  0x00000000       NT_AMD_AMDGPU_ISA (ISA Version)
13// GNU-NEXT:     ISA Version:
14// GNU-NEXT: {{^ +$}}
15// GNU-NEXT: Displaying notes found in: .note.desc
16// GNU-NEXT:   Owner                Data size        Description
17// GNU-NEXT:   AMD                  0x0000000a       NT_AMD_AMDGPU_HSA_METADATA (HSA Metadata)
18// GNU-NEXT:     HSA Metadata:
19// GNU-NEXT:     meta_blah
20// GNU-NEXT:   AMD                  0x00000009       NT_AMD_AMDGPU_ISA (ISA Version)
21// GNU-NEXT:     ISA Version:
22// GNU-NEXT:     isa_blah
23// GNU-NEXT: Displaying notes found in: .note.other
24// GNU-NEXT:   Owner                Data size        Description
25// GNU-NEXT:   AMD                  0x00000000       NT_AMD_AMDGPU_PAL_METADATA (PAL Metadata)
26
27// LLVM:      Notes [
28// LLVM-NEXT:   NoteSection {
29// LLVM-NEXT:     Name: .note.no.desc
30// LLVM-NEXT:     Offset:
31// LLVM-NEXT:     Size:
32// LLVM-NEXT:     Note {
33// LLVM-NEXT:       Owner: AMD
34// LLVM-NEXT:       Data size: 0x0
35// LLVM-NEXT:       Type: NT_AMD_AMDGPU_HSA_METADATA (HSA Metadata)
36// LLVM-NEXT:       HSA Metadata:
37// LLVM-NEXT:     }
38// LLVM-NEXT:     Note {
39// LLVM-NEXT:       Owner: AMD
40// LLVM-NEXT:       Data size: 0x0
41// LLVM-NEXT:       Type: NT_AMD_AMDGPU_ISA (ISA Version)
42// LLVM-NEXT:       ISA Version:
43// LLVM-NEXT:     }
44// LLVM-NEXT:   }
45// LLVM-NEXT:   NoteSection {
46// LLVM-NEXT:     Name: .note.desc
47// LLVM-NEXT:     Offset:
48// LLVM-NEXT:     Size:
49// LLVM-NEXT:     Note {
50// LLVM-NEXT:       Owner: AMD
51// LLVM-NEXT:       Data size: 0xA
52// LLVM-NEXT:       Type: NT_AMD_AMDGPU_HSA_METADATA (HSA Metadata)
53// LLVM-NEXT:       HSA Metadata: meta_blah
54// LLVM-NEXT:     }
55// LLVM-NEXT:     Note {
56// LLVM-NEXT:       Owner: AMD
57// LLVM-NEXT:       Data size: 0x9
58// LLVM-NEXT:       Type: NT_AMD_AMDGPU_ISA (ISA Version)
59// LLVM-NEXT:       ISA Version: isa_blah
60// LLVM-NEXT:     }
61// LLVM-NEXT:   }
62// LLVM-NEXT:   NoteSection {
63// LLVM-NEXT:     Name: .note.other
64// LLVM-NEXT:     Offset:
65// LLVM-NEXT:     Size:
66// LLVM-NEXT:     Note {
67// LLVM-NEXT:       Owner: AMD
68// LLVM-NEXT:       Data size: 0x0
69// LLVM-NEXT:       Type: NT_AMD_AMDGPU_PAL_METADATA (PAL Metadata)
70// LLVM-NEXT:     }
71// LLVM-NEXT:   }
72// LLVM-NEXT: ]
73
74.section ".note.no.desc", "a"
75	.align 4
76	.long 4 /* namesz */
77	.long 0 /* descsz */
78	.long 10 /* type = NT_AMD_AMDGPU_HSA_METADATA */
79	.asciz "AMD"
80	.long 4 /* namesz */
81	.long 0 /* descsz */
82	.long 11 /* type = NT_AMD_AMDGPU_ISA */
83	.asciz "AMD"
84.section ".note.desc", "a"
85	.align 4
86	.long 4 /* namesz */
87	.long end.meta - begin.meta /* descsz */
88	.long 10 /* type = NT_AMD_AMDGPU_HSA_METADATA */
89	.asciz "AMD"
90begin.meta:
91	.asciz "meta_blah"
92end.meta:
93	.align 4
94	.long 4 /* namesz */
95	.long end.isa - begin.isa /* descsz */
96	.long 11 /* type = NT_AMD_AMDGPU_ISA */
97	.asciz "AMD"
98begin.isa:
99	.asciz "isa_blah"
100end.isa:
101	.align 4
102.section ".note.other", "a"
103	.align 4
104	.long 4 /* namesz */
105	.long 0 /* descsz */
106	.long 12 /* type = NT_AMD_AMDGPU_PAL_METADATA */
107	.asciz "AMD"
108