1 ## Validate MSPABI ELF Build Attributes
3 ## The header of .MSP430.attributes can be specified with.
4 ## ContentArray: [ 0x41, 0x16, 0x00, 0x00, 0x00, 0x6D, 0x73, 0x70, 0x61, 0x62,
5 ## 0x69, 0x00, 0x01, 0x0b, 0x00, 0x00, 0x00,
7 ## Following that are individual bytes describing the ISA, code model, data
8 ## model and optionally enum size.
10 ## If enum size is being tested, then the second byte (indicating the length of
11 ## the section), and last 32-bit int (indicating the length of the
12 ## subsection) of the header should be incremented by 2. This is to account for
13 ## the additional bytes for the enum size tag and value.
15 # HEADER: BuildAttributes {
16 # HEADER-NEXT: FormatVersion: 0x41
17 # HEADER-NEXT: Section 1 {
18 # HEADER-NEXT: SectionLength: 22
19 # HEADER-NEXT: Vendor: mspabi
20 # HEADER-NEXT: Tag: Tag_File (0x1)
21 # HEADER-NEXT: Size: 11
23 # ENUM-HEADER: BuildAttributes {
24 # ENUM-HEADER-NEXT: FormatVersion: 0x41
25 # ENUM-HEADER-NEXT: Section 1 {
26 # ENUM-HEADER-NEXT: SectionLength: 24
27 # ENUM-HEADER-NEXT: Vendor: mspabi
28 # ENUM-HEADER-NEXT: Tag: Tag_File (0x1)
29 # ENUM-HEADER-NEXT: Size: 13
32 # MSP430-NEXT: Value: 1
33 # MSP430-NEXT: TagName: ISA
34 # MSP430-NEXT: Description: MSP430
37 # MSP430X-NEXT: Value: 2
38 # MSP430X-NEXT: TagName: ISA
39 # MSP430X-NEXT: Description: MSP430X
42 # SMALL-CODE-NEXT: Value: 1
43 # SMALL-CODE-NEXT: TagName: Code_Model
44 # SMALL-CODE-NEXT: Description: Small
47 # LARGE-CODE-NEXT: Value: 2
48 # LARGE-CODE-NEXT: TagName: Code_Model
49 # LARGE-CODE-NEXT: Description: Large
52 # SMALL-DATA-NEXT: Value: 1
53 # SMALL-DATA-NEXT: TagName: Data_Model
54 # SMALL-DATA-NEXT: Description: Small
57 # LARGE-DATA-NEXT: Value: 2
58 # LARGE-DATA-NEXT: TagName: Data_Model
59 # LARGE-DATA-NEXT: Description: Large
61 # RESTRICTED-DATA: Tag: 8
62 # RESTRICTED-DATA-NEXT: Value: 3
63 # RESTRICTED-DATA-NEXT: TagName: Data_Model
64 # RESTRICTED-DATA-NEXT: Description: Restricted
67 # SMALL-ENUM-NEXT: Value: 1
68 # SMALL-ENUM-NEXT: TagName: Enum_Size
69 # SMALL-ENUM-NEXT: Description: Small
71 # INTEGER-ENUM: Tag: 10
72 # INTEGER-ENUM-NEXT: Value: 2
73 # INTEGER-ENUM-NEXT: TagName: Enum_Size
74 # INTEGER-ENUM-NEXT: Description: Integer
76 # DONT-CARE-ENUM: Tag: 10
77 # DONT-CARE-ENUM-NEXT: Value: 3
78 # DONT-CARE-ENUM-NEXT: TagName: Enum_Size
79 # DONT-CARE-ENUM-NEXT: Description: Don't Care
82 # RUN: yaml2obj --docnum=1 %s -o %t.o
83 # RUN: llvm-readobj -A %t.o | FileCheck %s --check-prefixes HEADER,MSP430,SMALL-CODE,SMALL-DATA
92 - Name: .MSP430.attributes
93 Type: SHT_MSP430_ATTRIBUTES
94 ContentArray: [ 0x41, 0x16, 0x00, 0x00, 0x00, 0x6D, 0x73, 0x70, 0x61, 0x62,
95 0x69, 0x00, 0x01, 0x0b, 0x00, 0x00, 0x00,
96 0x04, 0x01, 0x06, 0x01, 0x08, 0x01 ]
99 ## MSP430X ISA, Small Code Model, Small Data Model
100 # RUN: yaml2obj --docnum=2 %s -o %t.o
101 # RUN: llvm-readobj -A %t.o | FileCheck %s --check-prefixes HEADER,MSP430X,SMALL-CODE,SMALL-DATA
110 - Name: .MSP430.attributes
111 Type: SHT_MSP430_ATTRIBUTES
112 ContentArray: [ 0x41, 0x16, 0x00, 0x00, 0x00, 0x6D, 0x73, 0x70, 0x61, 0x62,
113 0x69, 0x00, 0x01, 0x0b, 0x00, 0x00, 0x00,
114 0x04, 0x02, 0x06, 0x01, 0x08, 0x01 ]
116 ## MSP430X Large Code Model, Small Data Model
117 # RUN: yaml2obj --docnum=3 %s -o %t.o
118 # RUN: llvm-readobj -A %t.o | FileCheck %s --check-prefixes HEADER,MSP430X,LARGE-CODE,SMALL-DATA
127 - Name: .MSP430.attributes
128 Type: SHT_MSP430_ATTRIBUTES
129 ContentArray: [ 0x41, 0x16, 0x00, 0x00, 0x00, 0x6D, 0x73, 0x70, 0x61, 0x62,
130 0x69, 0x00, 0x01, 0x0b, 0x00, 0x00, 0x00,
131 0x04, 0x02, 0x06, 0x02, 0x08, 0x01 ]
133 ## MSP430X Small Code Model, Large Data Model
134 # RUN: yaml2obj --docnum=4 %s -o %t.o
135 # RUN: llvm-readobj -A %t.o | FileCheck %s --check-prefixes HEADER,MSP430X,SMALL-CODE,LARGE-DATA
144 - Name: .MSP430.attributes
145 Type: SHT_MSP430_ATTRIBUTES
146 ContentArray: [ 0x41, 0x16, 0x00, 0x00, 0x00, 0x6D, 0x73, 0x70, 0x61, 0x62,
147 0x69, 0x00, 0x01, 0x0b, 0x00, 0x00, 0x00,
148 0x04, 0x02, 0x06, 0x01, 0x08, 0x02 ]
150 ## MSP430X Small Code Model, Restricted Data Model
151 # RUN: yaml2obj --docnum=5 %s -o %t.o
152 # RUN: llvm-readobj -A %t.o | FileCheck %s --check-prefixes HEADER,MSP430X,SMALL-CODE,RESTRICTED-DATA
161 - Name: .MSP430.attributes
162 Type: SHT_MSP430_ATTRIBUTES
163 ContentArray: [ 0x41, 0x16, 0x00, 0x00, 0x00, 0x6D, 0x73, 0x70, 0x61, 0x62,
164 0x69, 0x00, 0x01, 0x0b, 0x00, 0x00, 0x00,
165 0x04, 0x02, 0x06, 0x01, 0x08, 0x03 ]
167 ## MSP430X Small Code Model, Small Data Model, Small Enums
168 # RUN: yaml2obj --docnum=6 %s -o %t.o
169 # RUN: llvm-readobj -A %t.o | FileCheck %s --check-prefixes ENUM-HEADER,MSP430X,SMALL-CODE,SMALL-DATA,SMALL-ENUM
178 - Name: .MSP430.attributes
179 Type: SHT_MSP430_ATTRIBUTES
180 ContentArray: [ 0x41, 0x18, 0x00, 0x00, 0x00, 0x6D, 0x73, 0x70, 0x61, 0x62,
181 0x69, 0x00, 0x01, 0x0d, 0x00, 0x00, 0x00,
182 0x04, 0x02, 0x06, 0x01, 0x08, 0x01, 0x0a, 0x01 ]
184 ## MSP430X Small Code Model, Small Data Model, Integer Enums
185 # RUN: yaml2obj --docnum=7 %s -o %t.o
186 # RUN: llvm-readobj -A %t.o | FileCheck %s --check-prefixes ENUM-HEADER,MSP430X,SMALL-CODE,SMALL-DATA,INTEGER-ENUM
195 - Name: .MSP430.attributes
196 Type: SHT_MSP430_ATTRIBUTES
197 ContentArray: [ 0x41, 0x18, 0x00, 0x00, 0x00, 0x6D, 0x73, 0x70, 0x61, 0x62,
198 0x69, 0x00, 0x01, 0x0d, 0x00, 0x00, 0x00,
199 0x04, 0x02, 0x06, 0x01, 0x08, 0x01, 0x0a, 0x02 ]
202 ## MSP430X Small Code Model, Small Data Model, "Don't Care" Enums
203 # RUN: yaml2obj --docnum=8 %s -o %t.o
204 # RUN: llvm-readobj -A %t.o | FileCheck %s --check-prefixes ENUM-HEADER,MSP430X,SMALL-CODE,SMALL-DATA,DONT-CARE-ENUM
213 - Name: .MSP430.attributes
214 Type: SHT_MSP430_ATTRIBUTES
215 ContentArray: [ 0x41, 0x18, 0x00, 0x00, 0x00, 0x6D, 0x73, 0x70, 0x61, 0x62,
216 0x69, 0x00, 0x01, 0x0d, 0x00, 0x00, 0x00,
217 0x04, 0x02, 0x06, 0x01, 0x08, 0x01, 0x0a, 0x03 ]