r247351 - Handle '-r' option properly

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 10 15:31:45 PDT 2015


Author: rnk
Date: Thu Sep 10 17:31:45 2015
New Revision: 247351

URL: http://llvm.org/viewvc/llvm-project?rev=247351&view=rev
Log:
Handle '-r' option properly

Summary:
This fixs the bug
https://llvm.org/bugs/show_bug.cgi?id=12587

Patch by Yunlian Jiang

Reviewers: Bigcheese, rnk

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

Modified:
    cfe/trunk/include/clang/Driver/Options.td
    cfe/trunk/test/Driver/Xlinker-args.c

Modified: cfe/trunk/include/clang/Driver/Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=247351&r1=247350&r2=247351&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Options.td (original)
+++ cfe/trunk/include/clang/Driver/Options.td Thu Sep 10 17:31:45 2015
@@ -1609,7 +1609,7 @@ def resource_dir_EQ : Joined<["-"], "res
   Alias<resource_dir>;
 def rpath : Separate<["-"], "rpath">, Flags<[LinkerInput]>;
 def rtlib_EQ : Joined<["-", "--"], "rtlib=">;
-def r : Flag<["-"], "r">;
+def r : Flag<["-"], "r">, Flags<[LinkerInput,NoArgumentUnused]>;
 def save_temps_EQ : Joined<["-", "--"], "save-temps=">, Flags<[DriverOption]>,
   HelpText<"Save intermediate compilation results.">;
 def save_temps : Flag<["-", "--"], "save-temps">, Flags<[DriverOption]>,

Modified: cfe/trunk/test/Driver/Xlinker-args.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Xlinker-args.c?rev=247351&r1=247350&r2=247351&view=diff
==============================================================================
--- cfe/trunk/test/Driver/Xlinker-args.c (original)
+++ cfe/trunk/test/Driver/Xlinker-args.c Thu Sep 10 17:31:45 2015
@@ -3,17 +3,17 @@
 
 // RUN: %clang -target i386-apple-darwin9 -### \
 // RUN:   -Xlinker one -Xlinker --no-demangle \
-// RUN:   -Wl,two,--no-demangle,three -Xlinker four -z five %s 2> %t
+// RUN:   -Wl,two,--no-demangle,three -Xlinker four -z five -r %s 2> %t
 // RUN: FileCheck -check-prefix=DARWIN < %t %s
 //
 // RUN: %clang -target x86_64-pc-linux-gnu -### \
 // RUN:   -Xlinker one -Xlinker --no-demangle \
-// RUN:   -Wl,two,--no-demangle,three -Xlinker four -z five %s 2> %t
+// RUN:   -Wl,two,--no-demangle,three -Xlinker four -z five -r %s 2> %t
 // RUN: FileCheck -check-prefix=LINUX < %t %s
 //
 // DARWIN-NOT: --no-demangle
-// DARWIN: "one" "two" "three" "four" "-z" "five"
-// LINUX: "--no-demangle" "one" "two" "three" "four" "-z" "five"
+// DARWIN: "one" "two" "three" "four" "-z" "five" "-r"
+// LINUX: "--no-demangle" "one" "two" "three" "four" "-z" "five" "-r"
 
 // Check that we forward '-Xlinker' and '-Wl,' on Windows.
 // RUN: %clang -target i686-pc-win32 -### \




More information about the cfe-commits mailing list