Skip to content

Commit

Permalink
[ASan] Added a unit test for D118184.
Browse files Browse the repository at this point in the history
To make sure the the libraries are there for executable and not there for DSOs.

Reviewed By: kda

Differential Revision: https://reviews.llvm.org/D118205
  • Loading branch information
kstoimenov committed Jan 26, 2022
1 parent ba79295 commit 69da422
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions clang/test/Driver/sanitizer-ld.c
Expand Up @@ -24,6 +24,24 @@
//
// CHECK-ASAN-NO-LINK-RUNTIME-LINUX-NOT: libclang_rt.asan-x86_64

// RUN: %clang -fsanitize=address %s -### -o %t.o 2>&1 \
// RUN: -target x86_64-unknown-linux -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-ASAN-EXECUTABLE-LINUX %s
//
// CHECK-ASAN-EXECUTABLE-LINUX: libclang_rt.asan_static-x86_64
// CHECK-ASAN-EXECUTABLE-LINUX: libclang_rt.asan-x86_64

// RUN: %clang -fsanitize=address -shared %s -### -o %t.o 2>&1 \
// RUN: -target x86_64-unknown-linux -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-ASAN-SHARED-LINUX %s
//
// CHECK-ASAN-SHARED-LINUX-NOT: libclang_rt.asan_static-x86_64
// CHECK-ASAN-SHARED-LINUX-NOT: libclang_rt.asan-x86_64

// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -target i386-unknown-linux -fuse-ld=ld -fsanitize=address -shared-libsan \
// RUN: -resource-dir=%S/Inputs/resource_dir \
Expand Down

0 comments on commit 69da422

Please sign in to comment.