History

Adjust asm-c-connect testcase for Windows

Calling conventions are different, let's use functions without any arguments.

Michael Matz committed 8 years ago

Commit 3494e5d1 parent 4266ebd1 file · +12 −11Browse files

Unified · Split

tests/asm-c-connect-1.c+12−11
@@ -1,23 +1,24 @@
1#include <stdio.h>1#include <stdio.h>
2 2
3#if defined _WIN32 && !defined __TINYC__3#if defined _WIN32 && !defined __TINYC__
4# define U "_"4# define _ "_"
5#else5#else
6# define U6# define _
7#endif7#endif
8 8
9const char str[] = "x1\n";9static int x1_c(void)
10#ifdef __x86_64__10{
11asm(U"x1: push %rbp; mov $"U"str, %rdi; call "U"printf; pop %rbp; ret");11 printf("x1\n");
12#elif defined (__i386__)12 return 1;
13asm(U"x1: push $"U"str; call "U"printf; pop %eax; ret");13}
14#endif14
15asm(".text;"_"x1: call "_"x1_c; ret");
15 16
16int main(int argc, char *argv[])17int main(int argc, char *argv[])
17{18{
18 asm("call "U"x1");19 asm("call "_"x1");
19 asm("call "U"x2");20 asm("call "_"x2");
20 asm("call "U"x3");21 asm("call "_"x3");
21 return 0;22 return 0;
22}23}
23 24

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t