[IAS] Teach -cc1as about the 'target-abi' option.
authorToma Tabacu <toma.tabacu@imgtec.com>
Wed, 4 Mar 2015 14:24:25 +0000 (14:24 +0000)
committerToma Tabacu <toma.tabacu@imgtec.com>
Wed, 4 Mar 2015 14:24:25 +0000 (14:24 +0000)
Summary:
When using the IAS from clang, the 'target-abi' option gets passed to cc1as, but cc1as doesn't know about it and gives an "unknown argument" error.

This is fixed by adding the 'CC1AsOption' flag to the 'target-abi' option in CC1Options.td.

Reviewers: atanasyan, echristo, dsanders

Reviewed By: dsanders

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D7903

llvm-svn: 231244

clang/include/clang/Driver/CC1Options.td
clang/test/Driver/target-abi-cc1as.s [new file with mode: 0644]

index f60fb4e..19b56f7 100644 (file)
@@ -25,11 +25,11 @@ def target_feature : Separate<["-"], "target-feature">,
   HelpText<"Target specific attributes">;
 def triple : Separate<["-"], "triple">,
   HelpText<"Specify target triple (e.g. i686-apple-darwin9)">;
+def target_abi : Separate<["-"], "target-abi">,
+  HelpText<"Target a particular ABI type">;
 
 }
 
-def target_abi : Separate<["-"], "target-abi">,
-  HelpText<"Target a particular ABI type">;
 def target_linker_version : Separate<["-"], "target-linker-version">,
   HelpText<"Target linker version">;
 def triple_EQ : Joined<["-"], "triple=">, Alias<triple>;
diff --git a/clang/test/Driver/target-abi-cc1as.s b/clang/test/Driver/target-abi-cc1as.s
new file mode 100644 (file)
index 0000000..86c9fc3
--- /dev/null
@@ -0,0 +1,5 @@
+// Check if -cc1as knows about the 'target-abi' argument.
+
+// RUN: %clang -cc1as -triple mips--linux-gnu -filetype obj -target-cpu mips32 -target-abi o32 %s 2>&1 | \
+// RUN:   FileCheck --check-prefix=ABI-O32 %s
+// ABI-O32-NOT: clang -cc1as: error: unknown argument: '-target-abi'