In this case the device code is not injected into an host action and therefore the
user should get an error as -o can't be used when generating two outputs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285263
91177308-0d34-0410-b5e6-
96231b3b80d8
// We avoid creating host action in device-only mode.
return CompileDeviceOnly ? ABRT_Ignore_Host : ABRT_Success;
+ } else if (CurPhase > phases::Backend) {
+ // If we are past the backend phase and still have a device action, we
+ // don't have to do anything as this action is already a device
+ // top-level action.
+ return ABRT_Success;
}
assert(CurPhase < phases::Backend && "Generating single CUDA "
-// Tests CUDA compilation with -S.
+// Tests CUDA compilation with -S and -emit-llvm.
// REQUIRES: clang-driver
// REQUIRES: x86-registered-target
// RUN: %clang -### -S -target x86_64-linux-gnu --cuda-device-only \
// RUN: --cuda-gpu-arch=sm_20 --cuda-gpu-arch=sm_30 -o foo.s %s 2>&1 \
// RUN: | FileCheck -check-prefix MULTIPLE-OUTPUT-FILES %s
+// RUN: %clang -### -emit-llvm -c -target x86_64-linux-gnu -o foo.s %s 2>&1 \
+// RUN: | FileCheck -check-prefix MULTIPLE-OUTPUT-FILES %s
// MULTIPLE-OUTPUT-FILES: error: cannot specify -o when generating multiple output files