Skip to content

Commit 86a9a26

Browse files
committed
Update tests run script
Move user CFLAGS to be included at the end of the cc options. Ensure zig-cc on Mac uses -O1 to workaround a quirk.
1 parent b53d0a2 commit 86a9a26

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

tests/run.sh

+8-5
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ fi
4343
if [[ "$CC" == "" ]]; then
4444
CC=cc
4545
fi
46+
UCFLAGS=$CFLAGS
47+
CFLAGS=
4648
if [[ "$1" != "bench" ]]; then
47-
CFLAGS="-O0 -g3 -Wall -Wextra -fstrict-aliasing $CFLAGS"
49+
CFLAGS="-O0 -g2 -Wall -Wextra -fstrict-aliasing $CFLAGS"
4850
CCVERSHEAD="$($CC --version | head -n 1)"
4951
if [[ "$CCVERSHEAD" == "" ]]; then
5052
exit 1
@@ -109,14 +111,15 @@ elif [[ "`uname`" == *"_NT-"* ]]; then
109111
fi
110112

111113
if [[ "$CC" == *"zig"* ]]; then
112-
# Without -O3, 'zig cc' has quirks issues on Mac OS.
113-
CFLAGS="$CFLAGS -O3"
114114
# Stack unwinding is not supported yet
115115
# https://github.com/ziglang/zig/issues/9046
116116
CFLAGS="$CFLAGS -DLLCO_NOUNWIND"
117+
# Without -O1, 'zig cc' has quirks issues on Mac OS.
118+
if [[ "`uname`" == "Darwin" ]]; then
119+
CFLAGS="$CFLAGS -O1"
120+
fi
117121
fi
118-
119-
122+
CFLAGS="$CFLAGS $UCFLAGS"
120123

121124
CC=${CC:-cc}
122125
echo "CC: $CC"

0 commit comments

Comments
 (0)