[clang] [SYCL] Error on C inputs when compiling with -fsycl (PR #200318)

Michael Toguchi via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 8 09:10:29 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'
----------------
mdtoguchi wrote:

Is this test necessary?  It's not exercising anything in the driver and there is an FE specific test that covers.

https://github.com/llvm/llvm-project/pull/200318


More information about the cfe-commits mailing list