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