annotate llvm/test/Instrumentation/AddressSanitizer/debug_info_noninstrumented_alloca.ll @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 ; This test checks that non-instrumented allocas stay in the first basic block.
anatofuz
parents:
diff changeset
2 ; Only first-basic-block allocas are considered stack slots, and moving them
anatofuz
parents:
diff changeset
3 ; breaks debug info.
anatofuz
parents:
diff changeset
4
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
5 ; RUN: opt < %s -asan -asan-module -enable-new-pm=0 -S | FileCheck %s
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
6 ; RUN: opt < %s -passes='asan-pipeline' -S | FileCheck %s
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
7 ; RUN: opt < %s -asan -asan-module -enable-new-pm=0 -asan-instrument-dynamic-allocas -S | FileCheck %s
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
8 ; RUN: opt < %s -passes='asan-pipeline' -asan-instrument-dynamic-allocas -S | FileCheck %s
150
anatofuz
parents:
diff changeset
9
anatofuz
parents:
diff changeset
10 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
anatofuz
parents:
diff changeset
11 target triple = "x86_64-apple-macosx10.10.0"
anatofuz
parents:
diff changeset
12
anatofuz
parents:
diff changeset
13 define i32 @foo() sanitize_address {
anatofuz
parents:
diff changeset
14 entry:
anatofuz
parents:
diff changeset
15 ; Won't be instrumented because of asan-skip-promotable-allocas.
anatofuz
parents:
diff changeset
16 %non_instrumented1 = alloca i32, align 4
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 ; Regular alloca, will get instrumented (forced by the ptrtoint below).
anatofuz
parents:
diff changeset
19 %instrumented = alloca i32, align 4
anatofuz
parents:
diff changeset
20
anatofuz
parents:
diff changeset
21 ; Won't be instrumented because of asan-skip-promotable-allocas.
anatofuz
parents:
diff changeset
22 %non_instrumented2 = alloca i32, align 4
anatofuz
parents:
diff changeset
23
anatofuz
parents:
diff changeset
24 br label %bb0
anatofuz
parents:
diff changeset
25
anatofuz
parents:
diff changeset
26 bb0:
anatofuz
parents:
diff changeset
27 ; Won't be instrumented because of asan-skip-promotable-allocas.
anatofuz
parents:
diff changeset
28 %non_instrumented3 = alloca i32, align 4
anatofuz
parents:
diff changeset
29
anatofuz
parents:
diff changeset
30 %ptr = ptrtoint i32* %instrumented to i32
anatofuz
parents:
diff changeset
31 br label %bb1
anatofuz
parents:
diff changeset
32
anatofuz
parents:
diff changeset
33 bb1:
anatofuz
parents:
diff changeset
34 ret i32 %ptr
anatofuz
parents:
diff changeset
35 }
anatofuz
parents:
diff changeset
36
anatofuz
parents:
diff changeset
37 ; CHECK: entry:
anatofuz
parents:
diff changeset
38 ; CHECK: %non_instrumented1 = alloca i32, align 4
anatofuz
parents:
diff changeset
39 ; CHECK: %non_instrumented2 = alloca i32, align 4
anatofuz
parents:
diff changeset
40 ; CHECK: load i32, i32* @__asan_option_detect_stack_use_after_return
anatofuz
parents:
diff changeset
41 ; CHECK: bb0:
anatofuz
parents:
diff changeset
42 ; CHECK: %non_instrumented3 = alloca i32, align 4