diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -2648,6 +2648,8 @@ if (memcmp(Value, "-", 2) == 0) { if (IsFlangMode()) { Ty = types::TY_Fortran; + } else if (IsDXCMode()) { + Ty = types::TY_HLSL; } else { // If running with -E, treat as a C input (this changes the // builtin macros, for example). This may be overridden by -ObjC diff --git a/clang/test/Driver/dxc_stdin.hlsl b/clang/test/Driver/dxc_stdin.hlsl new file mode 100644 --- /dev/null +++ b/clang/test/Driver/dxc_stdin.hlsl @@ -0,0 +1,3 @@ +// RUN: %clang_dxc -Tlib_6_7 - -### 2>&1 | FileCheck %s +// CHECK: "-cc1" +// CHECK-SAME: "-x" "hlsl" "-"