aboutsummaryrefslogtreecommitdiff
path: root/test/test.sh
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2023-11-19 11:41:26 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2023-11-19 11:41:26 +0100
commit8059d63339b49d37af894f861956de4b89429bee (patch)
treeb004abfb3145d883f4be559723e00134164bab43 /test/test.sh
parent6ef99181273f6d8b3a3e08ce43ac3497ff71a0c0 (diff)
downloadnissy-core-8059d63339b49d37af894f861956de4b89429bee.tar.gz
nissy-core-8059d63339b49d37af894f861956de4b89429bee.zip
Improved sanitizer detection
Diffstat (limited to 'test/test.sh')
-rwxr-xr-xtest/test.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/test.sh b/test/test.sh
index 68b87aa..3adee3a 100755
--- a/test/test.sh
+++ b/test/test.sh
@@ -1,15 +1,15 @@
1#!/bin/sh 1#!/bin/sh
2 2
3detectsan() { cc -fsanitize=$1 -dM -E -x c - </dev/null | grep "SANITIZE"; }
4
3re="${TEST:-$@}" 5re="${TEST:-$@}"
4 6
5CC="cc -DDEBUG -std=c99 -pedantic -Wall -Wextra \ 7CC="cc -DDEBUG -std=c99 -pedantic -Wall -Wextra \
6 -Wno-unused-parameter -Wno-unused-function -g3 -D$CUBETYPE" 8 -Wno-unused-parameter -Wno-unused-function -g3 -D$CUBETYPE"
7if [ "$CUBETYPE" = "CUBE_AVX2" ]; then 9
8 CC="$CC -mavx2" 10[ "$CUBETYPE" = "CUBE_AVX2" ] && CC="$CC -mavx2"
9fi 11[ -n "$(detectsan address)" ] && CC="$CC -fsanitize=address"
10if [ "$(uname)" != "OpenBSD" ]; then 12[ -n "$(detectsan undefined)" ] && CC="$CC -fsanitize=undefined"
11 CC="$CC -fsanitize=address -fsanitize=undefined"
12fi
13 13
14TESTBIN="test/run" 14TESTBIN="test/run"
15TESTOUT="test/last.out" 15TESTOUT="test/last.out"

Generated with cgit - Back to sebastiano.tronto.net