• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: not llvm-ml -filetype=s %s /Fo /dev/null 2>&1 | FileCheck %s --dump-input=always
2
3.data
4int_test STRUCT
5  int_arr DWORD ?, ?
6  int_scalar DWORD ?
7int_test ENDS
8
9t1 int_test <<1,2,3>>
10// CHECK: error: Initializer too long for field; expected at most 2 elements, got 3
11
12t2 int_test <4>
13// CHECK: error: Cannot initialize array field with scalar value
14
15t3 int_test <,<5,6>>
16// CHECK: error: Cannot initialize scalar field with array value
17
18real_test STRUCT
19  real_arr REAL4 ?, ?, ?
20  real_scalar REAL4 ?
21real_test ENDS
22
23t4 real_test <<1.0,0.0,-1.0,-2.0>>
24// CHECK: error: Initializer too long for field; expected at most 3 elements, got 4
25
26t5 real_test <2.0>
27// CHECK: error: Cannot initialize array field with scalar value
28
29t6 real_test <,<2.0,-2.0>>
30// CHECK: error: Cannot initialize scalar field with array value
31
32inner_struct STRUCT
33  a BYTE ?
34inner_struct ENDS
35
36struct_test STRUCT
37  struct_arr inner_struct 4 DUP (?)
38  struct_scalar inner_struct ?
39struct_test ENDS
40
41t7 struct_test <<<>, <>, <>, <>, <>>>
42// CHECK: error: Initializer too long for field; expected at most 4 elements, got 5
43
44t8 struct_test <,<<>, <>>>
45// CHECK: error: 'inner_struct' initializer initializes too many fields
46
47t9 STRUCT 3
48// CHECK: error: alignment must be a power of two; was 3
49t9 ENDS
50
51t10 STRUCT 1, X
52// CHECK: error: Unrecognized qualifier for 'STRUCT' directive; expected none or NONUNIQUE
53t10 ENDS
54
55t11 STRUCT
56different_struct ENDS
57// CHECK: error: mismatched name in ENDS directive; expected 't11'
58