From 808602a4852d470f5420af3c1711ffc0a4e90777 Mon Sep 17 00:00:00 2001
From: Dan Willemsen <dwillemsen@google.com>
Date: Mon, 28 Sep 2015 13:09:04 -0700
Subject: [PATCH] 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
---
 tests/file-check-cxx | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/file-check-cxx b/tests/file-check-cxx
index 8ece83556..40182656b 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