1 | // UNSUPPORTED: system-windows |
2 | // RUN: split-file %s %t |
3 | // RUN: chmod +x %t/runtest.sh |
4 | // RUN: %t/runtest.sh %t %t/cppfile.cpp %flang | FileCheck %s |
5 | |
6 | //--- cppfile.cpp |
7 | extern "C" { |
8 | #include "ISO_Fortran_binding.h" |
9 | } |
10 | #include <iostream> |
11 | |
12 | int main() { |
13 | std::cout << "PASS\n" ; |
14 | return 0; |
15 | } |
16 | |
17 | // CHECK: PASS |
18 | // clang-format off |
19 | //--- runtest.sh |
20 | #!/bin/bash |
21 | TMPDIR=$1 |
22 | CPPFILE=$2 |
23 | FLANG=$3 |
24 | BINDIR=`dirname $FLANG` |
25 | CPPCOMP=$BINDIR/clang++ |
26 | if [ -x $CPPCOMP ] |
27 | then |
28 | $CPPCOMP $CPPFILE -o $TMPDIR/a.out |
29 | $TMPDIR/a.out # should print "PASS" |
30 | else |
31 | # No clang compiler, just pass by default |
32 | echo "PASS" |
33 | fi |
34 | |