aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/ubsan-check-debuglocs.cpp
blob: 96a697aca5eb1b1e16bf2c21329e8633932d3d9e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited \
// RUN:   -fsanitize=null %s -o - | FileCheck %s

// Check that santizer check calls have a !dbg location.
// CHECK: define {{.*}}acquire{{.*}} !dbg
// CHECK-NOT: define
// CHECK: call void {{.*}}@__ubsan_handle_type_mismatch_v1
// CHECK-SAME: !dbg

struct SourceLocation {
  SourceLocation acquire() {};
};
extern "C" void __ubsan_handle_type_mismatch_v1(SourceLocation *Loc);
static void handleTypeMismatchImpl(SourceLocation *Loc) { Loc->acquire(); }
void __ubsan_handle_type_mismatch_v1(SourceLocation *Loc) {
  handleTypeMismatchImpl(Loc);
}