From b36b27b3fc78015b1821987309955328436f60e4 Mon Sep 17 00:00:00 2001 From: Mats Petersson Date: Tue, 13 Sep 2022 18:04:01 +0100 Subject: [PATCH] [flang][driver]Fix broken flang-new mlir test The test was added as a .mlir file, and this extension is not in the lit.cfg.py, so it was never run. When running it, the file would produce an error, as semicolon is not an MLIR comment. This adds the extension and fixes the comment start by using C++ style comments. Reviewed By: awarzynski Differential Revision: https://reviews.llvm.org/D133792 --- flang/test/Driver/emit-asm-from-mlir.mlir | 9 ++++----- flang/test/lit.cfg.py | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/flang/test/Driver/emit-asm-from-mlir.mlir b/flang/test/Driver/emit-asm-from-mlir.mlir index 99640662606c..3884c2cbc144 100644 --- a/flang/test/Driver/emit-asm-from-mlir.mlir +++ b/flang/test/Driver/emit-asm-from-mlir.mlir @@ -1,10 +1,9 @@ -; Verify that the driver can consume MLIR/FIR files. +// Verify that the driver can consume MLIR/FIR files. -; RUN: %flang_fc1 -S %s -o - | FileCheck %s - -; CHECK-LABEL: foo: -; CHECK: ret +// RUN: %flang_fc1 -S %s -o - | FileCheck %s +// CHECK-LABEL: foo: +// CHECK: ret func.func @foo() { return } diff --git a/flang/test/lit.cfg.py b/flang/test/lit.cfg.py index 0248dab966cf..9e3cfcc97000 100644 --- a/flang/test/lit.cfg.py +++ b/flang/test/lit.cfg.py @@ -27,8 +27,8 @@ config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell) # suffixes: A list of file extensions to treat as test files. config.suffixes = ['.c', '.cpp', '.f', '.F', '.ff', '.FOR', '.for', '.f77', '.f90', '.F90', '.ff90', '.f95', '.F95', '.ff95', '.fpp', '.FPP', '.cuf' - '.CUF', '.f18', '.F18', '.fir', '.f03', '.F03', '.f08', - '.F08', '.ll'] + '.CUF', '.f18', '.F18', '.f03', '.F03', '.f08', '.F08', + '.ll', '.fir', '.mlir'] config.substitutions.append(('%PATH%', config.environment['PATH'])) config.substitutions.append(('%llvmshlibdir', config.llvm_shlib_dir))