|
2 | 2 | // General tests that ld invocations on Linux targets sane. Note that we use
|
3 | 3 | // sysroot to make these tests independent of the host system.
|
4 | 4 | //
|
5 |
| -// RUN: %clang -### %s -no-pie 2>&1 \ |
| 5 | +// RUN: %clang -### -Werror %s -no-pie 2>&1 \ |
6 | 6 | // RUN: --target=i386-unknown-linux -rtlib=platform --unwindlib=platform \
|
7 | 7 | // RUN: --sysroot=%S/Inputs/basic_linux_tree \
|
8 | 8 | // RUN: | FileCheck --check-prefix=CHECK-LD-32 %s
|
9 |
| -// CHECK-LD-32-NOT: warning: |
10 | 9 | // CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
|
11 | 10 | // CHECK-LD-32: "{{.*}}/usr/lib/gcc/i386-unknown-linux/10.2.0{{/|\\\\}}crtbegin.o"
|
12 | 11 | // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/10.2.0"
|
13 | 12 | // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/10.2.0/../../../../i386-unknown-linux/lib"
|
14 | 13 | // CHECK-LD-32: "-L[[SYSROOT]]/lib"
|
15 | 14 | // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib"
|
16 | 15 | //
|
17 |
| -// RUN: %clang -### %s -no-pie 2>&1 \ |
| 16 | +// RUN: %clang -### %s -Werror -no-pie 2>&1 \ |
18 | 17 | // RUN: --target=x86_64-unknown-linux -rtlib=platform --unwindlib=platform \
|
19 | 18 | // RUN: --sysroot=%S/Inputs/basic_linux_tree \
|
20 | 19 | // RUN: | FileCheck --check-prefix=CHECK-LD-64 %s
|
21 |
| -// CHECK-LD-64-NOT: warning: |
22 | 20 | // CHECK-LD-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
|
23 | 21 | // CHECK-LD-64: "--eh-frame-hdr"
|
24 | 22 | // CHECK-LD-64: "-m" "elf_x86_64"
|
|
32 | 30 | // CHECK-LD-64: "-lc"
|
33 | 31 | // CHECK-LD-64: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
|
34 | 32 | //
|
35 |
| -// RUN: %clang -### %s -no-pie 2>&1 \ |
| 33 | +// RUN: %clang -### %s -Werror -no-pie 2>&1 \ |
36 | 34 | // RUN: --target=x86_64-unknown-linux-gnux32 -rtlib=platform --unwindlib=platform \
|
37 | 35 | // RUN: --sysroot=%S/Inputs/basic_linux_tree \
|
38 | 36 | // RUN: | FileCheck --check-prefix=CHECK-LD-X32 %s
|
39 |
| -// CHECK-LD-X32-NOT: warning: |
40 | 37 | // CHECK-LD-X32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
|
41 | 38 | // CHECK-LD-X32: "--eh-frame-hdr"
|
42 | 39 | // CHECK-LD-X32: "-m" "elf32_x86_64"
|
|
45 | 42 | // CHECK-LD-X32: "-lc"
|
46 | 43 | // CHECK-LD-X32: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
|
47 | 44 | //
|
48 |
| -// RUN: %clang -### %s -no-pie 2>&1 \ |
| 45 | +// RUN: %clang -### %s -Werror -no-pie 2>&1 \ |
49 | 46 | // RUN: --target=x86_64-unknown-linux \
|
50 | 47 | // RUN: -resource-dir=%S/Inputs/resource_dir \
|
51 | 48 | // RUN: --sysroot=%S/Inputs/basic_linux_tree \
|
52 | 49 | // RUN: --rtlib=compiler-rt \
|
53 | 50 | // RUN: | FileCheck --check-prefix=CHECK-LD-RT %s
|
54 |
| -// CHECK-LD-RT-NOT: warning: |
55 | 51 | // CHECK-LD-RT: "-resource-dir" "[[RESDIR:[^"]*]]"
|
56 | 52 | // CHECK-LD-RT: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
|
57 | 53 | // CHECK-LD-RT: "--eh-frame-hdr"
|
|
67 | 63 | // CHECK-LD-RT: libclang_rt.builtins.a"
|
68 | 64 | // CHECK-LD-RT: "[[RESDIR]]{{/|\\\\}}lib{{/|\\\\}}x86_64-unknown-linux{{/|\\\\}}clang_rt.crtend.o"
|
69 | 65 | //
|
70 |
| -// RUN: %clang -### %s -no-pie 2>&1 \ |
| 66 | +// RUN: %clang -### %s -Werror -no-pie 2>&1 \ |
71 | 67 | // RUN: --target=i686-unknown-linux \
|
72 | 68 | // RUN: -resource-dir=%S/Inputs/resource_dir \
|
73 | 69 | // RUN: --sysroot=%S/Inputs/basic_linux_tree \
|
74 | 70 | // RUN: --rtlib=compiler-rt \
|
75 | 71 | // RUN: | FileCheck --check-prefix=CHECK-LD-RT-I686 %s
|
76 |
| -// CHECK-LD-RT-I686-NOT: warning: |
77 | 72 | // CHECK-LD-RT-I686: "-resource-dir" "[[RESDIR:[^"]*]]"
|
78 | 73 | // CHECK-LD-RT-I686: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
|
79 | 74 | // CHECK-LD-RT-I686: "--eh-frame-hdr"
|
|
89 | 84 | // CHECK-LD-RT-I686: libclang_rt.builtins.a"
|
90 | 85 | // CHECK-LD-RT-I686: "[[RESDIR]]{{/|\\\\}}lib{{/|\\\\}}i686-unknown-linux{{/|\\\\}}clang_rt.crtend.o"
|
91 | 86 | //
|
92 |
| -// RUN: %clang -### %s -no-pie 2>&1 \ |
| 87 | +// RUN: %clang -### %s -Werror -no-pie 2>&1 \ |
93 | 88 | // RUN: --target=arm-linux-androideabi \
|
94 | 89 | // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
|
95 | 90 | // RUN: -resource-dir=%S/Inputs/resource_dir \
|
96 | 91 | // RUN: --rtlib=compiler-rt \
|
97 | 92 | // RUN: | FileCheck --check-prefix=CHECK-LD-RT-ANDROID %s
|
98 |
| -// CHECK-LD-RT-ANDROID-NOT: warning: |
99 | 93 | // CHECK-LD-RT-ANDROID: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
|
100 | 94 | // CHECK-LD-RT-ANDROID: "--eh-frame-hdr"
|
101 | 95 | // CHECK-LD-RT-ANDROID: "-m" "armelf_linux_eabi"
|
|
104 | 98 | // CHECK-LD-RT-ANDROID: "-lc"
|
105 | 99 | // CHECK-LD-RT-ANDROID: libclang_rt.builtins.a"
|
106 | 100 | //
|
107 |
| -// RUN: %clang -### %s -no-pie 2>&1 \ |
| 101 | +// RUN: %clang -### %s -Werror -no-pie 2>&1 \ |
108 | 102 | // RUN: --target=x86_64-unknown-linux -rtlib=platform --unwindlib=platform \
|
109 | 103 | // RUN: --sysroot=%S/Inputs/basic_linux_tree \
|
110 | 104 | // RUN: | FileCheck --check-prefix=CHECK-LD-GCC %s
|
111 |
| -// CHECK-LD-GCC-NOT: warning: |
112 | 105 | // CHECK-LD-GCC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
|
113 | 106 | // CHECK-LD-GCC: "--eh-frame-hdr"
|
114 | 107 | // CHECK-LD-GCC: "-m" "elf_x86_64"
|
|
122 | 115 | // CHECK-LD-GCC: "-lc"
|
123 | 116 | // CHECK-LD-GCC: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
|
124 | 117 | //
|
125 |
| -// RUN: %clang -### %s -no-pie 2>&1 \ |
| 118 | +// RUN: %clang -### %s -Werror -no-pie 2>&1 \ |
126 | 119 | // RUN: --target=x86_64-unknown-linux -rtlib=platform --unwindlib=platform \
|
127 | 120 | // RUN: -static-libgcc \
|
128 | 121 | // RUN: --sysroot=%S/Inputs/basic_linux_tree \
|
129 | 122 | // RUN: | FileCheck --check-prefix=CHECK-LD-64-STATIC-LIBGCC %s
|
130 |
| -// CHECK-LD-64-STATIC-LIBGCC-NOT: warning: |
131 | 123 | // CHECK-LD-64-STATIC-LIBGCC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
|
132 | 124 | // CHECK-LD-64-STATIC-LIBGCC: "--eh-frame-hdr"
|
133 | 125 | // CHECK-LD-64-STATIC-LIBGCC: "-m" "elf_x86_64"
|
|
268 | 260 | // CHECK-CLANG-ANDROID-STATIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
|
269 | 261 | // CHECK-CLANG-ANDROID-STATIC: "--start-group" "{{[^"]*}}{{/|\\\\}}libclang_rt.builtins.a" "-l:libunwind.a" "-lc" "--end-group"
|
270 | 262 | //
|
271 |
| -// RUN: %clang -### %s 2>&1 \ |
272 |
| -// RUN: --target=x86_64-unknown-linux -rtlib=platform --unwindlib=platform \ |
| 263 | +// RUN: %clang -### %s -Werror --target=x86_64-unknown-linux -rtlib=platform --unwindlib=platform \ |
273 | 264 | // RUN: -static \
|
274 |
| -// RUN: --sysroot=%S/Inputs/basic_linux_tree \ |
| 265 | +// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \ |
275 | 266 | // RUN: | FileCheck --check-prefix=CHECK-LD-64-STATIC %s
|
276 |
| -// CHECK-LD-64-STATIC-NOT: warning: |
277 | 267 | // CHECK-LD-64-STATIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
|
278 | 268 | // CHECK-LD-64-STATIC: "--eh-frame-hdr"
|
279 | 269 | // CHECK-LD-64-STATIC: "-m" "elf_x86_64"
|
|
486 | 476 | //
|
487 | 477 | // Test that we can use -stdlib=libc++ in a build system even when it
|
488 | 478 | // occasionally links C code instead of C++ code.
|
489 |
| -// RUN: %clang -x c -### %s -no-pie 2>&1 \ |
| 479 | +// RUN: %clang -x c -### %s -Werror -no-pie 2>&1 \ |
490 | 480 | // RUN: --target=x86_64-unknown-linux-gnu \
|
491 | 481 | // RUN: -stdlib=libc++ \
|
492 | 482 | // RUN: -ccc-install-dir %S/Inputs/basic_linux_libcxx_tree/usr/bin \
|
493 | 483 | // RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree \
|
494 | 484 | // RUN: | FileCheck --check-prefix=CHECK-BASIC-LIBCXX-C-LINK %s
|
495 |
| -// CHECK-BASIC-LIBCXX-C-LINK-NOT: warning: |
496 | 485 | // CHECK-BASIC-LIBCXX-C-LINK: "-cc1"
|
497 | 486 | // CHECK-BASIC-LIBCXX-C-LINK: "-isysroot" "[[SYSROOT:[^"]+]]"
|
498 | 487 | // CHECK-BASIC-LIBCXX-C-LINK-NOT: "-internal-isystem" "[[SYSROOT]]/usr/bin/../include/c++/v1"
|
|
1661 | 1650 | // CHECK-MUSL-AARCH64_BE: "-dynamic-linker" "/lib/ld-musl-aarch64_be.so.1"
|
1662 | 1651 |
|
1663 | 1652 | // Check whether multilib gcc install works fine on Gentoo with gcc-config
|
1664 |
| -// RUN: %clang -### %s -no-pie 2>&1 \ |
| 1653 | +// RUN: %clang -### %s -Werror -no-pie 2>&1 \ |
1665 | 1654 | // RUN: --target=x86_64-unknown-linux-gnu -rtlib=platform --unwindlib=platform \
|
1666 | 1655 | // RUN: --sysroot=%S/Inputs/gentoo_linux_gcc_multi_version_tree \
|
1667 | 1656 | // RUN: | FileCheck --check-prefix=CHECK-LD-GENTOO %s
|
1668 |
| -// CHECK-LD-GENTOO-NOT: warning: |
1669 | 1657 | // CHECK-LD-GENTOO: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
|
1670 | 1658 | // CHECK-LD-GENTOO: "--eh-frame-hdr"
|
1671 | 1659 | // CHECK-LD-GENTOO: "-m" "elf_x86_64"
|
|
1676 | 1664 | // CHECK-LD-GENTOO: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
|
1677 | 1665 | // CHECK-LD-GENTOO: "-lc"
|
1678 | 1666 | // CHECK-LD-GENTOO: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
|
1679 |
| -// RUN: %clang -### %s -no-pie 2>&1 \ |
| 1667 | +// RUN: %clang -### %s -Werror -no-pie 2>&1 \ |
1680 | 1668 | // RUN: --target=i686-unknown-linux-gnu -rtlib=platform --unwindlib=platform \
|
1681 | 1669 | // RUN: --sysroot=%S/Inputs/gentoo_linux_gcc_multi_version_tree \
|
1682 | 1670 | // RUN: | FileCheck --check-prefix=CHECK-LD-GENTOO-32 %s
|
1683 |
| -// CHECK-LD-GENTOO-32-NOT: warning: |
1684 | 1671 | // CHECK-LD-GENTOO-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
|
1685 | 1672 | // CHECK-LD-GENTOO-32: "--eh-frame-hdr"
|
1686 | 1673 | // CHECK-LD-GENTOO-32: "-m" "elf_i386"
|
|
1691 | 1678 | // CHECK-LD-GENTOO-32: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
|
1692 | 1679 | // CHECK-LD-GENTOO-32: "-lc"
|
1693 | 1680 | // CHECK-LD-GENTOO-32: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
|
1694 |
| -// RUN: %clang -### %s -no-pie 2>&1 \ |
| 1681 | +// RUN: %clang -### %s -Werror -no-pie 2>&1 \ |
1695 | 1682 | // RUN: --target=x86_64-unknown-linux-gnux32 -rtlib=platform --unwindlib=platform \
|
1696 | 1683 | // RUN: --sysroot=%S/Inputs/gentoo_linux_gcc_multi_version_tree \
|
1697 | 1684 | // RUN: | FileCheck --check-prefix=CHECK-LD-GENTOO-X32 %s
|
1698 |
| -// CHECK-LD-GENTOO-X32-NOT: warning: |
1699 | 1685 | // CHECK-LD-GENTOO-X32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
|
1700 | 1686 | // CHECK-LD-GENTOO-X32: "--eh-frame-hdr"
|
1701 | 1687 | // CHECK-LD-GENTOO-X32: "-m" "elf32_x86_64"
|
|
1717 | 1703 | // CHECK-LD-RHEL7-DTS: [[SYSROOT]]/usr/lib/gcc/x86_64-redhat-linux/7/../../../../bin/ld
|
1718 | 1704 |
|
1719 | 1705 | // Check whether gcc7 install works fine on Amazon Linux AMI
|
1720 |
| -// RUN: %clang -### %s -no-pie 2>&1 \ |
| 1706 | +// RUN: %clang -### %s -Werror -no-pie 2>&1 \ |
1721 | 1707 | // RUN: --target=x86_64-amazon-linux -rtlib=libgcc --unwindlib=platform \
|
1722 | 1708 | // RUN: --sysroot=%S/Inputs/ami_linux_tree \
|
1723 | 1709 | // RUN: | FileCheck --check-prefix=CHECK-LD-AMI %s
|
1724 |
| -// CHECK-LD-AMI-NOT: warning: |
1725 | 1710 | // CHECK-LD-AMI: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
|
1726 | 1711 | // CHECK-LD-AMI: "--eh-frame-hdr"
|
1727 | 1712 | // CHECK-LD-AMI: "-m" "elf_x86_64"
|
|
0 commit comments