brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 0ce0888 Raw
39 lines · c
1// RUN: %clang_cc1 -DMRTD -mrtd -triple i386-unknown-unknown -verify %s2// RUN: %clang_cc1 -triple i386-unknown-unknown -verify %s3 4#ifndef MRTD5// expected-note@+5 {{previous declaration is here}}6// expected-error@+5 {{function declared 'stdcall' here was previously declared without calling convention}}7// expected-note@+5 {{previous declaration is here}}8// expected-error@+5 {{function declared 'stdcall' here was previously declared without calling convention}}9#endif10void nonvariadic1(int a, int b, int c);11void __attribute__((stdcall)) nonvariadic1(int a, int b, int c);12void nonvariadic2(int a, int b, int c);13void __attribute__((stdcall)) nonvariadic2(int a, int b, int c) { }14 15// expected-warning@+2 {{stdcall calling convention is not supported on variadic function}}16void variadic(int a, ...);17void __attribute__((stdcall)) variadic(int a, ...);18 19#ifdef MRTD20// expected-note@+3 {{previous declaration is here}}21// expected-error@+3 {{redeclaration of 'a' with a different type: 'void ((*))(int, int) __attribute__((cdecl))' vs 'void (*)(int, int) __attribute__((stdcall))'}}22#endif23extern void (*a)(int, int);24__attribute__((cdecl)) extern void (*a)(int, int);25 26extern void (*b)(int, ...);27__attribute__((cdecl)) extern void (*b)(int, ...);28 29#ifndef MRTD30// expected-note@+3 {{previous declaration is here}}31// expected-error@+3 {{redeclaration of 'c' with a different type: 'void ((*))(int, int) __attribute__((stdcall))' vs 'void (*)(int, int)'}}32#endif33extern void (*c)(int, int);34__attribute__((stdcall)) extern void (*c)(int, int);35 36// expected-warning@+2 {{stdcall calling convention is not supported on variadic function}}37extern void (*d)(int, ...);38__attribute__((stdcall)) extern void (*d)(int, ...);39