Add tests for C++ compiler
authorHugo Villeneuve <hugo@hugovil.com>
Thu, 12 Mar 2015 02:03:57 +0000 (22:03 -0400)
committerHugo Villeneuve <hugo@hugovil.com>
Thu, 12 Mar 2015 02:16:22 +0000 (22:16 -0400)
stage2/toolchain-test

index cf8fa58..58eae08 100755 (executable)
@@ -2,7 +2,7 @@
 
 source ../functions/main
 
-# Testing toolchain
+# Testing C compiler
 cd /tmp
 echo 'main(){}' > dummy.c
 gcc dummy.c -Wl,--verbose &> dummy.log
@@ -15,4 +15,16 @@ fi
 
 rm dummy.{c,log} a.out
 
+# Testing C++ compiler
+cd /tmp
+echo 'main(){}' > dummy.cpp
+g++ dummy.cpp -Wl,--verbose &> dummy.log
+/tmp/a.out
+if [ $? -ne 0]; then
+    echo "Cannot run C++ program"
+    exit 1
+fi
+
+rm dummy.{cpp,log} a.out
+
 exit $?