brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 7c4689c Raw
36 lines · plain
1program main2  print *, __FILE__, __LINE__3end4 5! This test verifies that `flang`'s `-x` options behave like `gfortran`'s.6! Specifically:7! - `-x f95` should process the file based on its extension unless overridden.8! - `-x f95-cpp-input` should behave like `-x f95` but with preprocessing9!   (`-cpp`) enabled unless overridden.10 11! ---12! Ensure the file is treated as fixed-form unless explicitly set otherwise13! ---14! RUN: not %flang -Werror -fsyntax-only -x f95 -cpp %s 2>&1 | FileCheck --check-prefix=SCAN-ERROR %s15! RUN: not %flang -Werror -fsyntax-only -x f95-cpp-input %s 2>&1 | FileCheck --check-prefix=SCAN-ERROR %s16 17! SCAN-ERROR: error: Could not scan18 19! RUN: %flang -Werror -fsyntax-only -x f95 -cpp -ffree-form %s 2>&1 | FileCheck --check-prefix=NO-SCAN-ERROR --allow-empty %s20! RUN: %flang -Werror -fsyntax-only -x f95-cpp-input -ffree-form %s 2>&1 | FileCheck --check-prefix=NO-SCAN-ERROR --allow-empty %s21 22! NO-SCAN-ERROR-NOT: error23 24! ---25! Ensure `-cpp` is not enabled by default unless explicitly requested26! ---27! RUN: not %flang -Werror -fsyntax-only -x f95 -ffree-form %s 2>&1 | FileCheck --check-prefix=SEMA-ERROR %s28! RUN: not %flang -Werror -fsyntax-only -x f95-cpp-input -nocpp -ffree-form %s 2>&1 | FileCheck --check-prefix=SEMA-ERROR %s29 30! SEMA-ERROR: error: Semantic errors31 32! RUN: %flang -Werror -fsyntax-only -x f95 -cpp -ffree-form %s 2>&1 | FileCheck --check-prefix=NO-SEMA-ERROR --allow-empty %s33! RUN: %flang -Werror -fsyntax-only -x f95-cpp-input -ffree-form %s 2>&1 | FileCheck --check-prefix=NO-SEMA-ERROR --allow-empty %s34 35! NO-SEMA-ERROR-NOT: error36