parser.test
11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
; RUN: llvm-rc /dry-run /V -- %p/Inputs/parser-correct-everything.rc | FileCheck %s --check-prefix PGOOD
; PGOOD: Icon (meh): "hello.bmp"
; PGOOD-NEXT: Icon (Icon): "Icon"
; PGOOD-NEXT: Language: 5, Sublanguage: 12
; PGOOD-NEXT: StringTable:
; PGOOD-NEXT: Option: Language: 1, Sublanguage: 1
; PGOOD-NEXT: Option: Characteristics: 500
; PGOOD-NEXT: Option: Language: 3, Sublanguage: 4
; PGOOD-NEXT: Option: Version: 14
; PGOOD-NEXT: 1 => "hello"
; PGOOD-NEXT: 2 => "world"
; PGOOD-NEXT: StringTable:
; PGOOD-NEXT: HTML (500): "index.html"
; PGOOD-NEXT: Cursor (Name): "hello.ico"
; PGOOD-NEXT: Accelerators (12):
; PGOOD-NEXT: Option: Version: 5000
; PGOOD-NEXT: Option: Language: 0, Sublanguage: 2
; PGOOD-NEXT: Accelerator: "^C" 10
; PGOOD-NEXT: Accelerator: 14 11
; PGOOD-NEXT: Accelerator: 5 12 VIRTKEY
; PGOOD-NEXT: Accelerator: 0 0 ASCII
; PGOOD-NEXT: Accelerator: 1 1 VIRTKEY CONTROL
; PGOOD-NEXT: Accelerator: 2 2 VIRTKEY CONTROL
; PGOOD-NEXT: Accelerator: 3 3 ASCII VIRTKEY NOINVERT ALT SHIFT CONTROL
; PGOOD-NEXT: Menu (LLVMTest):
; PGOOD-NEXT: Option: Language: 4, Sublanguage: 1
; PGOOD-NEXT: Menu list starts
; PGOOD-NEXT: Popup ("&OneMenu"):
; PGOOD-NEXT: Menu list starts
; PGOOD-NEXT: Popup ("Menu&1"):
; PGOOD-NEXT: Menu list starts
; PGOOD-NEXT: MenuItem ("Item&1"), ID = 301 CHECKED MENUBREAK
; PGOOD-NEXT: MenuItem ("Item&2"), ID = 302 CHECKED MENUBARBREAK
; PGOOD-NEXT: MenuItem ("Item&3"), ID = 303 HELP INACTIVE MENUBREAK
; PGOOD-NEXT: MenuItem ("Item&4"), ID = 304 GRAYED
; PGOOD-NEXT: Menu list ends
; PGOOD-NEXT: Popup ("Menu&2"):
; PGOOD-NEXT: Menu list starts
; PGOOD-NEXT: MenuItem ("&A"), ID = 401
; PGOOD-NEXT: MenuItem ("&B"), ID = 402
; PGOOD-NEXT: Menu list ends
; PGOOD-NEXT: Menu list ends
; PGOOD-NEXT: Popup ("&Items"):
; PGOOD-NEXT: Menu list starts
; PGOOD-NEXT: MenuItem ("&Row"), ID = 500
; PGOOD-NEXT: MenuItem ("&Column"), ID = 501 CHECKED
; PGOOD-NEXT: Menu separator
; PGOOD-NEXT: MenuItem ("&Word"), ID = 502
; PGOOD-NEXT: Menu list ends
; PGOOD-NEXT: Menu list ends
; PGOOD-NEXT: DialogEx (14): loc: (50, 60), size: [10, 20], help ID: 500
; PGOOD-NEXT: Option: Language: 1, Sublanguage: 2
; PGOOD-NEXT: Option: Characteristics: 50
; PGOOD-NEXT: Option: Version: 100
; PGOOD-NEXT: Option: Font: size = 12, face = "Arial", weight = 500, italic, charset = 13
; PGOOD-NEXT: Option: Caption: "RC parser dialog"
; PGOOD-NEXT: Option: Style: 332340
; PGOOD-NEXT: Control (14): LTEXT, title: "Hello world!", loc: (20, 20), size: [50, 50]
; PGOOD-NEXT: Control (50): RTEXT, title: "Heh", loc: (51, 52), size: [53, 54], style: 55, ext. style: 56
; PGOOD-NEXT: Control (1): CTEXT, title: "Muuuu", loc: (2, 3), size: [4, 5], style: 6, ext. style: 7, help ID: 8
; PGOOD-NEXT: Control (1): PUSHBUTTON, title: "Muuuu", loc: (2, 3), size: [4, 5], style: 6, ext. style: 7, help ID: 8
; PGOOD-NEXT: Control (1): DEFPUSHBUTTON, title: "Muuuu", loc: (2, 3), size: [4, 5], style: 6
; PGOOD-NEXT: Control (5): EDITTEXT, title: , loc: (1, 2), size: [4, 7], style: 8
; PGOOD-NEXT: Dialog (25): loc: (1, 2), size: [3, 4], help ID: 0
; PGOOD-NEXT: DialogEx (26): loc: (1, 2), size: [3, 4], help ID: 0
; PGOOD-NEXT: VersionInfo (1):
; PGOOD-NEXT: Fixed: FILEVERSION: 1 2 3 4
; PGOOD-NEXT: Fixed: PRODUCTVERSION: 5 6 7 8
; PGOOD-NEXT: Fixed: FILEFLAGSMASK: 50
; PGOOD-NEXT: Fixed: FILEFLAGS: 555
; PGOOD-NEXT: Fixed: FILEOS: 110
; PGOOD-NEXT: Fixed: FILETYPE: 555555
; PGOOD-NEXT: Fixed: FILESUBTYPE: 14
; PGOOD-NEXT: Start of block (name: )
; PGOOD-NEXT: Start of block (name: "StringFileInfo")
; PGOOD-NEXT: Start of block (name: "040904E4")
; PGOOD-NEXT: "CompanyName" => "a"
; PGOOD-NEXT: "FileDescription" => "b" "c" "d", 1 3 7L, "y", "h" "d"
; PGOOD-NEXT: "FileVersion" => "c"
; PGOOD-NEXT: "InternalName" => "d"
; PGOOD-NEXT: "LegalCopyright" => "e"
; PGOOD-NEXT: "LegalTrademarks1" => 1 2, 3
; PGOOD-NEXT: "LegalTrademarks2" => "g"
; PGOOD-NEXT: "OriginalFilename" => L"h"
; PGOOD-NEXT: "ProductName" => "ii", 2L, 3
; PGOOD-NEXT: "ProductVersion" => 305419896L
; PGOOD-NEXT: End of block
; PGOOD-NEXT: End of block
; PGOOD-NEXT: Start of block (name: "VarFileInfo")
; PGOOD-NEXT: "Translation" => 1033, 1252
; PGOOD-NEXT: End of block
; PGOOD-NEXT: End of block
; PGOOD-NEXT: User-defined (type: MYTYPE, name: MYNAME): "filename"
; PGOOD-NEXT: User-defined (type: 600, name: 500): "other filename"
; PGOOD-NEXT: User-defined (type: INTEGERS, name: HELLO): data = 1 2 3 4
; PGOOD-NEXT: User-defined (type: STRINGS, name: HELLO): data = "1" "2" "3" "4"
; PGOOD-NEXT: User-defined (type: MIXED, name: 4): data = 1 "2" 3 "4"
; RUN: not llvm-rc /dry-run /V -- %p/Inputs/parser-stringtable-no-string.rc 2>&1 | FileCheck %s --check-prefix PSTRINGTABLE1
; PSTRINGTABLE1: llvm-rc: Error parsing file: expected string, got }
; RUN: not llvm-rc /dry-run /V -- %p/Inputs/parser-stringtable-weird-option.rc 2>&1 | FileCheck %s --check-prefix PSTRINGTABLE2
; PSTRINGTABLE2: llvm-rc: Error parsing file: expected optional statement type, BEGIN or '{', got NONSENSETYPE
; RUN: not llvm-rc /dry-run /V -- %p/Inputs/parser-eof.rc 2>&1 | FileCheck %s --check-prefix PEOF
; PEOF: llvm-rc: Error parsing file: expected '-', '~', integer or '(', got <EOF>
; RUN: not llvm-rc /dry-run /V -- %p/Inputs/parser-no-characteristics-arg.rc 2>&1 | FileCheck %s --check-prefix PCHARACTERISTICS1
; PCHARACTERISTICS1: llvm-rc: Error parsing file: expected '-', '~', integer or '(', got BEGIN
; RUN: not llvm-rc /dry-run /V -- %p/Inputs/parser-nonsense-token.rc 2>&1 | FileCheck %s --check-prefix PNONSENSE1
; PNONSENSE1: llvm-rc: Error parsing file: expected int or identifier, got &
; RUN: not llvm-rc /dry-run /V -- %p/Inputs/parser-nonsense-type.rc 2>&1 | FileCheck %s --check-prefix PNONSENSE2
; PNONSENSE2: llvm-rc: Error parsing file: expected filename, '{' or BEGIN, got <EOF>
; RUN: not llvm-rc /dry-run /V -- %p/Inputs/parser-nonsense-type-eof.rc 2>&1 | FileCheck %s --check-prefix PNONSENSE3
; PNONSENSE3: llvm-rc: Error parsing file: expected int or identifier, got <EOF>
; RUN: not llvm-rc /dry-run /V -- %p/Inputs/parser-language-no-comma.rc 2>&1 | FileCheck %s --check-prefix PLANGUAGE1
; PLANGUAGE1: llvm-rc: Error parsing file: expected ',', got 7
; RUN: not llvm-rc /dry-run /V -- %p/Inputs/parser-language-too-many-commas.rc 2>&1 | FileCheck %s --check-prefix PLANGUAGE2
; PLANGUAGE2: llvm-rc: Error parsing file: expected '-', '~', integer or '(', got ,
; RUN: not llvm-rc /dry-run /V -- %p/Inputs/parser-html-extra-comma.rc 2>&1 | FileCheck %s --check-prefix PHTML2
; PHTML2: llvm-rc: Error parsing file: expected string, got ,
; RUN: not llvm-rc /dry-run /V -- %p/Inputs/parser-accelerators-bad-flag.rc 2>&1 | FileCheck %s --check-prefix PACCELERATORS1
; PACCELERATORS1: llvm-rc: Error parsing file: expected ASCII/VIRTKEY/NOINVERT/ALT/SHIFT/CONTROL, got HELLO
; RUN: not llvm-rc /dry-run /V -- %p/Inputs/parser-accelerators-bad-int-or-string.rc 2>&1 | FileCheck %s --check-prefix PACCELERATORS2
; PACCELERATORS2: llvm-rc: Error parsing file: expected int or string, got NotIntOrString
; RUN: not llvm-rc /dry-run /V -- %p/Inputs/parser-accelerators-no-comma.rc 2>&1 | FileCheck %s --check-prefix PACCELERATORS3
; PACCELERATORS3: llvm-rc: Error parsing file: expected int or string, got CONTROL
; RUN: not llvm-rc /dry-run /V -- %p/Inputs/parser-accelerators-no-comma-2.rc 2>&1 | FileCheck %s --check-prefix PACCELERATORS4
; PACCELERATORS4: llvm-rc: Error parsing file: expected ',', got 10
; RUN: not llvm-rc /dry-run /V -- %p/Inputs/parser-menu-bad-id.rc 2>&1 | FileCheck %s --check-prefix PMENU1
; PMENU1: llvm-rc: Error parsing file: expected '-', '~', integer or '(', got A
; RUN: not llvm-rc /dry-run /V -- %p/Inputs/parser-menu-bad-flag.rc 2>&1 | FileCheck %s --check-prefix PMENU2
; PMENU2: llvm-rc: Error parsing file: expected CHECKED/GRAYED/HELP/INACTIVE/MENUBARBREAK/MENUBREAK, got ERRONEOUS
; RUN: not llvm-rc /dry-run /V -- %p/Inputs/parser-menu-missing-block.rc 2>&1 | FileCheck %s --check-prefix PMENU3
; PMENU3: llvm-rc: Error parsing file: expected '{', got POPUP
; RUN: not llvm-rc /dry-run /V -- %p/Inputs/parser-menu-misspelled-separator.rc 2>&1 | FileCheck %s --check-prefix PMENU4
; PMENU4: llvm-rc: Error parsing file: expected SEPARATOR or string, got NOTSEPARATOR
; RUN: not llvm-rc /dry-run /V -- %p/Inputs/parser-dialog-cant-give-helpid.rc 2>&1 | FileCheck %s --check-prefix PDIALOG1
; PDIALOG1: llvm-rc: Error parsing file: expected identifier, got ,
; RUN: not llvm-rc /dry-run /V -- %p/Inputs/parser-dialog-too-few-args.rc 2>&1 | FileCheck %s --check-prefix PDIALOG2
; PDIALOG2: llvm-rc: Error parsing file: expected ',', got }
; RUN: not llvm-rc /dry-run /V -- %p/Inputs/parser-dialog-too-many-args.rc 2>&1 | FileCheck %s --check-prefix PDIALOG3
; PDIALOG3: llvm-rc: Error parsing file: expected identifier, got ,
; RUN: not llvm-rc /dry-run /V -- %p/Inputs/parser-dialog-unknown-type.rc 2>&1 | FileCheck %s --check-prefix PDIALOG4
; PDIALOG4: llvm-rc: Error parsing file: expected control type, END or '}', got UNKNOWN
; RUN: not llvm-rc /dry-run /V -- %p/Inputs/parser-dialog-unnecessary-string.rc 2>&1 | FileCheck %s --check-prefix PDIALOG5
; PDIALOG5: llvm-rc: Error parsing file: expected '-', '~', integer or '(', got "This shouldn't be here"
; RUN: not llvm-rc /dry-run /V -- %p/Inputs/parser-dialog-simple-font.rc 2>&1 | FileCheck %s --check-prefix PDIALOG6
; PDIALOG6: llvm-rc: Error parsing file: expected identifier, got ,
; RUN: not llvm-rc /dry-run /V -- %p/Inputs/parser-versioninfo-wrong-fixed.rc 2>&1 | FileCheck %s --check-prefix PVERSIONINFO1
; PVERSIONINFO1: llvm-rc: Error parsing file: expected fixed VERSIONINFO statement type, got WEIRDFIXED
; RUN: not llvm-rc /dry-run /V -- %p/Inputs/parser-versioninfo-named-main-block.rc 2>&1 | FileCheck %s --check-prefix PVERSIONINFO2
; PVERSIONINFO2: llvm-rc: Error parsing file: expected fixed VERSIONINFO statement type, got BLOCK
; RUN: not llvm-rc /dry-run /V -- %p/Inputs/parser-versioninfo-unnamed-inner-block.rc 2>&1 | FileCheck %s --check-prefix PVERSIONINFO3
; PVERSIONINFO3: llvm-rc: Error parsing file: expected string, got {
; RUN: not llvm-rc /dry-run /V -- %p/Inputs/parser-versioninfo-unnamed-value.rc 2>&1 | FileCheck %s --check-prefix PVERSIONINFO4
; PVERSIONINFO4: llvm-rc: Error parsing file: expected string, got END
; RUN: not llvm-rc /dry-run /V -- %p/Inputs/parser-versioninfo-bad-type.rc 2>&1 | FileCheck %s --check-prefix PVERSIONINFO5
; PVERSIONINFO5: llvm-rc: Error parsing file: expected BLOCK or VALUE, got INCORRECT
; RUN: not llvm-rc /dry-run /V -- %p/Inputs/parser-versioninfo-repeated-fixed.rc 2>&1 | FileCheck %s --check-prefix PVERSIONINFO6
; PVERSIONINFO6: llvm-rc: Error parsing file: expected yet unread fixed VERSIONINFO statement type, got FILEVERSION
; RUN: not llvm-rc /dry-run /V -- %p/Inputs/parser-user-invalid-contents.rc 2>&1 | FileCheck %s --check-prefix PUSER1
; PUSER1: llvm-rc: Error parsing file: expected int or string, got InvalidToken