1 ; Test that interposable symbols do not get put in comdats.
2 ; RUN: opt < %s -passes='module(sancov-module)' -sanitizer-coverage-level=3 -sanitizer-coverage-trace-pc-guard -mtriple x86_64-linux-gnu -S | FileCheck %s --check-prefixes=CHECK,ELF
3 ; RUN: opt < %s -passes='module(sancov-module)' -sanitizer-coverage-level=3 -sanitizer-coverage-trace-pc-guard -mtriple x86_64-windows-msvc -S | FileCheck %s --check-prefixes=CHECK,COFF
5 define void @Vanilla() {
10 define linkonce void @LinkOnce() {
15 define weak void @Weak() {
20 declare extern_weak void @ExternWeak()
22 define linkonce_odr void @LinkOnceOdr() {
27 define weak_odr void @WeakOdr() {
32 ; CHECK: $Vanilla = comdat nodeduplicate
33 ; ELF: $LinkOnceOdr = comdat nodeduplicate
34 ; COFF: $LinkOnceOdr = comdat any
35 ; CHECK: @__sancov_gen_ = private global [1 x i32] zeroinitializer, section {{.*}}, comdat($Vanilla), align 4{{$}}
36 ; CHECK-NEXT: @__sancov_gen_.1 = private global [1 x i32] zeroinitializer, section {{.*}}, align 4{{$}}
37 ; CHECK-NEXT: @__sancov_gen_.2 = private global [1 x i32] zeroinitializer, section {{.*}}, align 4{{$}}
38 ; CHECK-NEXT: @__sancov_gen_.3 = private global [1 x i32] zeroinitializer, section {{.*}}, comdat($LinkOnceOdr), align 4{{$}}
39 ; CHECK-NEXT: @__sancov_gen_.4 = private global [1 x i32] zeroinitializer, section {{.*}}, comdat($WeakOdr), align 4{{$}}
41 ; CHECK: define void @Vanilla() comdat {
42 ; ELF: define linkonce void @LinkOnce() comdat {
43 ; ELF: define weak void @Weak() comdat {
44 ; COFF: define linkonce void @LinkOnce() {
45 ; COFF: define weak void @Weak() {
46 ; CHECK: declare extern_weak void @ExternWeak()
47 ; CHECK: define linkonce_odr void @LinkOnceOdr() comdat {
48 ; CHECK: define weak_odr void @WeakOdr() comdat {