diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2013-03-04 01:27:49 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2013-03-04 01:27:49 +0000 |
commit | 0074d38bee15c25d3f91d4f16f223ed0dca3f33f (patch) | |
tree | 75665e835fd4c3e213a1d07d6d99f567b921b3aa /test/Driver/linux-ld.c | |
parent | d0d6f64aeef3acc41b1df622fd225bbabc9e9a01 (diff) |
Beef up the testing of our 'ld' invocation on linux to cover static
linking. About to fix a bug here and there was no good test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176427 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Driver/linux-ld.c')
-rw-r--r-- | test/Driver/linux-ld.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/test/Driver/linux-ld.c b/test/Driver/linux-ld.c index 06be358860..e798942de8 100644 --- a/test/Driver/linux-ld.c +++ b/test/Driver/linux-ld.c @@ -18,12 +18,55 @@ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-LD-64 %s // CHECK-LD-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-LD-64: "--eh-frame-hdr" +// CHECK-LD-64: "-m" "elf_x86_64" +// CHECK-LD-64: "-dynamic-linker" // CHECK-LD-64: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/crtbegin.o" // CHECK-LD-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0" // CHECK-LD-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib" // CHECK-LD-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.." // CHECK-LD-64: "-L[[SYSROOT]]/lib" // CHECK-LD-64: "-L[[SYSROOT]]/usr/lib" +// CHECK-LD-64: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" +// CHECK-LD-64: "-lc" +// CHECK-LD-64: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" +// +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: -target x86_64-unknown-linux \ +// RUN: -static-libgcc \ +// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +// RUN: | FileCheck --check-prefix=CHECK-LD-64-STATIC-LIBGCC %s +// CHECK-LD-64-STATIC-LIBGCC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-LD-64-STATIC-LIBGCC: "--eh-frame-hdr" +// CHECK-LD-64-STATIC-LIBGCC: "-m" "elf_x86_64" +// CHECK-LD-64-STATIC-LIBGCC: "-dynamic-linker" +// CHECK-LD-64-STATIC-LIBGCC: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/crtbegin.o" +// CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0" +// CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib" +// CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.." +// CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/lib" +// CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/usr/lib" +// CHECK-LD-64-STATIC-LIBGCC: "-lgcc" "-lgcc_eh" +// CHECK-LD-64-STATIC-LIBGCC: "-lc" +// CHECK-LD-64-STATIC-LIBGCC: "-lgcc" "-lgcc_eh" +// +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: -target x86_64-unknown-linux \ +// RUN: -static \ +// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +// RUN: | FileCheck --check-prefix=CHECK-LD-64-STATIC %s +// CHECK-LD-64-STATIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-LD-64-STATIC-NOT: "--eh-frame-hdr" +// CHECK-LD-64-STATIC: "-m" "elf_x86_64" +// CHECK-LD-64-STATIC-NOT: "-dynamic-linker" +// CHECK-LD-64-STATIC: "-static" +// CHECK-LD-64-STATIC: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/crtbeginT.o" +// CHECK-LD-64-STATIC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0" +// CHECK-LD-64-STATIC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib" +// CHECK-LD-64-STATIC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.." +// CHECK-LD-64-STATIC: "-L[[SYSROOT]]/lib" +// CHECK-LD-64-STATIC: "-L[[SYSROOT]]/usr/lib" +// CHECK-LD-64-STATIC: "--start-group" "-lgcc" "-lgcc_eh" "-lc" "--end-group" // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ // RUN: -target i386-unknown-linux -m32 \ |