• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Test that the coverage guards have proper comdat
2; RUN: opt < %s -sancov                    -sanitizer-coverage-level=3 -sanitizer-coverage-trace-pc-guard  -S  | FileCheck %s
3; Make sure asan does not instrument __sancov_gen_
4; RUN: opt < %s -sancov -asan -asan-module -sanitizer-coverage-level=3 -sanitizer-coverage-trace-pc-guard  -S  | FileCheck %s
5target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
6target triple = "x86_64-unknown-linux-gnu"
7$Foo = comdat any
8; Function Attrs: uwtable
9define linkonce_odr void @Foo() comdat {
10entry:
11  ret void
12}
13
14define linkonce_odr void @Bar() {
15entry:
16  ret void
17}
18
19; CHECK: @__sancov_gen_ = private global [1 x i32] zeroinitializer, section "__sancov_guards", comdat($Foo)
20; CHECK: @__sancov_gen_.1 = private global [1 x i32] zeroinitializer, section "__sancov_guards"
21