[lld] r192470 - [ELF] Add alias options for start-group/end-group options.
Shankar Easwaran
shankare at codeaurora.org
Fri Oct 11 10:59:47 PDT 2013
Author: shankare
Date: Fri Oct 11 12:59:47 2013
New Revision: 192470
URL: http://llvm.org/viewvc/llvm-project?rev=192470&view=rev
Log:
[ELF] Add alias options for start-group/end-group options.
There are aliases for --start-group/--end-group options represented
by -( and -) respectively in the command line.
This change adds and improves the test for the alias options to be
tested.
Looks like users use this option widely than explicitly using
--start-group/--end-group.
Modified:
lld/trunk/lib/Driver/GnuLdOptions.td
lld/trunk/test/elf/X86_64/startGroupEndGroup.test
Modified: lld/trunk/lib/Driver/GnuLdOptions.td
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/GnuLdOptions.td?rev=192470&r1=192469&r2=192470&view=diff
==============================================================================
--- lld/trunk/lib/Driver/GnuLdOptions.td (original)
+++ lld/trunk/lib/Driver/GnuLdOptions.td Fri Oct 11 12:59:47 2013
@@ -158,9 +158,13 @@ defm u : smDash<"u", "undefined",
def start_group : Flag<["--"], "start-group">,
HelpText<"Start a group">,
Group<grp_resolveropt>;
+def alias_start_group: Flag<["-"], "(">,
+ Alias<start_group>;
def end_group : Flag<["--"], "end-group">,
HelpText<"End a group">,
Group<grp_resolveropt>;
+def alias_end_group: Flag<["-"], ")">,
+ Alias<end_group>;
def as_needed : Flag<["--"], "as-needed">,
HelpText<"This option affects ELF DT_NEEDED tags for "
"dynamic libraries mentioned on the command line">,
Modified: lld/trunk/test/elf/X86_64/startGroupEndGroup.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/X86_64/startGroupEndGroup.test?rev=192470&r1=192469&r2=192470&view=diff
==============================================================================
--- lld/trunk/test/elf/X86_64/startGroupEndGroup.test (original)
+++ lld/trunk/test/elf/X86_64/startGroupEndGroup.test Fri Oct 11 12:59:47 2013
@@ -17,8 +17,25 @@ RUN: %p/Inputs/group/fn1.o --end-group -
RUN: lld -flavor gnu -target x86_64 %p/Inputs/group/1.o --start-group \
RUN: --whole-archive %p/Inputs/group/libfn.a --no-whole-archive %p/Inputs/group/libfn1.a --end-group -o %t3
+# Test alias options too, as they are more widely used
+# Test group
+RUN: lld -flavor gnu -target x86_64 %p/Inputs/group/1.o -\( \
+RUN: %p/Inputs/group/libfn.a %p/Inputs/group/libfn1.a -\) -o %t1.alias
+
+# Mix object files in group
+RUN: lld -flavor gnu -target x86_64 %p/Inputs/group/1.o -\( \
+RUN: %p/Inputs/group/fn.o %p/Inputs/group/fn2.o \
+RUN: %p/Inputs/group/fn1.o -\) -o %t2.alias
+
+# Mix Whole archive input, the group should not iterate the file libfn.a
+RUN: lld -flavor gnu -target x86_64 %p/Inputs/group/1.o -\( \
+RUN: --whole-archive %p/Inputs/group/libfn.a --no-whole-archive %p/Inputs/group/libfn1.a -\) -o %t3.alias
+
RUN: llvm-nm %t1 | FileCheck -check-prefix=RESOLVEDEXTERNAL %s
RUN: llvm-nm %t2 | FileCheck -check-prefix=RESOLVEDEXTERNAL %s
RUN: llvm-nm %t3 | FileCheck -check-prefix=RESOLVEDEXTERNAL %s
+RUN: llvm-nm %t1.alias | FileCheck -check-prefix=RESOLVEDEXTERNAL %s
+RUN: llvm-nm %t2.alias | FileCheck -check-prefix=RESOLVEDEXTERNAL %s
+RUN: llvm-nm %t3.alias | FileCheck -check-prefix=RESOLVEDEXTERNAL %s
RESOLVEDEXTERNAL: {{[0-9a-z]+}} T fn2
More information about the llvm-commits
mailing list