Clang] Fix expansion of response files in -Wp after integrated-cc1 change
[llvm-project.git] / libcxxabi / test / testit
blobeca0b37bae36e32d54c8defcf61d6c1bed983383
1 #!/bin/sh
2 #===------------------------------ testit ----------------------------------===#
4 # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 # See https://llvm.org/LICENSE.txt for license information.
6 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 #===------------------------------------------------------------------------===#
10 if [ -z "$CC" ]
11 then
12 CC=clang++
15 if [ -z "$OPTIONS" ]
16 then
17 OPTIONS="-std=c++0x -stdlib=libc++"
20 case $TRIPLE in
21 *-*-mingw* | *-*-cygwin* | *-*-win*)
22 TEST_EXE=test.exe
25 TEST_EXE=a.out
27 esac
29 FAIL=0
30 PASS=0
31 UNIMPLEMENTED=0
32 IMPLEMENTED_FAIL=0
33 IMPLEMENTED_PASS=0
35 afunc()
37 fail=0
38 pass=0
39 if (ls *.fail.cpp > /dev/null 2>&1)
40 then
41 for FILE in $(ls *.fail.cpp); do
42 if $CC $OPTIONS $HEADER_INCLUDE $SOURCE_LIB $FILE $LIBS -o ./$TEST_EXE > /dev/null 2>&1
43 then
44 rm ./$TEST_EXE
45 echo "$FILE should not compile"
46 fail=$(($fail + 1))
47 else
48 pass=$(($pass + 1))
50 done
53 if (ls *.cpp > /dev/null 2>&1)
54 then
55 for FILE in $(ls *.pass.cpp); do
56 if $CC $OPTIONS $HEADER_INCLUDE $SOURCE_LIB $FILE $LIBS -o ./$TEST_EXE
57 then
58 if ./$TEST_EXE
59 then
60 rm ./$TEST_EXE
61 pass=$(($pass + 1))
62 else
63 echo "$FILE failed at run time"
64 fail=$(($fail + 1))
65 rm ./$TEST_EXE
67 else
68 echo "$FILE failed to compile"
69 fail=$(($fail + 1))
71 done
74 if [ $fail -gt 0 ]
75 then
76 echo "failed $fail tests in `pwd`"
77 IMPLEMENTED_FAIL=$(($IMPLEMENTED_FAIL + 1))
79 if [ $pass -gt 0 ]
80 then
81 echo "passed $pass tests in `pwd`"
82 if [ $fail -eq 0 ]
83 then
84 IMPLEMENTED_PASS=$(($IMPLEMENTED_PASS + 1))
87 if [ $fail -eq 0 -a $pass -eq 0 ]
88 then
89 echo "not implemented: `pwd`"
90 UNIMPLEMENTED=$(($UNIMPLEMENTED + 1))
93 FAIL=$(($FAIL + $fail))
94 PASS=$(($PASS + $pass))
96 for FILE in *
98 if [ -d "$FILE" ];
99 then
100 cd $FILE
101 afunc
102 cd ..
104 done
107 afunc
109 echo "****************************************************"
110 echo "Results for `pwd`:"
111 echo "using `$CC --version`"
112 echo "with $OPTIONS $HEADER_INCLUDE $SOURCE_LIB"
113 echo "----------------------------------------------------"
114 echo "sections without tests : $UNIMPLEMENTED"
115 echo "sections with failures : $IMPLEMENTED_FAIL"
116 echo "sections without failures: $IMPLEMENTED_PASS"
117 echo " + ----"
118 echo "total number of sections : $(($UNIMPLEMENTED+$IMPLEMENTED_FAIL+$IMPLEMENTED_PASS))"
119 echo "----------------------------------------------------"
120 echo "number of tests failed : $FAIL"
121 echo "number of tests passed : $PASS"
122 echo " + ----"
123 echo "total number of tests : $(($FAIL+$PASS))"
124 echo "****************************************************"
126 exit $FAIL