[flang-commits] [flang] b36b27b - [flang][driver]Fix broken flang-new mlir test

Mats Petersson via flang-commits flang-commits at lists.llvm.org
Wed Sep 14 06:17:13 PDT 2022


Author: Mats Petersson
Date: 2022-09-14T14:16:31+01:00
New Revision: b36b27b3fc78015b1821987309955328436f60e4

URL: https://github.com/llvm/llvm-project/commit/b36b27b3fc78015b1821987309955328436f60e4
DIFF: https://github.com/llvm/llvm-project/commit/b36b27b3fc78015b1821987309955328436f60e4.diff

LOG: [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

Added: 
    

Modified: 
    flang/test/Driver/emit-asm-from-mlir.mlir
    flang/test/lit.cfg.py

Removed: 
    


################################################################################
diff  --git a/flang/test/Driver/emit-asm-from-mlir.mlir b/flang/test/Driver/emit-asm-from-mlir.mlir
index 99640662606c6..3884c2cbc144c 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 0248dab966cfa..9e3cfcc97000a 100644
--- a/flang/test/lit.cfg.py
+++ b/flang/test/lit.cfg.py
@@ -27,8 +27,8 @@
 # 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))


        


More information about the flang-commits mailing list