2 CFLAGS
='-Wno-unused -include /usr/include/stdio.h -include /usr/include/sys/wait.h -IBlocksRuntime'
7 if ! clang
--version; then
8 echo clang not installed
11 if clang
++ --version > /dev
/null
2>&1; then
14 echo clang
++ not installed
-- skipping C
++ tests
17 for test in BlocksRuntime
/tests
/*.
[cC
]; do
29 */dispatch_async.c
) skip
=1;;
30 */macro.c
) stub
='void foo(); int main(){foo(); printf("success");}'; println
=1;;
32 */voidarg.c
) println
=1;;
33 */varargs-bad-assign.c | \
34 */rettypepromotion.c | \
35 */shorthandexpression.c | \
39 */constassign.c
) xfail
=1;;
45 *.C
) cpp
=1; CC
=clang
++; ext
=.C
;;
46 *.cpp
) cpp
=1; CC
=clang
++; ext
=.cpp
;;
47 *.
cp) cpp
=1; CC
=clang
++; ext
=.
cp;;
48 *.c
++) cpp
=1; CC
=clang
++; ext
=.c
++;;
50 if [ -z "$skip" -a -n "$cpp" -a -z "$dopp" ]; then
51 echo "skipping $test (clang++ not installed)"
53 if [ -n "$skip" ]; then
56 if [ -n "$xfail" ]; then
57 echo "--- $(basename $test) ($fmsg) ---"
59 echo "--- $(basename $test) ($pmsg) ---"
61 if [ -n "$stub" ]; then
62 $CC -c $CFLAGS $extra -o $TESTDIR/$
(basename $test $ext).o
-fblocks $test && \
63 echo "$stub" |
$CC $CFLAGS $extra -o $TESTDIR/$
(basename $test $ext) -fblocks \
64 $TESTDIR/$
(basename $test $ext).o
$LIB -x c
- && \
65 $TESTDIR/$
(basename $test $ext)
67 $CC -c $CFLAGS $extra -o $TESTDIR/$
(basename $test $ext).o
-fblocks $test && \
68 $CC -o $TESTDIR/$
(basename $test $ext) -fblocks $TESTDIR/$
(basename $test $ext).o
$LIB && \
69 $TESTDIR/$
(basename $test $ext)
72 if [ -n "$println" ]; then
75 if [ $result = 0 -a -n "$xfail" ]; then
78 echo "*** ^FAILURE: expect FAIL test PASSED! ***"
83 if [ $result != 0 -a -z "$xfail" ]; then
86 echo "*** ^FAILURE: expect PASS test FAILED! ***"
94 if [ -n "$testsfailed" ]; then
97 echo "*** WARNING: Some failures occurred, look for '*** ^FAILURE:' lines above"
102 echo "*** All tests passed ***"