diff options
| author | Sterling Augustine <saugustine@google.com> | 2019-01-28 18:56:43 +0000 |
|---|---|---|
| committer | Sterling Augustine <saugustine@google.com> | 2019-01-28 18:56:43 +0000 |
| commit | 9490fcc1919e7e24bd411b1e72802c171881be55 (patch) | |
| tree | 99aaa1c043ae6f05e00ef95b7d31d4a033c66e8f /clang/test | |
| parent | 586d949b9c554d5e5b7b445a49c122ce3d0e5c53 (diff) | |
| download | bcm5719-llvm-9490fcc1919e7e24bd411b1e72802c171881be55.tar.gz bcm5719-llvm-9490fcc1919e7e24bd411b1e72802c171881be55.zip | |
Add --unwindlib=[libgcc|compiler-rt] to parallel --rtlib=
Summary:
"clang++ hello.cc --rtlib=compiler-rt"
now works without specifying additional unwind or exception
handling libraries.
Reviewers: rsmith
Subscribers: srhines, dberris, aheejin, llvm-commits
Differential Revision: https://reviews.llvm.org/D57128
llvm-svn: 352404
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Driver/compiler-rt-unwind.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/clang/test/Driver/compiler-rt-unwind.c b/clang/test/Driver/compiler-rt-unwind.c new file mode 100644 index 00000000000..9d881ea0e0a --- /dev/null +++ b/clang/test/Driver/compiler-rt-unwind.c @@ -0,0 +1,50 @@ +// 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 \ +// RUN: --gcc-toolchain="" \ +// RUN: | FileCheck --check-prefix=RTLIB-EMPTY %s +// RTLIB-EMPTY: "{{.*}}lgcc" +// RTLIB-EMPTY: "{{.*}}-lgcc_s" +// +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=x86_64-unknown-linux -rtlib=gcc \ +// 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=gcc --unwindlib=compiler-rt \ +// 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" +// RTLIB-COMPILER-RT: "{{.*}}-lunwind" +// +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=x86_64-unknown-linux -rtlib=compiler-rt --unwindlib=gcc \ +// 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=gcc \ +// 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=compiler-rt \ +// 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" |

