blob: 76f116e199e28a2e03ebe3019518a39c17f2a427 [file] [log] [blame]
Reid Kleckner4b2f3262017-05-31 15:39:28 +00001// Note: %s must be preceded by --, otherwise it may be interpreted as a
2// 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 %s
Reid Kleckner6344f102017-05-31 15:50:35 +00005// CDECL: -fdefault-calling-conv=cdecl
Reid Kleckner4b2f3262017-05-31 15:39:28 +00006
7// RUN: %clang_cl --target=i686-windows-msvc /Gr -### -- %s 2>&1 | FileCheck --check-prefix=FASTCALL %s
Reid Kleckner6344f102017-05-31 15:50:35 +00008// FASTCALL: -fdefault-calling-conv=fastcall
Reid Kleckner4b2f3262017-05-31 15:39:28 +00009
10// RUN: %clang_cl --target=i686-windows-msvc /Gz -### -- %s 2>&1 | FileCheck --check-prefix=STDCALL %s
Reid Kleckner6344f102017-05-31 15:50:35 +000011// STDCALL: -fdefault-calling-conv=stdcall
Reid Kleckner4b2f3262017-05-31 15:39:28 +000012
13// RUN: %clang_cl --target=i686-windows-msvc /Gv -### -- %s 2>&1 | FileCheck --check-prefix=VECTORCALL %s
Reid Kleckner6344f102017-05-31 15:50:35 +000014// VECTORCALL: -fdefault-calling-conv=vectorcall
Reid Kleckner4b2f3262017-05-31 15:39:28 +000015
16// Last one should win:
17
18// RUN: %clang_cl --target=i686-windows-msvc /Gd /Gv -### -- %s 2>&1 | FileCheck --check-prefix=LASTWINS_VECTOR %s
Reid Kleckner6344f102017-05-31 15:50:35 +000019// LASTWINS_VECTOR: -fdefault-calling-conv=vectorcall
Reid Kleckner4b2f3262017-05-31 15:39:28 +000020
21// RUN: %clang_cl --target=i686-windows-msvc /Gv /Gd -### -- %s 2>&1 | FileCheck --check-prefix=LASTWINS_CDECL %s
Reid Kleckner6344f102017-05-31 15:50:35 +000022// LASTWINS_CDECL: -fdefault-calling-conv=cdecl
Reid Kleckner4b2f3262017-05-31 15:39:28 +000023
24// No fastcall or stdcall on x86_64:
25
Reid Kleckner6344f102017-05-31 15:50:35 +000026// RUN: %clang_cl -Wno-msvc-not-found --target=x86_64-windows-msvc /Gr -### -- %s 2>&1 | FileCheck --check-prefix=UNSUPPORTED %s
27// RUN: %clang_cl -Wno-msvc-not-found --target=x86_64-windows-msvc /Gz -### -- %s 2>&1 | FileCheck --check-prefix=UNSUPPORTED %s
28// RUN: %clang_cl -Wno-msvc-not-found --target=thumbv7-windows-msvc /Gv -### -- %s 2>&1 | FileCheck --check-prefix=UNSUPPORTED %s
Reid Kleckner4b2f3262017-05-31 15:39:28 +000029
30// UNSUPPORTED-NOT: error:
31// UNSUPPORTED-NOT: warning:
Reid Kleckner6344f102017-05-31 15:50:35 +000032// UNSUPPORTED-NOT: -fdefault-calling-conv=
Reid Kleckner4b2f3262017-05-31 15:39:28 +000033