150
|
1 // RUN: mlir-opt %s -split-input-file -verify-diagnostics
|
|
2
|
|
3 // -----
|
|
4
|
236
|
5 func.func @location_missing_l_paren() {
|
150
|
6 ^bb:
|
221
|
7 return loc) // expected-error {{expected '(' in location}}
|
150
|
8 }
|
|
9
|
|
10 // -----
|
|
11
|
236
|
12 func.func @location_missing_r_paren() {
|
150
|
13 ^bb:
|
236
|
14 return loc(unknown // expected-error {{expected ')' in location}}
|
150
|
15 }
|
|
16
|
|
17 // -----
|
|
18
|
236
|
19 func.func @location_invalid_instance() {
|
150
|
20 ^bb:
|
|
21 return loc() // expected-error {{expected location instance}}
|
|
22 }
|
|
23
|
|
24 // -----
|
|
25
|
236
|
26 func.func @location_name_missing_r_paren() {
|
150
|
27 ^bb:
|
|
28 return loc("foo"(unknown]) // expected-error {{expected ')' after child location of NameLoc}}
|
|
29 }
|
|
30
|
|
31 // -----
|
|
32
|
236
|
33 func.func @location_callsite_missing_l_paren() {
|
150
|
34 ^bb:
|
|
35 return loc(callsite unknown // expected-error {{expected '(' in callsite location}}
|
|
36 }
|
|
37
|
|
38 // -----
|
|
39
|
236
|
40 func.func @location_callsite_missing_callee() {
|
150
|
41 ^bb:
|
|
42 return loc(callsite( at ) // expected-error {{expected location instance}}
|
|
43 }
|
|
44
|
|
45 // -----
|
|
46
|
236
|
47 func.func @location_callsite_missing_at() {
|
150
|
48 ^bb:
|
|
49 return loc(callsite(unknown unknown) // expected-error {{expected 'at' in callsite location}}
|
|
50 }
|
|
51
|
|
52 // -----
|
|
53
|
236
|
54 func.func @location_callsite_missing_caller() {
|
150
|
55 ^bb:
|
|
56 return loc(callsite(unknown at ) // expected-error {{expected location instance}}
|
|
57 }
|
|
58
|
|
59 // -----
|
|
60
|
236
|
61 func.func @location_callsite_missing_r_paren() {
|
150
|
62 ^bb:
|
236
|
63 return loc(callsite( unknown at unknown // expected-error {{expected ')' in callsite location}}
|
150
|
64 }
|
|
65
|
|
66 // -----
|
|
67
|
236
|
68 func.func @location_fused_missing_greater() {
|
150
|
69 ^bb:
|
|
70 return loc(fused<true [unknown]) // expected-error {{expected '>' after fused location metadata}}
|
|
71 }
|
|
72
|
|
73 // -----
|
|
74
|
236
|
75 func.func @location_fused_missing_metadata() {
|
150
|
76 ^bb:
|
236
|
77 // expected-error@+1 {{expected attribute value}}
|
|
78 return loc(fused<)
|
150
|
79 }
|
|
80
|
|
81 // -----
|
|
82
|
236
|
83 func.func @location_fused_missing_l_square() {
|
150
|
84 ^bb:
|
|
85 return loc(fused<true>unknown]) // expected-error {{expected '[' in fused location}}
|
|
86 }
|
|
87
|
|
88 // -----
|
|
89
|
236
|
90 func.func @location_fused_missing_r_square() {
|
150
|
91 ^bb:
|
|
92 return loc(fused[unknown) // expected-error {{expected ']' in fused location}}
|
|
93 }
|
221
|
94
|
|
95 // -----
|
|
96
|
236
|
97 func.func @location_invalid_alias() {
|
221
|
98 // expected-error@+1 {{expected location, but found dialect attribute: '#foo.loc'}}
|
|
99 return loc(#foo.loc)
|
|
100 }
|
|
101
|
|
102 // -----
|
|
103
|
236
|
104 func.func @location_invalid_alias() {
|
221
|
105 // expected-error@+1 {{operation location alias was never defined}}
|
|
106 return loc(#invalid_alias)
|
|
107 }
|
|
108
|
|
109 // -----
|
|
110
|
236
|
111 func.func @location_invalid_alias() {
|
221
|
112 // expected-error@+1 {{expected location, but found 'true'}}
|
|
113 return loc(#non_loc)
|
|
114 }
|
|
115
|
|
116 #non_loc = true
|
|
117
|