]> granicus.if.org Git - clang/commitdiff
Hexagon TC: forward appropriate args to assembler
authorMatthew Curtis <mcurtis@codeaurora.org>
Fri, 7 Dec 2012 17:23:04 +0000 (17:23 +0000)
committerMatthew Curtis <mcurtis@codeaurora.org>
Fri, 7 Dec 2012 17:23:04 +0000 (17:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169611 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp
test/Driver/hexagon-toolchain.c

index 13f859da5415d0fdfbd5efac01724b1c6bb67a69..634e0206eebfdca27b2eafc74c1cd645b8b69a57 100644 (file)
@@ -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
index 106eabca4eeed3ade10e71326ce11bf3dd313d3a..53c034d88859fcb074454d13d6031e0aec105fec 100644 (file)
 // 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"