Skip to content
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

[SYCL][Driver] allow for -g0 to override default setting with -fintel… #678

Merged
merged 1 commit into from
Sep 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion clang/lib/Driver/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,11 @@ DerivedArgList *Driver::TranslateInputArgs(const InputArgList &Args) const {
// Use of -fintelfpga implies -g and -MMD
if (Args.hasArg(options::OPT_fintelfpga)) {
DAL->AddFlagArg(0, Opts.getOption(options::OPT_MMD));
DAL->AddFlagArg(0, Opts.getOption(options::OPT_g_Flag));
// if any -gN option is provided, use that.
if (Arg *A = Args.getLastArg(options::OPT_gN_Group))
DAL->append(A);
else
DAL->AddFlagArg(0, Opts.getOption(options::OPT_g_Flag));
}

// Add a default value of -mlinker-version=, if one was given and the user
Expand Down
5 changes: 5 additions & 0 deletions clang/test/Driver/sycl-offload-intelfpga.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
// CHK-TOOLS-INTELFPGA: clang{{.*}} "-debug-info-kind=limited" {{.*}} "-dependency-file"
// CHK-TOOLS-INTELFPGA: aoc{{.*}} "-dep-files={{.*}}"

/// -fintelfpga implies -g but -g0 should override
// RUN: %clang++ -### -target x86_64-unknown-linux-gnu -g0 -fsycl -fintelfpga %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHK-TOOLS-INTELFPGA-G0 %s
// CHK-TOOLS-INTELFPGA-G0-NOT: clang{{.*}} "-debug-info-kind=limited"

/// -fintelfpga -fsycl-link tests
// RUN: touch %t.o
// RUN: %clang++ -### -target x86_64-unknown-linux-gnu -fsycl -fintelfpga -fsycl-link %t.o 2>&1 \
Expand Down