aboutsummaryrefslogtreecommitdiff
path: root/tests/tcctest.c
diff options
context:
space:
mode:
authorgrischka <grischka>2016-12-18 22:05:42 +0100
committergrischka <grischka>2016-12-18 22:05:42 +0100
commita1c12b9fb9bd2452a90d3cf504574b3605c09702 (patch)
tree3166ee219d1463f5ed5bfc00aada753502fbe706 /tests/tcctest.c
parentf7fc4f02cf15e061b98b2224332b1739c69ef9db (diff)
downloadtinycc-a1c12b9fb9bd2452a90d3cf504574b3605c09702.tar.gz
tinycc-a1c12b9fb9bd2452a90d3cf504574b3605c09702.tar.bz2
tests: add memory leak test
Also ... tcctest.c: - exclude stuff that gcc doesn't compile on windows. libtcc.c/tccpp.c: - use unsigned for memory sizes to avoid printf format warnings - use "file:line: message" to make IDE error parsers happy. tccgen.c: fix typo
Diffstat (limited to 'tests/tcctest.c')
-rw-r--r--tests/tcctest.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/tcctest.c b/tests/tcctest.c
index 0f71482..2789255 100644
--- a/tests/tcctest.c
+++ b/tests/tcctest.c
@@ -3122,6 +3122,7 @@ void other_constraints_test(void)
printf ("oc1: %d\n", ret == (unsigned long)&var);
}
+#ifndef _WIN32
/* Test global asm blocks playing with aliases. */
void base_func(void)
{
@@ -3161,6 +3162,7 @@ char * get_asm_string (void)
char * str = ((char*)bug_table) + bug_table[1];
return str;
}
+#endif
unsigned int set;
@@ -3301,12 +3303,15 @@ void asm_test(void)
printf("set=0x%x\n", set);
val = 0x01020304;
printf("swab32(0x%08x) = 0x%0x\n", val, swab32(val));
+#ifndef _WIN32
override_func1();
override_func2();
/* The base_func ref from the following inline asm should find
the global one, not the local decl from this function. */
asm volatile(".weak override_func3\n.set override_func3, base_func");
override_func3();
+ printf("asmstr: %s\n", get_asm_string());
+#endif
/* Check that we can also load structs of appropriate layout
into registers. */
asm volatile("" : "=r" (asmret) : "0"(s2));
@@ -3319,7 +3324,6 @@ void asm_test(void)
if (!somebool)
printf("asmbool: failed\n");
#endif
- printf("asmstr: %s\n", get_asm_string());
val = 43;
fancy_copy (&val, &val2);
printf ("fancycpy(%d)=%d\n", val, val2);
@@ -3677,10 +3681,12 @@ typedef struct gate_struct64 gate_desc;
gate_desc a_gate_desc;
void attrib_test(void)
{
+#ifndef _WIN32
printf("attr: %d %d %d %d\n", sizeof(struct Spacked),
sizeof(spacked), sizeof(Spacked2), sizeof(spacked2));
printf("attr: %d %d\n", sizeof(Spacked3), sizeof(spacked3));
printf("attr: %d %d\n", sizeof(gate_desc), sizeof(a_gate_desc));
+#endif
}
extern __attribute__((__unused__)) char * __attribute__((__unused__)) *
strange_attrib_placement (void);