File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -1320,7 +1320,11 @@ GetGlobalOp::verifySymbolUses(SymbolTableCollection &symbolTable) {
1320
1320
1321
1321
// global has non-array type
1322
1322
auto lvalueType = dyn_cast<LValueType>(resultType);
1323
- if (!lvalueType || lvalueType.getValueType () != globalType)
1323
+ if (!lvalueType)
1324
+ return emitOpError (" on non-array type expects result type to be an "
1325
+ " lvalue type for the global @" )
1326
+ << getName ();
1327
+ if (lvalueType.getValueType () != globalType)
1324
1328
return emitOpError (" on non-array type expects result inner type " )
1325
1329
<< lvalueType.getValueType () << " to match type " << globalType
1326
1330
<< " of the global @" << getName ();
Original file line number Diff line number Diff line change @@ -532,6 +532,16 @@ func.func @use_global() {
532
532
533
533
// -----
534
534
535
+ emitc.global @myglobal_value : f32
536
+
537
+ func.func @use_global () {
538
+ // expected-error @+1 {{'emitc.get_global' op on non-array type expects result type to be an lvalue type for the global @myglobal_value}}
539
+ %0 = emitc.get_global @myglobal_value : !emitc.array <2 xf32 >
540
+ return
541
+ }
542
+
543
+ // -----
544
+
535
545
func.func @member (%arg0: !emitc.lvalue <i32 >) {
536
546
// expected-error @+1 {{'emitc.member' op operand #0 must be emitc.lvalue of EmitC opaque type values, but got '!emitc.lvalue<i32>'}}
537
547
%0 = " emitc.member" (%arg0 ) {member = " a" } : (!emitc.lvalue <i32 >) -> !emitc.lvalue <i32 >
You can’t perform that action at this time.
0 commit comments