Debian Codegraph @

debian/tests/compile-stl-headers

raw symbols SCIP
1 #!/bin/sh
2 set -e
3
4 CXX=${1:-g++}
5
6 AUTOPKGTEST_TMP=${AUTOPKGTEST_TMP:-$(mktemp -d)}
7
8 cd $AUTOPKGTEST_TMP
9
10 CXX_MAJOR=$($CXX --version | sed -rn '1s/.* ([0-9]+)\..*/\1/p')
11 NVCC_VERSION=$(nvcc --version | sed -rn 's/Cuda compilation tools, release ([0-9.]+),.*/\1/p')
12
13 res=0
14 for header in /usr/include/c++/$CXX_MAJOR/*
15 do
16 test -f "$header" || continue
17 header=$(basename $header)
18 flags=
19 ignore_fail=
20 skip=
21 case $header in
22 complex.h)
23 # cicc does not terminate
24 [ "$NVCC_VERSION" = "12.4" ] && [ "$CXX_MAJOR" = "13" ] && skip="yes"
25 ;;
26 coroutine)
27 flags="-Xcompiler -fcoroutines"
28 ;;
29 esac
30 if [ "$skip" = "yes" ]; then
31 echo "$header (skipped)"
32 continue
33 elif [ "$ignore_fail" = "yes" ]; then
34 echo "$header (may fail)"
35 else
36 echo "$header"
37 fi
38 rc=0
39 echo "#include <$header>" | timeout 900 nvcc -ccbin $CXX -x cu $flags -o $header.o -c - || rc=$?
40 if [ "$rc" != 0 ]; then
41 if [ "$ignore_fail" = "yes" ]; then
42 echo "Ignored failure: $header"
43 else
44 echo "FAIL: $header"
45 res=$rc
46 fi
47 fi
48 done
49
50 exit $res