The op `emitc.include` does not have results and thus will be elided
during canonicalization, which is not correct behavior. This change
removes the 'Pure' trait and adds a canonicalization test.
Reviewed By: jpienaar, marbre
Differential Revision: https://reviews.llvm.org/D141704
}
def EmitC_IncludeOp
- : EmitC_Op<"include", [Pure, HasParent<"ModuleOp">]> {
+ : EmitC_Op<"include", [HasParent<"ModuleOp">]> {
let summary = "Include operation";
let description = [{
The `include` operation allows to define a source file inclusion via the
// RUN: mlir-opt %s | mlir-opt | FileCheck %s
+// RUN: mlir-opt %s -canonicalize | FileCheck %s
+// CHECK: emitc.include <"test.h">
+// CHECK: emitc.include "test.h"
emitc.include <"test.h">
emitc.include "test.h"