diff options
Diffstat (limited to 'test/Driver/compiler-rt-unwind.c')
-rw-r--r-- | test/Driver/compiler-rt-unwind.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/Driver/compiler-rt-unwind.c b/test/Driver/compiler-rt-unwind.c new file mode 100644 index 0000000000..0ec067cbfc --- /dev/null +++ b/test/Driver/compiler-rt-unwind.c @@ -0,0 +1,42 @@ +// General tests that the driver handles combinations of --rtlib=XXX and +// --unwindlib=XXX properly. +// +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=x86_64-unknown-linux -rtlib=libgcc \ +// RUN: --gcc-toolchain="" \ +// RUN: | FileCheck --check-prefix=RTLIB-GCC %s +// RTLIB-GCC: "{{.*}}lgcc" +// RTLIB-GCC: "{{.*}}lgcc_s" +// +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=x86_64-unknown-linux -rtlib=libgcc --unwindlib=libunwind \ +// RUN: --gcc-toolchain="" \ +// RUN: | FileCheck --check-prefix=RTLIB-GCC-UNWINDLIB-COMPILER-RT %s +// RTLIB-GCC-UNWINDLIB-COMPILER-RT: "{{.*}}lgcc" +// RTLIB-GCC-UNWINDLIB-COMPILER-RT: "{{.*}}lunwind" +// +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=x86_64-unknown-linux -rtlib=compiler-rt \ +// RUN: --gcc-toolchain="" \ +// RUN: | FileCheck --check-prefix=RTLIB-COMPILER-RT %s +// RTLIB-COMPILER-RT: "{{.*}}libclang_rt.builtins-x86_64.a" +// +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=x86_64-unknown-linux -rtlib=compiler-rt --unwindlib=libgcc \ +// RUN: --gcc-toolchain="" \ +// RUN: | FileCheck --check-prefix=RTLIB-COMPILER-RT-UNWINDLIB-GCC %s +// RTLIB-COMPILER-RT-UNWINDLIB-GCC: "{{.*}}libclang_rt.builtins-x86_64.a" +// RTLIB-COMPILER-RT-UNWINDLIB-GCC: "{{.*}}lgcc_s" +// +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=x86_64-unknown-linux -rtlib=compiler-rt --unwindlib=libgcc \ +// RUN: -static --gcc-toolchain="" \ +// RUN: | FileCheck --check-prefix=RTLIB-COMPILER-RT-UNWINDLIB-GCC-STATIC %s +// RTLIB-COMPILER-RT-UNWINDLIB-GCC-STATIC: "{{.*}}libclang_rt.builtins-x86_64.a" +// RTLIB-COMPILER-RT-UNWINDLIB-GCC-STATIC: "{{.*}}lgcc_eh" +// +// RUN: not %clang -no-canonical-prefixes %s -o %t.o 2> %t.err \ +// RUN: --target=x86_64-unknown-linux -rtlib=libgcc --unwindlib=libunwind \ +// RUN: --gcc-toolchain="" \ +// RUN: FileCheck --input-file=%t.err --check-prefix=RTLIB-GCC-UNWINDLIB-COMPILER_RT %s +// RTLIB-GCC-UNWINDLIB-COMPILER_RT: "{{[.|\\\n]*}}--rtlib=libgcc requires --unwindlib=libgcc" |