• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Test for a call to __asan_init in _start
2
3; REQUIRES: allow_dump
4
5; RUN: %p2i -i %s --args -verbose=inst -threads=0 -fsanitize-address \
6; RUN:     | FileCheck --check-prefix=DUMP %s
7
8; notStart() should not be instrumented
9define internal void @notStart() {
10  ret void
11}
12
13; DUMP-LABEL: ================ Instrumented CFG ================
14; DUMP-NEXT: define internal void @notStart() {
15; DUMP-NEXT: __0:
16; DUMP-NOT: __asan_init()
17; DUMP: ret void
18; DUMP-NEXT: }
19
20; _start() should be instrumented
21define void @_start() {
22  ret void
23}
24
25; DUMP-LABEL: ================ Instrumented CFG ================
26; DUMP-NEXT: define void @_start() {
27; DUMP-NEXT: __0:
28; DUMP-NEXT: call void @__asan_init(i32 0, i32 @__$rz_array, i32 @__$rz_sizes)
29; DUMP-NEXT: ret void
30; DUMP-NEXT: }
31