Skip to content

Commit 59b7b5b

Browse files
author
Erich Keane
committed
Add driver test, fix it the way Mike suggested
1 parent 9e186cf commit 59b7b5b

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5962,9 +5962,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
59625962
if (Args.hasFlag(options::OPT_fsycl, options::OPT_fno_sycl, false))
59635963
Args.AddLastArg(CmdArgs, options::OPT_sycl_std_EQ);
59645964

5965-
// Forward -fsycl-default-sub-group-size if in SYCL mode.
5966-
if (Args.hasFlag(options::OPT_fsycl, options::OPT_fno_sycl, false))
5967-
Args.AddLastArg(CmdArgs, options::OPT_fsycl_default_sub_group_size);
59685965

59695966
// Forward -fsycl-instrument-device-code option to cc1. This option can only
59705967
// be used with spir triple.
@@ -6682,6 +6679,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
66826679
HeaderOpt.append(Header);
66836680
CmdArgs.push_back(Args.MakeArgString(HeaderOpt));
66846681
}
6682+
6683+
// Forward -fsycl-default-sub-group-size if in SYCL mode.
6684+
Args.AddLastArg(CmdArgs, options::OPT_fsycl_default_sub_group_size);
66856685
}
66866686

66876687
if (Args.hasArg(options::OPT_fsycl_unnamed_lambda))
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// RUN: %clang -### -fsycl %s 2>&1 | FileCheck %s -check-prefix=CHECK-DEFAULT
2+
// CHECK-DEFAULT-NOT: "fsycl-default-sub-group-size"
3+
4+
// RUN: %clang -### -fsycl -fsycl-default-sub-group-size=primary %s 2>&1 | FileCheck %s -check-prefix=PRIM
5+
// PRIM: "-fsycl-default-sub-group-size" "primary"
6+
7+
// RUN: %clang -### -fsycl -fsycl-default-sub-group-size=10 %s 2>&1 | FileCheck %s -check-prefix=TEN
8+
// TEN: "-fsycl-default-sub-group-size" "10"

0 commit comments

Comments
 (0)