[clang] [SYCL] Error on C inputs when compiling with -fsycl (PR #200318)
Srividya Sundaram via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 8 09:21:45 PDT 2026
================
@@ -30,3 +30,7 @@
// RUN: %clangxx -### -fsycl -sycl-std=2017 --no-offloadlib -- %s 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OFFLOADLIB
// RUN: %clang_cl -### -fsycl -sycl-std=2017 --no-offloadlib -- %s 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OFFLOADLIB
// CHECK-NO-OFFLOADLIB-NOT: warning: unknown argument ignored in clang-cl: '--no-offloadlib'
+
+// Verify that -fsycl with a C input is an error (enforced in the frontend).
+// RUN: not %clang -fsycl -x c %s 2>&1 | FileCheck %s --check-prefix=CHECK-C-INPUT
+// CHECK-C-INPUT: error: invalid argument 'C' not allowed with '-fsycl'
----------------
srividya-sundaram wrote:
I'd like to keep this test since it validates the full driver → frontend path, confirming that invoking `clang -fsycl -x c` also rejects C inputs, not just direct cc1 invocations. It's a lightweight sanity check for the end-to-end behavior
https://github.com/llvm/llvm-project/pull/200318
More information about the cfe-commits
mailing list