Fix file-check-cxx to handle quoted arguments
If the OVERRIDE_C_DATE_TIME environment variable is set, the build
system will add a macro to the global cflags that contains a static
quoted date, like:
-D__DATE__="\"Sep 28 2015\""
file-check-cxx needs to properly pass that through as a single, still
quoted argument. So use the quoted "$@" instead of turning each word
into an argument.
Change-Id: I6929d712c280d0452062640e0cba8a176d045c97
diff --git a/tests/file-check-cxx b/tests/file-check-cxx
index 8ece835..4018265 100755
--- a/tests/file-check-cxx
+++ b/tests/file-check-cxx
@@ -2,10 +2,10 @@
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
+shift 3
+SOURCE=$(echo "$@" | grep -oP '\S+\.cpp\b')
+OBJ=$(echo "$@" | grep -oP '\S+\.o\b')
+$CXX "$@" 2>&1 | $FILECHECK -check-prefix=$PREFIX $SOURCE
if [ "$?" -eq 0 ]; then
touch $OBJ
else