-
Notifications
You must be signed in to change notification settings - Fork 798
[Driver][SYCL] Update preprocessed file generation #19849
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
61793b3
f5064bd
7fdacc4
23b7e9f
fc4489b
bbc7b1b
d57edf4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
/// Test preprocessing capabilities when using -fsycl | ||
// Test the behaviors when enabling SYCL offloading with preprocessed files. | ||
|
||
/// Creating a preprocessed file is expected to do an integration header | ||
/// creation step. | ||
// RUN: %clangxx -fsycl --offload-new-driver -E -o %t_output.ii %s -### 2>&1 \ | ||
// RUN: | FileCheck -check-prefix PREPROC_ONLY %s | ||
// RUN: %clang_cl -fsycl --offload-new-driver -P -Fi%t_output.ii %s -### 2>&1 \ | ||
// RUN: %clang_cl -fsycl --offload-new-driver -P %s -### 2>&1 \ | ||
// RUN: | FileCheck -check-prefix PREPROC_ONLY %s | ||
// PREPROC_ONLY: clang{{.*}} "-fsycl-is-device"{{.*}} "-fsycl-int-header=[[INTHEADER:.+\.h]]" "-fsycl-int-footer=[[INTFOOTER:.+\.h]]"{{.*}} "-E" | ||
// PREPROC_ONLY: clang{{.*}} "-fsycl-is-host"{{.*}} "-include-internal-header" "[[INTHEADER]]"{{.*}} "-include-internal-footer" "[[INTFOOTER]]"{{.*}} "-o" "[[HOST_OUT:.+\.ii]]" | ||
|
@@ -14,10 +15,31 @@ | |
// PREPROC_IN-NOT: "-fsycl-int-header={{.*}}" | ||
// PREPROC_IN: clang{{.*}} "-fsycl-is-host" | ||
|
||
// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl --offload-new-driver -E %s -ccc-print-phases 2>&1 \ | ||
// RUN: | FileCheck -check-prefix PREPROC_PHASES %s | ||
/// When generating preprocessed files, verify the compilation phases. | ||
// RUN: %clangxx --target=x86_64-unknown-linux-gnu --offload-new-driver -fsycl -E %s -o %t.ii -ccc-print-phases 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefix PREPROC_PHASES -DTARGET=x86_64-unknown-linux-gnu | ||
// RUN: %clang_cl --target=x86_64-pc-windows-msvc --offload-new-driver -fsycl -P %s -Fi%t.ii -ccc-print-phases 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefix PREPROC_PHASES -DTARGET=x86_64-pc-windows-msvc | ||
// PREPROC_PHASES: 0: input, "[[INPUT:.+\.cpp]]", c++, (host-sycl) | ||
// PREPROC_PHASES: 1: preprocessor, {0}, c++-cpp-output, (host-sycl) | ||
// PREPROC_PHASES: 2: input, "[[INPUT]]", c++, (device-sycl) | ||
// PREPROC_PHASES: 3: preprocessor, {2}, c++-cpp-output, (device-sycl) | ||
// PREPROC_PHASES: 4: offload, "host-sycl (x86_64-unknown-linux-gnu)" {1}, "device-sycl (spir64-unknown-unknown)" {3}, c++-cpp-output | ||
// PREPROC_PHASES: 4: compiler, {3}, none, (device-sycl) | ||
// PREPROC_PHASES: 5: offload, "device-sycl (spir64-unknown-unknown)" {3}, c++-cpp-output | ||
// PREPROC_PHASES: 6: clang-offload-packager, {5, 1}, c++-cpp-output | ||
// PREPROC_PHASES: 7: offload, "host-sycl ([[TARGET]])" {1}, "device-sycl (spir64-unknown-unknown)" {3}, "device-sycl (spir64-unknown-unknown)" {4}, " ([[TARGET]])" {6}, c++-cpp-output | ||
|
||
/// When generating preprocessed files, verify the tools called and the expected | ||
/// output file name. | ||
// RUN: %clangxx --offload-new-driver -fsycl -E %s -o sycl-preprocess.ii -### 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefix PREPROC_TOOLS | ||
// RUN: %clang_cl --offload-new-driver -fsycl -P %s -Fisycl-preprocess.ii -### 2>&1 \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this some special file format - There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's an MSVC compatible way of designating the output file from the preprocessing step. (from the MSVC help output) |
||
// RUN: | FileCheck %s -check-prefix PREPROC_TOOLS | ||
// RUN: %clang_cl --offload-new-driver -fsycl -E %s -o sycl-preprocess.ii -### 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefix PREPROC_TOOLS | ||
// PREPROC_TOOLS: clang{{.*}} "-fsycl-is-device" | ||
// PREPROC_TOOLS-SAME: "-o" "[[DEVICE_PP_FILE:.+\.ii]] | ||
// PREPROC_TOOLS: clang{{.*}} "-fsycl-is-host" | ||
// PREPROC_TOOLS-SAME: "-o" "[[HOST_PP_FILE:.+\.ii]] | ||
// PREPROC_TOOLS: clang-offload-packager{{.*}} "-o" "sycl-preprocess.ii" | ||
// PREPROC_TOOLS-SAME: "--image=file=[[DEVICE_PP_FILE]],triple=spir64-unknown-unknown,arch=generic,kind=sycl{{.*}}" "--image=file=[[HOST_PP_FILE]],triple={{.*}},arch=generic,kind=host" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we passing
-P
here?-P
description reads:Disable linemarker output in -E mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use of
-P
enables preprocessing information. It's just another way of covering enabling preprocessing only with theclang-cl
driver.