# Works

echo ==== Single-threaded x64 ====
if (Test-Path .\test.db) { Remove-Item .\test.db }
if (Test-Path .\test_x64_single.exe) { Remove-Item .\test_x64_single.exe }

tcc -m64 -g -Wall -o test_x64_single.exe `
-I. -D SQLITE_THREADSAFE=0 `
sqlite3.c test.c
.\test_x64_single.exe


# Does not work with threads (undefined symbol '__faststorefence')

echo ==== Multi-threaded x64 ====
if (Test-Path .\test.db) { Remove-Item .\test.db }
if (Test-Path .\test_x64_multi.exe) { Remove-Item .\test_x64_multi.exe }

tcc -m64 -g -Wall -o test_x64_multi.exe `
-I. `
sqlite3.c test.c
.\test_x64_multi.exe

# Does not work (compiles, but result segfaults)

echo ==== Single-threaded x32 ====
if (Test-Path .\test.db) { Remove-Item .\test.db }
if (Test-Path .\test_x32_single.exe) { Remove-Item .\test_x32_single.exe }

tcc -m32 -g -Wall -o test_x32_single.exe `
-I. -D SQLITE_THREADSAFE=0 `
sqlite3.c test.c
.\test_x32_single.exe