Skip to content

Commit 702c279

Browse files
authored
[NFC][Driver] Change SYCL test file extension .c -> .cpp (#20977)
SYCL is an API built on top of C++ programming language. Building SYCL program with C compiler is not possible. The content of clang/test/Driver/sycl-offload-old-model.c test has been added to existing clang/test/Driver/sycl-offload-old-model.cpp test. The same applies to clang/test/Driver/sycl-offload.c. Moved a check for a warning about using .c file extenion for SYCL to a separate test - clang/test/Driver/sycl-c-warn.c.
1 parent c921a48 commit 702c279

19 files changed

+1559
-1530
lines changed
File renamed without changes.
File renamed without changes.

clang/test/Driver/sycl-c-warn.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Emit warning for treating 'c' input as 'c++' when -fsycl is used
2+
// RUN: %clang -### -fsycl %s 2>&1 | FileCheck -check-prefix FSYCL-CHECK %s
3+
// RUN: %clang_cl -### -fsycl %s 2>&1 | FileCheck -check-prefix FSYCL-CHECK %s
4+
// RUN: %clang -### -fsycl --offload-new-driver %s 2>&1 | FileCheck -check-prefix FSYCL-CHECK %s
5+
// RUN: %clang_cl -### -fsycl --offload-new-driver %s 2>&1 | FileCheck -check-prefix FSYCL-CHECK %s
6+
// RUN: %clang -### -fsycl --no-offload-new-driver %s 2>&1 | FileCheck -check-prefix FSYCL-CHECK %s
7+
// RUN: %clang_cl -### -fsycl --no-offload-new-driver %s 2>&1 | FileCheck -check-prefix FSYCL-CHECK %s
8+
// FSYCL-CHECK: warning: treating 'c' input as 'c++' when -fsycl is used [-Wexpected-file-type]
9+
File renamed without changes.
File renamed without changes.

clang/test/Driver/sycl-offload-old-model.c

Lines changed: 0 additions & 921 deletions
This file was deleted.

clang/test/Driver/sycl-offload-old-model.cpp

Lines changed: 916 additions & 0 deletions
Large diffs are not rendered by default.

clang/test/Driver/sycl-offload-win-old-model.c renamed to clang/test/Driver/sycl-offload-win-old-model.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
/// Test behaviors of using a static library with single object.
88
// Build the offload library that is used for the tests.
9-
// RUN: echo "void foo() {}" > %t.c
10-
// RUN: %clang_cl --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -c -Fo%t-orig.obj %t.c
9+
// RUN: echo "void foo() {}" > %t.cpp
10+
// RUN: %clang_cl --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -c -Fo%t-orig.obj %t.cpp
1111
// RUN: llvm-ar cr %t-orig.lib %t-orig.obj
1212
// RUN: %clang --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib %t-orig.lib %t-orig.obj -### 2>&1 \
1313
// RUN: | FileCheck %s -check-prefix=FOFFLOAD_STATIC_LIB
@@ -85,7 +85,7 @@
8585
// RUN: %clang_cl --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib %t-orig.lib -ccc-print-phases %s 2>&1 \
8686
// RUN: | FileCheck %s -check-prefix=FOFFLOAD_STATIC_LIB_SRC
8787
// FOFFLOAD_STATIC_LIB_SRC: 0: input, "[[INPUTLIB:.+\.lib]]", object, (host-sycl)
88-
// FOFFLOAD_STATIC_LIB_SRC: 1: input, "[[INPUTC:.+\.c]]", c++, (host-sycl)
88+
// FOFFLOAD_STATIC_LIB_SRC: 1: input, "[[INPUTC:.+\.cpp]]", c++, (host-sycl)
8989
// FOFFLOAD_STATIC_LIB_SRC: 2: preprocessor, {1}, c++-cpp-output, (host-sycl)
9090
// FOFFLOAD_STATIC_LIB_SRC: 3: input, "[[INPUTC]]", c++, (device-sycl)
9191
// FOFFLOAD_STATIC_LIB_SRC: 4: preprocessor, {3}, c++-cpp-output, (device-sycl)

0 commit comments

Comments
 (0)