Skip to content

Commit 74a9a3a

Browse files
committed
selfcheck.sh: also run with system includes made available
1 parent 435a74c commit 74a9a3a

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

selfcheck.sh

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,29 @@ output=$(./simplecpp simplecpp.cpp -e -f 2>&1)
44
ec=$?
55
errors=$(echo "$output" | grep -v 'Header not found: <')
66
if [ $ec -ne 0 ]; then
7-
# only fail if got errors which do not refer to missing system includes
7+
# only fail if we got errors which do not refer to missing system includes
88
if [ ! -z "$errors" ]; then
99
exit $ec
1010
fi
11+
fi
12+
13+
# on macOS gcc is an alias for clang
14+
gcc_type=$(gcc --version | head -1 | cut -d' ' -f1)
15+
if [ "$gcc_type" = "gcc" ]; then
16+
gcc_ver=$(gcc -dumpversion)
17+
./simplecpp simplecpp.cpp -e -f -D__GNUC__ -D__STDC__ -D__STDC_HOSTED__ -D__CHAR_BIT__=8 -I"/usr/include" -I"/usr/include/linux" -I"/usr/include/c++/$gcc_ver" -I"/usr/include/c++/$gcc_ver/x86_64-pc-linux-gnu" -I"/usr/lib64/gcc/x86_64-pc-linux-gnu/$gcc_ver/include"
18+
ec=$?
19+
if [ $ec -ne 0 ]; then
20+
exit $ec
21+
fi
22+
fi
23+
24+
if [ -d "/usr/include/c++/v1" ]; then
25+
#clang_ver=$(clang -dumpversion)
26+
#clang_ver=${clang_ver%%.*}
27+
./simplecpp simplecpp.cpp -e -f -D__BYTE_ORDER__ -I"/usr/include/c++/v1"
28+
ec=$?
29+
if [ $ec -ne 0 ]; then
30+
exit $ec
31+
fi
1132
fi

0 commit comments

Comments
 (0)