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

source code of flang/test/Integration/iso-fortran-binding.cpp