Skip to content

Commit f58ec88

Browse files
committed
Update logic for --offload-compress check
Update the logic for the --offload-compress recognition on the command line and update tests to check the proper behavior with -fsycl-link.
1 parent d127c2d commit f58ec88

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10027,7 +10027,8 @@ void OffloadWrapper::ConstructJob(Compilation &C, const JobAction &JA,
1002710027
// and enabling preview breaking changes.
1002810028
auto addCLIOptions = [&](ArgStringList &Args) -> void {
1002910029
// -offload-compress
10030-
if (C.getInputArgs().getLastArg(options::OPT_offload_compress)) {
10030+
if (C.getInputArgs().hasFlag(options::OPT_offload_compress,
10031+
options::OPT_no_offload_compress, false)) {
1003110032
Args.push_back(C.getArgs().MakeArgString(Twine("-offload-compress")));
1003210033
// -offload-compression-level=<>
1003310034
if (Arg *A = C.getInputArgs().getLastArg(

clang/test/Driver/sycl-offload-wrapper-compression.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
///
55

66
// RUN: %clangxx -### -fsycl --offload-compress --offload-compression-level=3 %s 2>&1 | FileCheck %s --check-prefix=CHECK-COMPRESS
7+
// RUN: %clangxx -### -fsycl -fsycl-link --offload-compress --offload-compression-level=3 %s 2>&1 | FileCheck %s --check-prefix=CHECK-COMPRESS
78
// CHECK-COMPRESS: {{.*}}clang-offload-wrapper{{.*}}"-offload-compress"{{.*}}"-offload-compression-level=3"{{.*}}
89

910
// Make sure that the compression options are not passed when --offload-compress is not set.

0 commit comments

Comments
 (0)