Files
clang-p2996/flang/test/Driver/tco-emit-final-mlir.fir
Kajetan Puchalski 69b69cbcb4 [flang][tco] Add -emit-final-mlir flag (#146533)
Add a flag to tco for emitting the final MLIR, prior to lowering to LLVM
IR. This is intended to produce output that can be passed directly to
mlir-translate.

---------

Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com>
2025-07-01 16:22:36 +01:00

20 lines
521 B
Plaintext

// Test tco's -emit-final-mlir option.
// RUN: tco -emit-final-mlir %s 2>&1 | FileCheck %s
// Check that the FIR file is translated into the LLVM IR
// MLIR dialect, but not into LLVM IR itself.
// CHECK-NOT: func.func
// CHECK-LABEL: llvm.func @_QPfoo()
// CHECK-NOT: fir.alloca
// CHECK: %[[VAL_0:.*]] = llvm.mlir.constant(1 : i64) : i64
// CHECK: %[[VAL_1:.*]] = llvm.alloca %[[VAL_0]] x i32 : (i64) -> !llvm.ptr
// CHECK: llvm.return
// CHECK-NOT: func.func
func.func @_QPfoo() {
%1 = fir.alloca i32
return
}