From 7381c9cb2d0b8599e4fcf79ef40eff4c96da997b Mon Sep 17 00:00:00 2001 From: shivaramaarao <58245296+shivaramaarao@users.noreply.github.com> Date: Fri, 19 Apr 2024 13:06:09 +0530 Subject: [PATCH] [test] pass Mnobackslash explicitly to the tests that assume default is Mnobackslash (#1440) This commit is to fix issue#1028 - Make backslash behaviour compatible with gfortran --- runtime/flang/CMakeLists.txt | 3 +++ test/f90_correct/inc/ae00.mk | 2 +- test/f90_correct/inc/db00.mk | 2 +- test/f90_correct/inc/dd00.mk | 2 +- test/f90_correct/inc/de00.mk | 2 +- test/f90_correct/inc/ec00.mk | 2 +- test/f90_correct/inc/fe86.mk | 2 +- test/f90_correct/inc/ia00.mk | 2 +- test/f90_correct/inc/im20.mk | 2 +- test/f90_correct/inc/ph10.mk | 2 +- test/f90_correct/inc/pre09.mk | 2 +- 11 files changed, 13 insertions(+), 10 deletions(-) diff --git a/runtime/flang/CMakeLists.txt b/runtime/flang/CMakeLists.txt index ad7f65a19aa..0d42648a7f8 100644 --- a/runtime/flang/CMakeLists.txt +++ b/runtime/flang/CMakeLists.txt @@ -14,6 +14,9 @@ else () SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -no-flang-libs") endif () +# iso_c_bind.F95 has C backslash characters and require -Mnobackslash option +SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mnobackslash") + # We are using Fortran driver to build this library with fresh compiler # components, so point its binary directory to the build directory to pick up # flang* executables diff --git a/test/f90_correct/inc/ae00.mk b/test/f90_correct/inc/ae00.mk index 81157a5cde8..2e1bb697d6b 100644 --- a/test/f90_correct/inc/ae00.mk +++ b/test/f90_correct/inc/ae00.mk @@ -14,7 +14,7 @@ build: $(SRC)/ae00.f -$(RM) ae00.$(EXESUFFIX) core *.d *.mod FOR*.DAT FTN* ftn* fort.* @echo ------------------------------------ building test $@ -$(CC) -c $(CFLAGS) $(SRC)/check.c -o check.$(OBJX) - -$(FC) -c $(FFLAGS) $(LDFLAGS) $(SRC)/ae00.f -o ae00.$(OBJX) + -$(FC) -c $(FFLAGS) -Mnobackslash $(LDFLAGS) $(SRC)/ae00.f -o ae00.$(OBJX) -$(FC) $(FFLAGS) $(LDFLAGS) ae00.$(OBJX) check.$(OBJX) $(LIBS) -o ae00.$(EXESUFFIX) diff --git a/test/f90_correct/inc/db00.mk b/test/f90_correct/inc/db00.mk index f7af0b57e01..5232ba3817c 100644 --- a/test/f90_correct/inc/db00.mk +++ b/test/f90_correct/inc/db00.mk @@ -14,7 +14,7 @@ build: $(SRC)/db00.f -$(RM) db00.$(EXESUFFIX) core *.d *.mod FOR*.DAT FTN* ftn* fort.* @echo ------------------------------------ building test $@ -$(CC) -c $(CFLAGS) $(SRC)/check.c -o check.$(OBJX) - -$(FC) -c $(FFLAGS) $(LDFLAGS) $(SRC)/db00.f -o db00.$(OBJX) + -$(FC) -c $(FFLAGS) -Mnobackslash $(LDFLAGS) $(SRC)/db00.f -o db00.$(OBJX) -$(FC) $(FFLAGS) $(LDFLAGS) db00.$(OBJX) check.$(OBJX) $(LIBS) -o db00.$(EXESUFFIX) diff --git a/test/f90_correct/inc/dd00.mk b/test/f90_correct/inc/dd00.mk index 9f634a2a9b1..9c881c56273 100644 --- a/test/f90_correct/inc/dd00.mk +++ b/test/f90_correct/inc/dd00.mk @@ -14,7 +14,7 @@ build: $(SRC)/dd00.f -$(RM) dd00.$(EXESUFFIX) core *.d *.mod FOR*.DAT FTN* ftn* fort.* @echo ------------------------------------ building test $@ -$(CC) -c $(CFLAGS) $(SRC)/check.c -o check.$(OBJX) - -$(FC) -c $(FFLAGS) $(LDFLAGS) $(SRC)/dd00.f -o dd00.$(OBJX) + -$(FC) -c $(FFLAGS) -Mnobackslash $(LDFLAGS) $(SRC)/dd00.f -o dd00.$(OBJX) -$(FC) $(FFLAGS) $(LDFLAGS) dd00.$(OBJX) check.$(OBJX) $(LIBS) -o dd00.$(EXESUFFIX) diff --git a/test/f90_correct/inc/de00.mk b/test/f90_correct/inc/de00.mk index 89490acd3a1..56df1e42e61 100644 --- a/test/f90_correct/inc/de00.mk +++ b/test/f90_correct/inc/de00.mk @@ -14,7 +14,7 @@ build: $(SRC)/de00.f -$(RM) de00.$(EXESUFFIX) core *.d *.mod FOR*.DAT FTN* ftn* fort.* @echo ------------------------------------ building test $@ -$(CC) -c $(CFLAGS) $(SRC)/check.c -o check.$(OBJX) - -$(FC) -c $(FFLAGS) $(LDFLAGS) $(SRC)/de00.f -o de00.$(OBJX) + -$(FC) -c $(FFLAGS) -Mnobackslash $(LDFLAGS) $(SRC)/de00.f -o de00.$(OBJX) -$(FC) $(FFLAGS) $(LDFLAGS) de00.$(OBJX) check.$(OBJX) $(LIBS) -o de00.$(EXESUFFIX) diff --git a/test/f90_correct/inc/ec00.mk b/test/f90_correct/inc/ec00.mk index 4da1603d60c..92b56bf40dc 100644 --- a/test/f90_correct/inc/ec00.mk +++ b/test/f90_correct/inc/ec00.mk @@ -14,7 +14,7 @@ build: $(SRC)/ec00.f -$(RM) ec00.$(EXESUFFIX) core *.d *.mod FOR*.DAT FTN* ftn* fort.* @echo ------------------------------------ building test $@ -$(CC) -c $(CFLAGS) $(SRC)/check.c -o check.$(OBJX) - -$(FC) -c $(FFLAGS) $(LDFLAGS) $(SRC)/ec00.f -o ec00.$(OBJX) + -$(FC) -c $(FFLAGS) -Mnobackslash $(LDFLAGS) $(SRC)/ec00.f -o ec00.$(OBJX) -$(FC) $(FFLAGS) $(LDFLAGS) ec00.$(OBJX) check.$(OBJX) $(LIBS) -o ec00.$(EXESUFFIX) diff --git a/test/f90_correct/inc/fe86.mk b/test/f90_correct/inc/fe86.mk index 379f2b70f61..0e43fb5bb24 100644 --- a/test/f90_correct/inc/fe86.mk +++ b/test/f90_correct/inc/fe86.mk @@ -14,7 +14,7 @@ fe86.$(OBJX): $(SRC)/fe86.f90 -$(RM) fe86.$(EXESUFFIX) core *.d *.mod FOR*.DAT FTN* ftn* fort.* @echo ------------------------------------ building test $@ -$(CC) -c $(CFLAGS) $(SRC)/check.c -o check.$(OBJX) - -$(FC) -c $(FFLAGS) $(LDFLAGS) $(SRC)/fe86.f90 -o fe86.$(OBJX) + -$(FC) -c $(FFLAGS) -Mnobackslash $(LDFLAGS) $(SRC)/fe86.f90 -o fe86.$(OBJX) -$(FC) $(FFLAGS) $(LDFLAGS) fe86.$(OBJX) check.$(OBJX) $(LIBS) -o fe86.$(EXESUFFIX) diff --git a/test/f90_correct/inc/ia00.mk b/test/f90_correct/inc/ia00.mk index 849e8598500..af2dc81537f 100644 --- a/test/f90_correct/inc/ia00.mk +++ b/test/f90_correct/inc/ia00.mk @@ -14,7 +14,7 @@ build: $(SRC)/ia00.f -$(RM) ia00.$(EXESUFFIX) core *.d *.mod FOR*.DAT FTN* ftn* fort.* @echo ------------------------------------ building test $@ -$(CC) -c $(CFLAGS) $(SRC)/check.c -o check.$(OBJX) - -$(FC) -c $(FFLAGS) $(LDFLAGS) $(SRC)/ia00.f -o ia00.$(OBJX) + -$(FC) -c $(FFLAGS) -Mnobackslash $(LDFLAGS) $(SRC)/ia00.f -o ia00.$(OBJX) -$(FC) $(FFLAGS) $(LDFLAGS) ia00.$(OBJX) check.$(OBJX) $(LIBS) -o ia00.$(EXESUFFIX) diff --git a/test/f90_correct/inc/im20.mk b/test/f90_correct/inc/im20.mk index 533a1ba9413..b286960b60d 100644 --- a/test/f90_correct/inc/im20.mk +++ b/test/f90_correct/inc/im20.mk @@ -14,7 +14,7 @@ build: $(SRC)/im20.f -$(RM) im20.$(EXESUFFIX) core *.d *.mod FOR*.DAT FTN* ftn* fort.* @echo ------------------------------------ building test $@ -$(CC) -c $(CFLAGS) $(SRC)/check.c -o check.$(OBJX) - -$(FC) -c $(FFLAGS) $(LDFLAGS) $(SRC)/im20.f -o im20.$(OBJX) + -$(FC) -c $(FFLAGS) -Mnobackslash $(LDFLAGS) $(SRC)/im20.f -o im20.$(OBJX) -$(FC) $(FFLAGS) $(LDFLAGS) im20.$(OBJX) check.$(OBJX) $(LIBS) -o im20.$(EXESUFFIX) diff --git a/test/f90_correct/inc/ph10.mk b/test/f90_correct/inc/ph10.mk index 20f4d9bcd34..1193ee89849 100644 --- a/test/f90_correct/inc/ph10.mk +++ b/test/f90_correct/inc/ph10.mk @@ -14,7 +14,7 @@ build: $(SRC)/ph10.f -$(RM) ph10.$(EXESUFFIX) core *.d *.mod FOR*.DAT FTN* ftn* fort.* @echo ------------------------------------ building test $@ -$(CC) -c $(CFLAGS) $(SRC)/check.c -o check.$(OBJX) - -$(FC) -c $(FFLAGS) $(LDFLAGS) $(SRC)/ph10.f -o ph10.$(OBJX) + -$(FC) -c $(FFLAGS) -Mnobackslash $(LDFLAGS) $(SRC)/ph10.f -o ph10.$(OBJX) -$(FC) $(FFLAGS) $(LDFLAGS) ph10.$(OBJX) check.$(OBJX) $(LIBS) -o ph10.$(EXESUFFIX) diff --git a/test/f90_correct/inc/pre09.mk b/test/f90_correct/inc/pre09.mk index 78419f1b4c1..72a6178559e 100644 --- a/test/f90_correct/inc/pre09.mk +++ b/test/f90_correct/inc/pre09.mk @@ -15,7 +15,7 @@ build: $(SRC)/pre09.f90 -$(RM) pre09.$(EXESUFFIX) core *.d *.mod FOR*.DAT FTN* ftn* fort.* @echo ------------------------------------ building test $@ -$(CC) -c $(CFLAGS) $(SRC)/check.c -o check.$(OBJX) - -$(FC) -c $(FFLAGS) $(LDFLAGS) $(SRC)/pre09.f90 -o pre09.$(OBJX) + -$(FC) -c $(FFLAGS) -Mnobackslash $(LDFLAGS) $(SRC)/pre09.f90 -o pre09.$(OBJX) -$(FC) $(FFLAGS) $(LDFLAGS) pre09.$(OBJX) check.$(OBJX) $(LIBS) -o pre09.$(EXESUFFIX)