1 // General tests that the driver handles combinations of --rtlib=XXX and 2 // --unwindlib=XXX properly. 3 // 4 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 5 // RUN: --target=x86_64-unknown-linux -rtlib=libgcc \ 6 // RUN: --gcc-toolchain="" \ 7 // RUN: | FileCheck --check-prefix=RTLIB-GCC %s 8 // RTLIB-GCC: "{{.*}}lgcc" 9 // RTLIB-GCC: "{{.*}}lgcc_s" 10 // 11 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 12 // RUN: --target=x86_64-unknown-linux -rtlib=libgcc --unwindlib=libunwind \ 13 // RUN: --gcc-toolchain="" \ 14 // RUN: | FileCheck --check-prefix=RTLIB-GCC-UNWINDLIB-COMPILER-RT %s 15 // RTLIB-GCC-UNWINDLIB-COMPILER-RT: "{{.*}}lgcc" 16 // RTLIB-GCC-UNWINDLIB-COMPILER-RT: "{{.*}}l:libunwind.so" 17 // 18 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 19 // RUN: --target=x86_64-unknown-linux -rtlib=libgcc --unwindlib=libunwind \ 20 // RUN: -static-libgcc \ 21 // RUN: --gcc-toolchain="" \ 22 // RUN: | FileCheck --check-prefix=RTLIB-GCC-STATIC-UNWINDLIB-COMPILER-RT %s 23 // RTLIB-GCC-STATIC-UNWINDLIB-COMPILER-RT: "{{.*}}lgcc" 24 // RTLIB-GCC-STATIC-UNWINDLIB-COMPILER-RT: "{{.*}}l:libunwind.a" 25 // 26 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 27 // RUN: --target=x86_64-unknown-linux -rtlib=compiler-rt \ 28 // RUN: --gcc-toolchain="" \ 29 // RUN: | FileCheck --check-prefix=RTLIB-COMPILER-RT %s 30 // RTLIB-COMPILER-RT: "{{.*}}libclang_rt.builtins-x86_64.a" 31 // 32 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 33 // RUN: --target=x86_64-unknown-linux -rtlib=compiler-rt --unwindlib=libgcc \ 34 // RUN: --gcc-toolchain="" \ 35 // RUN: | FileCheck --check-prefix=RTLIB-COMPILER-RT-UNWINDLIB-GCC %s 36 // RTLIB-COMPILER-RT-UNWINDLIB-GCC: "{{.*}}libclang_rt.builtins-x86_64.a" 37 // RTLIB-COMPILER-RT-UNWINDLIB-GCC: "{{.*}}lgcc_s" 38 // 39 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 40 // RUN: --target=x86_64-unknown-linux -rtlib=compiler-rt --unwindlib=libgcc \ 41 // RUN: -static --gcc-toolchain="" \ 42 // RUN: | FileCheck --check-prefix=RTLIB-COMPILER-RT-UNWINDLIB-GCC-STATIC %s 43 // RTLIB-COMPILER-RT-UNWINDLIB-GCC-STATIC: "{{.*}}libclang_rt.builtins-x86_64.a" 44 // RTLIB-COMPILER-RT-UNWINDLIB-GCC-STATIC: "{{.*}}lgcc_eh" 45 // 46 // RUN: not %clang -no-canonical-prefixes %s -o %t.o 2> %t.err \ 47 // RUN: --target=x86_64-unknown-linux -rtlib=libgcc --unwindlib=libunwind \ 48 // RUN: --gcc-toolchain="" \ 49 // RUN: FileCheck --input-file=%t.err --check-prefix=RTLIB-GCC-UNWINDLIB-COMPILER_RT %s 50 // RTLIB-GCC-UNWINDLIB-COMPILER_RT: "{{[.|\\\n]*}}--rtlib=libgcc requires --unwindlib=libgcc" 51 // 52 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 53 // RUN: --target=x86_64-w64-mingw32 -rtlib=compiler-rt --unwindlib=libunwind \ 54 // RUN: -shared-libgcc \ 55 // RUN: --gcc-toolchain="" \ 56 // RUN: | FileCheck --check-prefix=MINGW-RTLIB-COMPILER-RT-SHARED-UNWINDLIB-COMPILER-RT %s 57 // MINGW-RTLIB-COMPILER-RT-SHARED-UNWINDLIB-COMPILER-RT: "{{.*}}libclang_rt.builtins-x86_64.a" 58 // MINGW-RTLIB-COMPILER-RT-SHARED-UNWINDLIB-COMPILER-RT: "{{.*}}l:libunwind.dll.a" 59 // 60 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 61 // RUN: --target=x86_64-w64-mingw32 -rtlib=compiler-rt --unwindlib=libunwind \ 62 // RUN: -static-libgcc \ 63 // RUN: --gcc-toolchain="" \ 64 // RUN: | FileCheck --check-prefix=MINGW-RTLIB-COMPILER-RT-STATIC-UNWINDLIB-COMPILER-RT %s 65 // MINGW-RTLIB-COMPILER-RT-STATIC-UNWINDLIB-COMPILER-RT: "{{.*}}libclang_rt.builtins-x86_64.a" 66 // MINGW-RTLIB-COMPILER-RT-STATIC-UNWINDLIB-COMPILER-RT: "{{.*}}l:libunwind.a" 67 // 68 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 69 // RUN: --target=x86_64-w64-mingw32 -rtlib=compiler-rt --unwindlib=libunwind \ 70 // RUN: --gcc-toolchain="" \ 71 // RUN: | FileCheck --check-prefix=MINGW-RTLIB-COMPILER-RT-UNWINDLIB-COMPILER-RT %s 72 // MINGW-RTLIB-COMPILER-RT-UNWINDLIB-COMPILER-RT: "{{.*}}libclang_rt.builtins-x86_64.a" 73 // MINGW-RTLIB-COMPILER-RT-UNWINDLIB-COMPILER-RT: "{{.*}}lunwind" 74