summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Curtis <mcurtis@codeaurora.org>2012-12-07 17:23:04 +0000
committerMatthew Curtis <mcurtis@codeaurora.org>2012-12-07 17:23:04 +0000
commit3d8d4223813506df2f1b71cbb2f4a175faf85e6a (patch)
treee167218e9a2c2682bd18eb48cf4ac030095585b3
parent2a907f8735cee8ae145ffded6d8dfb1e8cf29b28 (diff)
downloadclang-3d8d4223813506df2f1b71cbb2f4a175faf85e6a.tar.gz
clang-3d8d4223813506df2f1b71cbb2f4a175faf85e6a.tar.bz2
clang-3d8d4223813506df2f1b71cbb2f4a175faf85e6a.tar.xz
Hexagon TC: forward appropriate args to assembler
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169611 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Driver/Tools.cpp4
-rw-r--r--test/Driver/hexagon-toolchain.c15
2 files changed, 19 insertions, 0 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 13f859da54..634e0206ee 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -3506,6 +3506,10 @@ void hexagon::Assemble::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back(
Args.MakeArgString(std::string("-G") + SmallDataThreshold));
+ Args.AddAllArgs(CmdArgs, options::OPT_g_Group);
+ Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA,
+ options::OPT_Xassembler);
+
// Only pass -x if gcc will understand it; otherwise hope gcc
// understands the suffix correctly. The main use case this would go
// wrong in is for linker inputs if they happened to have an odd
diff --git a/test/Driver/hexagon-toolchain.c b/test/Driver/hexagon-toolchain.c
index 106eabca4e..53c034d888 100644
--- a/test/Driver/hexagon-toolchain.c
+++ b/test/Driver/hexagon-toolchain.c
@@ -531,3 +531,18 @@
// CHECK028: "-Wreturn-type"
// CHECK028-NEXT: "{{.*}}/bin/hexagon-as"
// CHECK028-NEXT: "{{.*}}/bin/hexagon-ld"
+
+// -----------------------------------------------------------------------------
+// Test Assembler related args
+// -----------------------------------------------------------------------------
+// RUN: %clang -### -target hexagon-unknown-linux \
+// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: -gdwarf-2 \
+// RUN: -Wa,--noexecstack,--trap \
+// RUN: -Xassembler --keep-locals \
+// RUN: %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK029 %s
+// CHECK029: "{{.*}}clang{{.*}}" "-cc1"
+// CHECK029-NEXT: "{{.*}}/bin/hexagon-as"
+// CHECK029: "-gdwarf-2" "--noexecstack" "--trap" "--keep-locals"
+// CHECK029-NEXT: "{{.*}}/bin/hexagon-ld"