38 lines · plain
1 2!--------------------------3! FLANG DRIVER (flang)4!--------------------------5! NOTE: Use `-E` so that the compiler driver stops after the 1st compilation phase, preprocessing. That's all we need.6 7! TEST 1: Print to stdout (implicit)8! RUN: %flang -E %s 2>&1 | FileCheck %s --match-full-lines9 10! TEST 2: Print to stdout (explicit)11! RUN: %flang -E -o - %s 2>&1 | FileCheck %s --match-full-lines12 13! TEST 3: Print to a file14! RUN: %flang -E -o %t %s 2>&1 && FileCheck %s --match-full-lines --input-file=%t15 16!----------------------------------------17! FLANG FRONTEND DRIVER (flang -fc1)18!----------------------------------------19! TEST 4: Write to a file (implicit)20! This particular test case generates an output file in the same directory as the input file. We need to copy the input file into a21! temporary directory to avoid polluting the source directory.22! RUN: rm -rf %t-dir && mkdir -p %t-dir && cd %t-dir23! RUN: cp %s .24! RUN: %flang_fc1 -test-io input-output-file.f90 2>&1 && FileCheck %s --match-full-lines --input-file=input-output-file.txt25 26! TEST 5: Write to a file (explicit)27! RUN: %flang_fc1 -test-io -o %t %s 2>&1 && FileCheck %s --match-full-lines --input-file=%t28 29! CHECK-LABEL: Program arithmetic30! CHECK-NEXT: Integer :: i, j31! CHECK-NEXT: i = 2; j = 3; i= i * j;32! CHECK-NEXT: End Program arithmetic33 34Program arithmetic35 Integer :: i, j36 i = 2; j = 3; i= i * j;37End Program arithmetic38