From c86b5c3e538c82622709e63d168e6147cb22aaea Mon Sep 17 00:00:00 2001 From: Evgeniy Stepanov Date: Mon, 15 May 2017 20:43:48 +0000 Subject: [PATCH] [asan] One more test for -fsanitize-address-globals-dead-stripping. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303114 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/asan-no-globals-no-comdat.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 test/CodeGen/asan-no-globals-no-comdat.cpp diff --git a/test/CodeGen/asan-no-globals-no-comdat.cpp b/test/CodeGen/asan-no-globals-no-comdat.cpp new file mode 100644 index 0000000000..4637346f9c --- /dev/null +++ b/test/CodeGen/asan-no-globals-no-comdat.cpp @@ -0,0 +1,11 @@ +// Test that on Linux asan constructor is placed in a comdat iff globals-gc is on. +// Even if there are no globals in the module. + +// RUN: %clang_cc1 -fsanitize=address -fsanitize-address-globals-dead-stripping -emit-llvm -o - -triple x86_64-linux %s | FileCheck %s --check-prefix=WITHOUT-GC +// RUN: %clang_cc1 -fsanitize=address -fsanitize-address-globals-dead-stripping -fdata-sections -emit-llvm -o - -triple x86_64-linux %s | FileCheck %s --check-prefix=WITH-GC +// RUN: %clang_cc1 -fsanitize=address -fsanitize-address-globals-dead-stripping -fno-integrated-as -fdata-sections -emit-llvm -o - -triple x86_64-linux %s | FileCheck %s --check-prefix=WITHOUT-GC +// RUN: %clang_cc1 -fsanitize=address -fsanitize-address-globals-dead-stripping -fno-integrated-as -emit-llvm -o - -triple x86_64-linux %s | FileCheck %s --check-prefix=WITHOUT-GC +// RUN: %clang_cc1 -fsanitize=address -fdata-sections -emit-llvm -o - -triple x86_64-linux %s | FileCheck %s --check-prefix=WITHOUT-GC + +// WITH-GC: define internal void @asan.module_ctor() comdat { +// WITHOUT-GC: define internal void @asan.module_ctor() { -- 2.40.0