28 lines · plain
1// Verify that we don't pass unwanted options to device-side compilation when2// clang-cl is used for CUDA compilation.3// Note: %s must be preceded by --, otherwise it may be interpreted as a4// command-line option, e.g. on Mac where %s is commonly under /Users.5 6// -stack-protector should not be passed to device-side CUDA compilation7// RUN: not %clang_cl -### -nocudalib -nocudainc -- %s 2>&1 | FileCheck -check-prefix=GS-default %s8// GS-default: "-cc1" "-triple" "nvptx{{(64)?}}-nvidia-cuda"9// GS-default-NOT: "-stack-protector"10// GS-default: "-cc1" "-triple"11// GS-default: "-stack-protector" "2"12 13// -exceptions should be passed to device-side compilation.14// RUN: not %clang_cl /c /GX -### -nocudalib -nocudainc -- %s 2>&1 | FileCheck -check-prefix=GX %s15// GX: "-cc1" "-triple" "nvptx{{(64)?}}-nvidia-cuda"16// GX-NOT: "-fcxx-exceptions"17// GX-NOT: "-fexceptions"18// GX: "-cc1" "-triple"19// GX: "-fcxx-exceptions" "-fexceptions"20 21// /Gd should not override default calling convention on device side.22// RUN: not %clang_cl /c /Gd -### -nocudalib -nocudainc -- %s 2>&1 | FileCheck -check-prefix=Gd %s23// Gd: "-cc1" "-triple" "nvptx{{(64)?}}-nvidia-cuda"24// Gd-NOT: "-fcxx-exceptions"25// Gd-NOT: "-fdefault-calling-conv=cdecl"26// Gd: "-cc1" "-triple"27// Gd: "-fdefault-calling-conv=cdecl"28