summaryrefslogtreecommitdiffstats
path: root/tests/file-check-cxx
diff options
context:
space:
mode:
Diffstat (limited to 'tests/file-check-cxx')
-rwxr-xr-xtests/file-check-cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/file-check-cxx b/tests/file-check-cxx
new file mode 100755
index 0000000..8ece835
--- /dev/null
+++ b/tests/file-check-cxx
@@ -0,0 +1,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