[flang] Improve compiler_version test (NFC)
authorKelvin Li <kli@ca.ibm.com>
Fri, 9 Jun 2023 18:47:51 +0000 (14:47 -0400)
committerKelvin Li <kli@ca.ibm.com>
Mon, 12 Jun 2023 01:49:03 +0000 (21:49 -0400)
This patch is to allow an extra string prepended to the compiler_version.
The check is enhanced to verify that "flang version" is followed by
numbers in the form of "n.n.n".

Differential Revision: https://reviews.llvm.org/D152572

flang/test/Evaluate/compiler_version.f90

index ebfef95..db64e83 100644 (file)
@@ -4,7 +4,7 @@ program main
     use ISO_FORTRAN_ENV, only: compiler_version
     implicit none
     character (len = :), allocatable :: v
-! CHECK: v="flang version {{.*}}"
+! CHECK: v="{{.*}}flang version {{[0-9]*.[0-9]*.[0-9]}} {{.*}}"
     v = compiler_version()
     print *, v
     deallocate(v)