2020-10-24 19:33:19 +08:00
|
|
|
! RUN: rm -rf %S/input-output-file.txt
|
|
|
|
|
|
|
|
! REQUIRES: new-flang-driver
|
|
|
|
|
|
|
|
!--------------------------
|
|
|
|
! FLANG DRIVER (flang-new)
|
|
|
|
!--------------------------
|
|
|
|
! TEST 1: Print to stdout (implicit)
|
2020-11-02 17:34:27 +08:00
|
|
|
! RUN: %flang-new -test-io %s 2>&1 | FileCheck %s --match-full-lines
|
2020-10-24 19:33:19 +08:00
|
|
|
! TEST 2: Print to stdout (explicit)
|
2020-11-02 17:34:27 +08:00
|
|
|
! RUN: %flang-new -test-io -o - %s 2>&1 | FileCheck %s --match-full-lines
|
2020-10-24 19:33:19 +08:00
|
|
|
! TEST 3: Print to a file
|
2020-11-02 17:34:27 +08:00
|
|
|
! RUN: %flang-new -test-io -o %t %s 2>&1 && FileCheck %s --match-full-lines --input-file=%t
|
2020-10-24 19:33:19 +08:00
|
|
|
|
|
|
|
!----------------------------------------
|
|
|
|
! FLANG FRONTEND DRIVER (flang-new -fc1)
|
|
|
|
!----------------------------------------
|
|
|
|
! TEST 4: Write to a file (implicit)
|
2020-11-02 17:34:27 +08:00
|
|
|
! RUN: %flang-new -fc1 -test-io %s 2>&1 && FileCheck %s --match-full-lines --input-file=%S/input-output-file.txt
|
2020-10-24 19:33:19 +08:00
|
|
|
! TEST 5: Write to a file (explicit)
|
2020-11-02 17:34:27 +08:00
|
|
|
! RUN: %flang-new -fc1 -test-io -o %t %s 2>&1 && FileCheck %s --match-full-lines --input-file=%t
|
2020-10-24 19:33:19 +08:00
|
|
|
|
|
|
|
!-----------------------
|
|
|
|
! EXPECTED OUTPUT
|
|
|
|
!-----------------------
|
|
|
|
! CHECK-LABEL: Program arithmetic
|
|
|
|
! CHECK-NEXT: Integer :: i, j
|
|
|
|
! CHECK-NEXT: i = 2; j = 3; i= i * j;
|
|
|
|
! CHECK-NEXT: End Program arithmetic
|
|
|
|
|
|
|
|
Program arithmetic
|
|
|
|
Integer :: i, j
|
|
|
|
i = 2; j = 3; i= i * j;
|
2020-11-02 17:34:27 +08:00
|
|
|
End Program arithmetic
|