aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2017-11-27 01:09:50 +0100
committerMichael Matz <matz@suse.de>2017-11-27 01:09:50 +0100
commit3494e5de3a03d021845666f55340d35af44e3bfc (patch)
tree90804310862226a0dfc7bda687d18d70c92a3650 /tests
parent4266ebd69c2c7d12abee1da1f6c2228232c6bc87 (diff)
downloadtinycc-3494e5de3a03d021845666f55340d35af44e3bfc.tar.gz
tinycc-3494e5de3a03d021845666f55340d35af44e3bfc.tar.bz2
Adjust asm-c-connect testcase for Windows
Calling conventions are different, let's use functions without any arguments.
Diffstat (limited to 'tests')
-rw-r--r--tests/asm-c-connect-1.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/tests/asm-c-connect-1.c b/tests/asm-c-connect-1.c
index 3f7b010..fbd240c 100644
--- a/tests/asm-c-connect-1.c
+++ b/tests/asm-c-connect-1.c
@@ -1,23 +1,24 @@
#include <stdio.h>
#if defined _WIN32 && !defined __TINYC__
-# define U "_"
+# define _ "_"
#else
-# define U
+# define _
#endif
-const char str[] = "x1\n";
-#ifdef __x86_64__
-asm(U"x1: push %rbp; mov $"U"str, %rdi; call "U"printf; pop %rbp; ret");
-#elif defined (__i386__)
-asm(U"x1: push $"U"str; call "U"printf; pop %eax; ret");
-#endif
+static int x1_c(void)
+{
+ printf("x1\n");
+ return 1;
+}
+
+asm(".text;"_"x1: call "_"x1_c; ret");
int main(int argc, char *argv[])
{
- asm("call "U"x1");
- asm("call "U"x2");
- asm("call "U"x3");
+ asm("call "_"x1");
+ asm("call "_"x2");
+ asm("call "_"x3");
return 0;
}