summaryrefslogtreecommitdiffstats
path: root/tests/file-check-cxx
blob: 8ece835565b3e8a16da9e5deaa9e6441d432daad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/bash
FILECHECK=$1
CXX=$2
PREFIX=$3
ARGS=${*:4}
SOURCE=$(echo $ARGS | grep -oP '\S+\.cpp\b')
OBJ=$(echo $ARGS | grep -oP '\S+\.o\b')
$CXX $ARGS 2>&1 | $FILECHECK -check-prefix=$PREFIX $SOURCE
if [ "$?" -eq 0 ]; then
  touch $OBJ
else
  exit 1
fi