41 lines · c
1// Note: %s must be preceded by --, otherwise it may be interpreted as a2// command-line option, e.g. on Mac where %s is commonly under /Users.3 4// RUN: %clang_cl --target=i686-windows-msvc /Gd -### -- %s 2>&1 | FileCheck --check-prefix=CDECL %s5// CDECL: -fdefault-calling-conv=cdecl6 7// RUN: %clang_cl --target=i686-windows-msvc /Gr -### -- %s 2>&1 | FileCheck --check-prefix=FASTCALL %s8// FASTCALL: -fdefault-calling-conv=fastcall9 10// RUN: %clang_cl --target=i686-windows-msvc /Gz -### -- %s 2>&1 | FileCheck --check-prefix=STDCALL %s11// STDCALL: -fdefault-calling-conv=stdcall12 13// RUN: %clang_cl --target=i686-windows-msvc /Gv -### -- %s 2>&1 | FileCheck --check-prefix=VECTORCALL %s14// VECTORCALL: -fdefault-calling-conv=vectorcall15 16// RUN: %clang_cl --target=i686-windows-msvc /Gregcall -### -- %s 2>&1 | FileCheck --check-prefix=REGCALL %s17// REGCALL: -fdefault-calling-conv=regcall18 19// RUN: %clang_cl --target=i686-windows-msvc /Gregcall /Gregcall4 -### -- %s 2>&1 | FileCheck --check-prefix=REGCALL4 %s20// REGCALL4: -fdefault-calling-conv=regcall21// REGCALL4: -regcall422 23// Last one should win:24 25// RUN: %clang_cl --target=i686-windows-msvc /Gd /Gv -### -- %s 2>&1 | FileCheck --check-prefix=LASTWINS_VECTOR %s26// LASTWINS_VECTOR: -fdefault-calling-conv=vectorcall27 28// RUN: %clang_cl --target=i686-windows-msvc /Gv /Gd -### -- %s 2>&1 | FileCheck --check-prefix=LASTWINS_CDECL %s29// LASTWINS_CDECL: -fdefault-calling-conv=cdecl30 31// No fastcall or stdcall on x86_64:32 33// RUN: %clang_cl -Wno-msvc-not-found --target=x86_64-windows-msvc /Gr -### -- %s 2>&1 | FileCheck --check-prefix=UNAVAILABLE %s34// RUN: %clang_cl -Wno-msvc-not-found --target=x86_64-windows-msvc /Gz -### -- %s 2>&1 | FileCheck --check-prefix=UNAVAILABLE %s35// RUN: %clang_cl -Wno-msvc-not-found --target=thumbv7-windows-msvc /Gv -### -- %s 2>&1 | FileCheck --check-prefix=UNAVAILABLE %s36 37// UNAVAILABLE-NOT: error:38// UNAVAILABLE-NOT: warning:39// UNAVAILABLE-NOT: -fdefault-calling-conv=40 41