diff --git a/.gitignore b/.gitignore index 85ed7e70014a8c6d1ec59bda3c2991010ec0714f..19d5d8ea4be1641c3eeac23a25ec849d7a6d8a1e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ **/*.s **/a.out /tmp* +/thirdparty /chibicc /test/*.exe /stage2 diff --git a/test/thirdparty/common b/test/thirdparty/common new file mode 100644 index 0000000000000000000000000000000000000000..5c4ba8a0dfaf99e6fb12923702ba2d8860338c12 --- /dev/null +++ b/test/thirdparty/common @@ -0,0 +1,11 @@ +make="make -j$(nproc)" +chibicc=`pwd`/chibicc + +dir=$(basename -s .git $repo) + +set -e -x + +mkdir -p thirdparty +cd thirdparty +[ -d $dir ] || git clone $repo +cd $dir diff --git a/test/thirdparty/git.sh b/test/thirdparty/git.sh new file mode 100755 index 0000000000000000000000000000000000000000..d20d1e1967004024cb485624dade175ae578d176 --- /dev/null +++ b/test/thirdparty/git.sh @@ -0,0 +1,7 @@ +#!/bin/bash +repo='git@github.com:git/git.git' +. test/thirdparty/common +git reset --hard 54e85e7af1ac9e9a92888060d6811ae767fea1bc + +$make clean +$make V=1 CC=$chibicc test diff --git a/test/thirdparty/libpng.sh b/test/thirdparty/libpng.sh new file mode 100755 index 0000000000000000000000000000000000000000..8146eb58b044bc9d8d1b88d866cb7039ad7e2425 --- /dev/null +++ b/test/thirdparty/libpng.sh @@ -0,0 +1,10 @@ +#!/bin/bash +repo='git@github.com:rui314/libpng.git' +. test/thirdparty/common +git reset --hard dbe3e0c43e549a1602286144d94b0666549b18e6 + +CC=$chibicc ./configure +sed -i 's/^wl=.*/wl=-Wl,/; s/^pic_flag=.*/pic_flag=-fPIC/' libtool +$make clean +$make +$make test diff --git a/test/thirdparty/sqlite.sh b/test/thirdparty/sqlite.sh new file mode 100755 index 0000000000000000000000000000000000000000..d59def4a9e0c10050cd164a711d00a318542a14f --- /dev/null +++ b/test/thirdparty/sqlite.sh @@ -0,0 +1,10 @@ +#!/bin/bash +repo='git@github.com:sqlite/sqlite.git' +. test/thirdparty/common +git reset --hard 86f477edaa17767b39c7bae5b67cac8580f7a8c1 + +CC=$chibicc CFLAGS=-D_GNU_SOURCE ./configure +sed -i 's/^wl=.*/wl=-Wl,/; s/^pic_flag=.*/pic_flag=-fPIC/' libtool +$make clean +$make +$make test diff --git a/test/thirdparty/tinycc.sh b/test/thirdparty/tinycc.sh new file mode 100755 index 0000000000000000000000000000000000000000..0228ebfec93f77443dafbf06b26fa53b7e627b2a --- /dev/null +++ b/test/thirdparty/tinycc.sh @@ -0,0 +1,9 @@ +#!/bin/bash +repo='git@github.com:TinyCC/tinycc.git' +. test/thirdparty/common +git reset --hard df67d8617b7d1d03a480a28f9f901848ffbfb7ec + +./configure --cc=$chibicc +$make clean +$make +$make CC=cc test