summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/ubsan/TestCases/Misc/unreachable_asan-compatibility.c
blob: 473e32b872ea3adffb18f8f64c3e3a3cfcbd84b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Ensure compatiblity of UBSan unreachable with ASan in the presence of
// noreturn functions
// RUN: %clang -O2 -fsanitize=address,unreachable %s -emit-llvm -S -o - | FileCheck %s
// REQUIRES: ubsan-asan

void bar(void) __attribute__((noreturn));

void foo() {
  bar();
}
// CHECK-LABEL: define void @foo()
// CHECK:       call void @__asan_handle_no_return
// CHECK-NEXT:  call void @bar
// CHECK-NEXT:  call void @__asan_handle_no_return
// CHECK-NEXT:  call void @__ubsan_handle_builtin_unreachable
// CHECK-NEXT:  unreachable
OpenPOWER on IntegriCloud