Esempio n. 1
0
main()
{
	printf("%d\n",
			cdecl(1, 2, 3, 4, 5, 6, 7, 8));

	printf("%d\n",
			stdcall(1, 2, 3, 4, 5, 6, 7, 8));

	printf("%d\n",
			fastcall(1, 2, 3, 4, 5, 6, 7, 8));

	// check names are correct
	__asm("call _cdecl");
	__asm("call _stdcall@32");
	__asm("call @fastcall@32");

	return 0;
}
Esempio n. 2
0
void __attribute__((fastcall(1))) baz(float *a) { // expected-error {{'fastcall' attribute takes no arguments}}
}

void __attribute__((fastcall)) test0() { // expected-error {{function with no prototype cannot use fastcall calling convention}}
}

void __attribute__((fastcall)) test1(void) {
}

void __attribute__((fastcall)) test2(int a, ...) { // expected-error {{variadic function cannot use fastcall calling convention}}
}

void __attribute__((cdecl)) ctest0() {}

void __attribute__((cdecl(1))) ctest1(float x) {} // expected-error {{'cdecl' attribute takes no arguments}}

void (__attribute__((fastcall)) *pfoo)(float*) = foo;

void (__attribute__((stdcall)) *pbar)(float*) = bar;

void (__attribute__((cdecl)) *ptest1)(void) = test1; // expected-warning {{incompatible pointer types}}

void (*pctest0)() = ctest0;

void ctest2() {}
void (__attribute__((cdecl)) *pctest2)() = ctest2;

typedef void (__attribute__((fastcall)) *Handler) (float *);
Handler H = foo;