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 @@
11 #include <stdio.h>
22
33 #if defined _WIN32 && !defined __TINYC__
4−# define U "_"
4+# define _ "_"
55 #else
6−# define U
6+# define _
77 #endif
88
9−const char str[] = "x1\n";
10−#ifdef __x86_64__
11−asm(U"x1: push %rbp; mov $"U"str, %rdi; call "U"printf; pop %rbp; ret");
12−#elif defined (__i386__)
13−asm(U"x1: push $"U"str; call "U"printf; pop %eax; ret");
14−#endif
9+static int x1_c(void)
10+{
11+ printf("x1\n");
12+ return 1;
13+}
14+
15+asm(".text;"_"x1: call "_"x1_c; ret");
1516
1617 int main(int argc, char *argv[])
1718 {
18− asm("call "U"x1");
19− asm("call "U"x2");
20− asm("call "U"x3");
19+ asm("call "_"x1");
20+ asm("call "_"x2");
21+ asm("call "_"x3");
2122 return 0;
2223 }
2324

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