aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorgrischka <grischka>2017-02-13 19:03:29 +0100
committergrischka <grischka>2017-02-13 19:03:29 +0100
commit43d9a7de9b83f437d55c2cbc6e9625e3fafa5102 (patch)
tree5890bbdeebd2bec986afd99f51f624c652a915a9 /tests
parent13056da039240a1d418335f6e0506a89fb2d8495 (diff)
downloadtinycc-43d9a7de9b83f437d55c2cbc6e9625e3fafa5102.tar.gz
tinycc-43d9a7de9b83f437d55c2cbc6e9625e3fafa5102.tar.bz2
updates & cleanups (tcc-doc/Changelog/TODO ...)
- tcc-doc.texi: commandline option info update - Changelog/TODO: update - tests/tcctest.py: removed - tests/Makefile: weaktest fixed - tests/tests2: some files renamed and/or converted to unix LF - configure/Makefile: --enable-static option (no dll on win32) - win32/build-tcc.bat: msvc support - win32/tcc-win32.txt: build info update - win32/vs2015/: VS solution removed - win32/include/tcc/tcc_libm.h: #include statement fixed - tcc.c: -include <file> option help info - .gitignore: cleanup
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile5
-rw-r--r--tests/tcctest.py15
-rw-r--r--tests/tests2/84_hex-float.c (renamed from tests/tests2/84-hex-float.c)0
-rw-r--r--tests/tests2/84_hex-float.expect (renamed from tests/tests2/84-hex-float.expect)0
-rw-r--r--tests/tests2/85_asm-outside-function.c (renamed from tests/tests2/85-asm-outside-function.c)0
-rw-r--r--tests/tests2/85_asm-outside-function.expect (renamed from tests/tests2/85-asm-outside-function.expect)0
-rw-r--r--[-rwxr-xr-x]tests/tests2/86_memory-model.c (renamed from tests/tests2/86-memory-model.c)76
-rw-r--r--[-rwxr-xr-x]tests/tests2/86_memory-model.expect (renamed from tests/tests2/86-memory-model.expect)2
-rw-r--r--tests/tests2/89_nocode_wanted.c (renamed from tests/tests2/82_nocode_wanted.c)12
-rw-r--r--tests/tests2/89_nocode_wanted.expect (renamed from tests/tests2/82_nocode_wanted.expect)0
-rw-r--r--tests/tests2/90_struct-init.c (renamed from tests/tests2/86-struct-init.c)0
-rw-r--r--tests/tests2/90_struct-init.expect (renamed from tests/tests2/86-struct-init.expect)0
-rw-r--r--tests/tests2/91_ptr_longlong_arith32.c (renamed from tests/tests2/87_ptr_longlong_arith32.c)0
-rw-r--r--tests/tests2/91_ptr_longlong_arith32.expect (renamed from tests/tests2/87_ptr_longlong_arith32.expect)0
14 files changed, 48 insertions, 62 deletions
diff --git a/tests/Makefile b/tests/Makefile
index 39c4830..dbd035f 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -187,7 +187,7 @@ speedtest: ex2 ex3
weaktest: tcctest.c test.ref
$(TCC) -c $< -o weaktest.tcc.o
- $(CC) -c $< -o weaktest.gcc.o -I. $(CFLAGS)
+ $(CC) -c $< -o weaktest.gcc.o $(NATIVE_DEFINES) $(CFLAGS) -w -O0 -std=gnu99 -fno-omit-frame-pointer
objdump -t weaktest.tcc.o | grep ' w ' | sed -e 's/.* \([a-zA-Z0-9_]*\)$$/\1/' | LC_ALL=C sort > weaktest.tcc.o.txt
objdump -t weaktest.gcc.o | grep ' w ' | sed -e 's/.* \([a-zA-Z0-9_]*\)$$/\1/' | LC_ALL=C sort > weaktest.gcc.o.txt
diff weaktest.gcc.o.txt weaktest.tcc.o.txt && echo "Weak Auto Test OK"
@@ -254,7 +254,8 @@ cache: tcc_g
# clean
clean:
rm -f *~ *.o *.a *.bin *.i *.ref *.out *.out? *.out?b *.cc *.gcc \
-*-cc *-gcc *-tcc *.exe hello libtcc_test vla_test tcctest[1234] ex? tcc_g
+ *-cc *-gcc *-tcc *.exe hello libtcc_test vla_test tcctest[1234] \
+ ex? tcc_g *.def weaktest.*.txt
$(MAKE) -C tests2 $@
$(MAKE) -C pp $@
diff --git a/tests/tcctest.py b/tests/tcctest.py
deleted file mode 100644
index 817250f..0000000
--- a/tests/tcctest.py
+++ /dev/null
@@ -1,15 +0,0 @@
-import subprocess
-import sys
-import difflib
-
-def main():
- reference = subprocess.check_output([sys.argv[1]])
- compare = subprocess.check_output(sys.argv[2:])
- failed = False
- for line in difflib.unified_diff(reference.split('\n'), compare.split('\n'), fromfile='cc', tofile='tcc', lineterm=''):
- failed = True
- print line
- sys.exit(1 if failed else 0)
-
-if __name__ == '__main__':
- main()
diff --git a/tests/tests2/84-hex-float.c b/tests/tests2/84_hex-float.c
index 0ef09bf..0ef09bf 100644
--- a/tests/tests2/84-hex-float.c
+++ b/tests/tests2/84_hex-float.c
diff --git a/tests/tests2/84-hex-float.expect b/tests/tests2/84_hex-float.expect
index 2175385..2175385 100644
--- a/tests/tests2/84-hex-float.expect
+++ b/tests/tests2/84_hex-float.expect
diff --git a/tests/tests2/85-asm-outside-function.c b/tests/tests2/85_asm-outside-function.c
index dc5639a..dc5639a 100644
--- a/tests/tests2/85-asm-outside-function.c
+++ b/tests/tests2/85_asm-outside-function.c
diff --git a/tests/tests2/85-asm-outside-function.expect b/tests/tests2/85_asm-outside-function.expect
index dcf02b2..dcf02b2 100644
--- a/tests/tests2/85-asm-outside-function.expect
+++ b/tests/tests2/85_asm-outside-function.expect
diff --git a/tests/tests2/86-memory-model.c b/tests/tests2/86_memory-model.c
index ca30737..744c3e2 100755..100644
--- a/tests/tests2/86-memory-model.c
+++ b/tests/tests2/86_memory-model.c
@@ -1,38 +1,38 @@
-#include <stdio.h>
-
-int
-main()
-{
-#if defined(__LLP64__)
- if (sizeof(short) == 2
- && sizeof(int) == 4
- && sizeof(long int) == 4
- && sizeof(long long int) == 8
- && sizeof(void*) == 8) {
- (void)printf("Ok\n");
- } else {
- (void)printf("KO __LLP64__\n");
- }
-#elif defined(__LP64__)
- if (sizeof(short) == 2
- && sizeof(int) == 4
- && sizeof(long int) == 8
- && sizeof(long long int) == 8
- && sizeof(void*) == 8) {
- (void)printf("Ok\n");
- } else {
- (void)printf("KO __LP64__\n");
- }
-#elif defined(__ILP32__)
- if (sizeof(short) == 2
- && sizeof(int) == 4
- && sizeof(long int) == 4
- && sizeof(void*) == 4) {
- (void)printf("Ok\n");
- } else {
- (void)printf("KO __ILP32__\n");
- }
-#else
- (void)printf("KO no __*LP*__ defined.\n");
-#endif
-}
+#include <stdio.h>
+
+int
+main()
+{
+#if defined(__LLP64__)
+ if (sizeof(short) == 2
+ && sizeof(int) == 4
+ && sizeof(long int) == 4
+ && sizeof(long long int) == 8
+ && sizeof(void*) == 8) {
+ (void)printf("Ok\n");
+ } else {
+ (void)printf("KO __LLP64__\n");
+ }
+#elif defined(__LP64__)
+ if (sizeof(short) == 2
+ && sizeof(int) == 4
+ && sizeof(long int) == 8
+ && sizeof(long long int) == 8
+ && sizeof(void*) == 8) {
+ (void)printf("Ok\n");
+ } else {
+ (void)printf("KO __LP64__\n");
+ }
+#elif defined(__ILP32__)
+ if (sizeof(short) == 2
+ && sizeof(int) == 4
+ && sizeof(long int) == 4
+ && sizeof(void*) == 4) {
+ (void)printf("Ok\n");
+ } else {
+ (void)printf("KO __ILP32__\n");
+ }
+#else
+ (void)printf("KO no __*LP*__ defined.\n");
+#endif
+}
diff --git a/tests/tests2/86-memory-model.expect b/tests/tests2/86_memory-model.expect
index a28de60..7326d96 100755..100644
--- a/tests/tests2/86-memory-model.expect
+++ b/tests/tests2/86_memory-model.expect
@@ -1 +1 @@
-Ok
+Ok
diff --git a/tests/tests2/82_nocode_wanted.c b/tests/tests2/89_nocode_wanted.c
index a0ec890..73e0a4b 100644
--- a/tests/tests2/82_nocode_wanted.c
+++ b/tests/tests2/89_nocode_wanted.c
@@ -3,7 +3,7 @@ static void kb_wait_1(void)
{
unsigned long timeout = 2;
do {
- (1 ?
+ (1 ?
printf("timeout=%ld\n", timeout) :
({
while (1)
@@ -17,7 +17,7 @@ static void kb_wait_2(void)
{
unsigned long timeout = 2;
do {
- (1 ?
+ (1 ?
printf("timeout=%ld\n", timeout) :
({
for (;;)
@@ -31,7 +31,7 @@ static void kb_wait_2_1(void)
{
unsigned long timeout = 2;
do {
- (1 ?
+ (1 ?
printf("timeout=%ld\n", timeout) :
({
do {
@@ -46,7 +46,7 @@ static void kb_wait_2_2(void)
{
unsigned long timeout = 2;
do {
- (1 ?
+ (1 ?
printf("timeout=%ld\n", timeout) :
({
label:
@@ -61,7 +61,7 @@ static void kb_wait_3(void)
{
unsigned long timeout = 2;
do {
- (1 ?
+ (1 ?
printf("timeout=%ld\n", timeout) :
({
int i = 1;
@@ -78,7 +78,7 @@ static void kb_wait_4(void)
{
unsigned long timeout = 2;
do {
- (1 ?
+ (1 ?
printf("timeout=%ld\n", timeout) :
({
switch(timeout) {
diff --git a/tests/tests2/82_nocode_wanted.expect b/tests/tests2/89_nocode_wanted.expect
index c44d4ea..c44d4ea 100644
--- a/tests/tests2/82_nocode_wanted.expect
+++ b/tests/tests2/89_nocode_wanted.expect
diff --git a/tests/tests2/86-struct-init.c b/tests/tests2/90_struct-init.c
index fd212ba..fd212ba 100644
--- a/tests/tests2/86-struct-init.c
+++ b/tests/tests2/90_struct-init.c
diff --git a/tests/tests2/86-struct-init.expect b/tests/tests2/90_struct-init.expect
index adda76d..adda76d 100644
--- a/tests/tests2/86-struct-init.expect
+++ b/tests/tests2/90_struct-init.expect
diff --git a/tests/tests2/87_ptr_longlong_arith32.c b/tests/tests2/91_ptr_longlong_arith32.c
index bf07915..bf07915 100644
--- a/tests/tests2/87_ptr_longlong_arith32.c
+++ b/tests/tests2/91_ptr_longlong_arith32.c
diff --git a/tests/tests2/87_ptr_longlong_arith32.expect b/tests/tests2/91_ptr_longlong_arith32.expect
index f91e4b4..f91e4b4 100644
--- a/tests/tests2/87_ptr_longlong_arith32.expect
+++ b/tests/tests2/91_ptr_longlong_arith32.expect