File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -1898,7 +1898,7 @@ mlir::Value ScalarExprEmitter::VisitUnaryImag(const UnaryOperator *e) {
18981898 Expr *op = e->getSubExpr ();
18991899 if (op->getType ()->isAnyComplexType ()) {
19001900 // If it's an l-value, load through the appropriate subobject l-value.
1901- // Note that we have to ask E because Op might be an l-value that
1901+ // Note that we have to ask `e` because `op` might be an l-value that
19021902 // this won't work for, e.g. an Obj-C property.
19031903 if (e->isGLValue ()) {
19041904 mlir::Location loc = cgf.getLoc (e->getExprLoc ());
Original file line number Diff line number Diff line change @@ -1939,7 +1939,7 @@ OpFoldResult cir::ComplexCreateOp::fold(FoldAdaptor adaptor) {
19391939
19401940LogicalResult cir::ComplexImagOp::verify () {
19411941 if (getType () != getOperand ().getType ().getElementType ()) {
1942- emitOpError () << " cir.complex.imag result type does not match operand type" ;
1942+ emitOpError () << " : result type does not match operand type" ;
19431943 return failure ();
19441944 }
19451945 return success ();
Original file line number Diff line number Diff line change @@ -21,3 +21,15 @@ module {
2121cir.global external @ci2 = #cir.const_complex<#cir.int<1> : !s32i, #cir.int<2> : !s64i> : !cir.complex<!s32i>
2222
2323}
24+
25+ // -----
26+
27+ module {
28+ cir.func @complex_imag_invalid_result_type() -> !cir.double {
29+ %0 = cir.alloca !cir.complex<!cir.double>, !cir.ptr<!cir.complex<!cir.double>>, ["c"]
30+ %2 = cir.load align(8) %0 : !cir.ptr<!cir.complex<!cir.double>>, !cir.complex<!cir.double>
31+ // expected-error @below {{result type does not match operand type}}
32+ %3 = cir.complex.imag %2 : !cir.complex<!cir.double> -> !cir.float
33+ cir.return
34+ }
35+ }
You can’t perform that action at this time.
0 commit comments