150
|
1 // RUN: mlir-opt %s -split-input-file -verify-diagnostics
|
|
2
|
|
3 // -----
|
|
4
|
|
5 func @location_missing_l_paren() {
|
|
6 ^bb:
|
|
7 return loc) // expected-error {{expected '(' in inline location}}
|
|
8 }
|
|
9
|
|
10 // -----
|
|
11
|
|
12 func @location_missing_r_paren() {
|
|
13 ^bb:
|
|
14 return loc(unknown // expected-error@+1 {{expected ')' in inline location}}
|
|
15 }
|
|
16
|
|
17 // -----
|
|
18
|
|
19 func @location_invalid_instance() {
|
|
20 ^bb:
|
|
21 return loc() // expected-error {{expected location instance}}
|
|
22 }
|
|
23
|
|
24 // -----
|
|
25
|
|
26 func @location_name_missing_r_paren() {
|
|
27 ^bb:
|
|
28 return loc("foo"(unknown]) // expected-error {{expected ')' after child location of NameLoc}}
|
|
29 }
|
|
30
|
|
31 // -----
|
|
32
|
|
33 func @location_name_child_is_name() {
|
|
34 ^bb:
|
|
35 return loc("foo"("foo")) // expected-error {{child of NameLoc cannot be another NameLoc}}
|
|
36 }
|
|
37
|
|
38 // -----
|
|
39
|
|
40 func @location_callsite_missing_l_paren() {
|
|
41 ^bb:
|
|
42 return loc(callsite unknown // expected-error {{expected '(' in callsite location}}
|
|
43 }
|
|
44
|
|
45 // -----
|
|
46
|
|
47 func @location_callsite_missing_callee() {
|
|
48 ^bb:
|
|
49 return loc(callsite( at ) // expected-error {{expected location instance}}
|
|
50 }
|
|
51
|
|
52 // -----
|
|
53
|
|
54 func @location_callsite_missing_at() {
|
|
55 ^bb:
|
|
56 return loc(callsite(unknown unknown) // expected-error {{expected 'at' in callsite location}}
|
|
57 }
|
|
58
|
|
59 // -----
|
|
60
|
|
61 func @location_callsite_missing_caller() {
|
|
62 ^bb:
|
|
63 return loc(callsite(unknown at ) // expected-error {{expected location instance}}
|
|
64 }
|
|
65
|
|
66 // -----
|
|
67
|
|
68 func @location_callsite_missing_r_paren() {
|
|
69 ^bb:
|
|
70 return loc(callsite( unknown at unknown // expected-error@+1 {{expected ')' in callsite location}}
|
|
71 }
|
|
72
|
|
73 // -----
|
|
74
|
|
75 func @location_fused_missing_greater() {
|
|
76 ^bb:
|
|
77 return loc(fused<true [unknown]) // expected-error {{expected '>' after fused location metadata}}
|
|
78 }
|
|
79
|
|
80 // -----
|
|
81
|
|
82 func @location_fused_missing_metadata() {
|
|
83 ^bb:
|
|
84 // expected-error@+1 {{expected non-function type}}
|
|
85 return loc(fused<) // expected-error {{expected valid attribute metadata}}
|
|
86 }
|
|
87
|
|
88 // -----
|
|
89
|
|
90 func @location_fused_missing_l_square() {
|
|
91 ^bb:
|
|
92 return loc(fused<true>unknown]) // expected-error {{expected '[' in fused location}}
|
|
93 }
|
|
94
|
|
95 // -----
|
|
96
|
|
97 func @location_fused_missing_r_square() {
|
|
98 ^bb:
|
|
99 return loc(fused[unknown) // expected-error {{expected ']' in fused location}}
|
|
100 }
|