OLD | NEW |
1 ; Test for insertion of redzones around local variables | 1 ; Test for insertion of redzones around local variables |
2 | 2 |
3 ; REQUIRES: allow_dump | 3 ; REQUIRES: allow_dump |
4 | 4 |
5 ; RUN: %p2i -i %s --args -verbose=inst -threads=0 -fsanitize-address \ | 5 ; RUN: %p2i -i %s --args -verbose=inst -threads=0 -fsanitize-address \ |
6 ; RUN: | FileCheck --check-prefix=DUMP %s | 6 ; RUN: | FileCheck --check-prefix=DUMP %s |
7 | 7 |
8 ; Function with local variables to be instrumented | 8 ; Function with local variables to be instrumented |
9 define internal void @func() { | 9 define internal void @func() { |
10 %local1 = alloca i8, i32 4, align 4 | 10 %local1 = alloca i8, i32 4, align 4 |
11 %local2 = alloca i8, i32 32, align 1 | 11 %local2 = alloca i8, i32 32, align 1 |
12 %local3 = alloca i8, i32 13, align 2 | 12 %local3 = alloca i8, i32 13, align 2 |
13 %local4 = alloca i8, i32 75, align 4 | 13 %local4 = alloca i8, i32 75, align 4 |
14 %local5 = alloca i8, i32 64, align 8 | 14 %local5 = alloca i8, i32 64, align 8 |
15 ret void | 15 ret void |
16 } | 16 } |
17 | 17 |
18 ; DUMP-LABEL: ================ Instrumented CFG ================ | 18 ; DUMP-LABEL: ================ Instrumented CFG ================ |
19 ; DUMP-NEXT: define internal void @func() { | 19 ; DUMP-NEXT: define internal void @func() { |
20 ; DUMP-NEXT: __0: | 20 ; DUMP-NEXT: __0: |
21 ; DUMP-NEXT: %local1 = alloca i8, i32 64, align 8 | 21 ; DUMP-NEXT: %local1 = alloca i8, i32 64, align 8 |
22 ; DUMP-NEXT: %local2 = alloca i8, i32 64, align 8 | 22 ; DUMP-NEXT: %local2 = alloca i8, i32 64, align 8 |
23 ; DUMP-NEXT: %local3 = alloca i8, i32 64, align 8 | 23 ; DUMP-NEXT: %local3 = alloca i8, i32 64, align 8 |
24 ; DUMP-NEXT: %local4 = alloca i8, i32 128, align 8 | 24 ; DUMP-NEXT: %local4 = alloca i8, i32 128, align 8 |
25 ; DUMP-NEXT: %local5 = alloca i8, i32 96, align 8 | 25 ; DUMP-NEXT: %local5 = alloca i8, i32 96, align 8 |
26 ; DUMP-NEXT: %__$rz[[RZ0:[0-9]+]] = alloca i8, i32 32, align 8 | 26 ; DUMP-NEXT: %__$rz[[RZ0:[0-9]+]] = alloca i8, i32 32, align 8 |
27 ; DUMP-NEXT: call void @__asan_poison(i32 %__$rz[[RZ0]], i32 32) | 27 ; DUMP-NEXT: call void @__asan_poison(i32 %__$rz[[RZ0]], i32 32, i32 -1) |
28 ; DUMP-NEXT: %__$rz[[RZ1:[0-9]+]] = add i32 %local1, 4 | 28 ; DUMP-NEXT: %__$rz[[RZ1:[0-9]+]] = add i32 %local1, 4 |
29 ; DUMP-NEXT: call void @__asan_poison(i32 %__$rz[[RZ1]], i32 60) | 29 ; DUMP-NEXT: call void @__asan_poison(i32 %__$rz[[RZ1]], i32 60, i32 -1) |
30 ; DUMP-NEXT: %__$rz[[RZ2:[0-9]+]] = add i32 %local2, 32 | 30 ; DUMP-NEXT: %__$rz[[RZ2:[0-9]+]] = add i32 %local2, 32 |
31 ; DUMP-NEXT: call void @__asan_poison(i32 %__$rz[[RZ2]], i32 32) | 31 ; DUMP-NEXT: call void @__asan_poison(i32 %__$rz[[RZ2]], i32 32, i32 -1) |
32 ; DUMP-NEXT: %__$rz[[RZ3:[0-9]+]] = add i32 %local3, 13 | 32 ; DUMP-NEXT: %__$rz[[RZ3:[0-9]+]] = add i32 %local3, 13 |
33 ; DUMP-NEXT: call void @__asan_poison(i32 %__$rz[[RZ3]], i32 51) | 33 ; DUMP-NEXT: call void @__asan_poison(i32 %__$rz[[RZ3]], i32 51, i32 -1) |
34 ; DUMP-NEXT: %__$rz[[RZ4:[0-9]+]] = add i32 %local4, 75 | 34 ; DUMP-NEXT: %__$rz[[RZ4:[0-9]+]] = add i32 %local4, 75 |
35 ; DUMP-NEXT: call void @__asan_poison(i32 %__$rz[[RZ4]], i32 53) | 35 ; DUMP-NEXT: call void @__asan_poison(i32 %__$rz[[RZ4]], i32 53, i32 -1) |
36 ; DUMP-NEXT: %__$rz[[RZ5:[0-9]+]] = add i32 %local5, 64 | 36 ; DUMP-NEXT: %__$rz[[RZ5:[0-9]+]] = add i32 %local5, 64 |
37 ; DUMP-NEXT: call void @__asan_poison(i32 %__$rz[[RZ5]], i32 32) | 37 ; DUMP-NEXT: call void @__asan_poison(i32 %__$rz[[RZ5]], i32 32, i32 -1) |
38 ; DUMP-NEXT: call void @__asan_unpoison(i32 %__$rz[[RZ1]], i32 60) | 38 ; DUMP-NEXT: call void @__asan_unpoison(i32 %__$rz[[RZ1]], i32 60) |
39 ; DUMP-NEXT: call void @__asan_unpoison(i32 %__$rz[[RZ2]], i32 32) | 39 ; DUMP-NEXT: call void @__asan_unpoison(i32 %__$rz[[RZ2]], i32 32) |
40 ; DUMP-NEXT: call void @__asan_unpoison(i32 %__$rz[[RZ3]], i32 51) | 40 ; DUMP-NEXT: call void @__asan_unpoison(i32 %__$rz[[RZ3]], i32 51) |
41 ; DUMP-NEXT: call void @__asan_unpoison(i32 %__$rz[[RZ4]], i32 53) | 41 ; DUMP-NEXT: call void @__asan_unpoison(i32 %__$rz[[RZ4]], i32 53) |
42 ; DUMP-NEXT: call void @__asan_unpoison(i32 %__$rz[[RZ5]], i32 32) | 42 ; DUMP-NEXT: call void @__asan_unpoison(i32 %__$rz[[RZ5]], i32 32) |
43 ; DUMP-NEXT: call void @__asan_unpoison(i32 %__$rz[[RZ0]], i32 32) | 43 ; DUMP-NEXT: call void @__asan_unpoison(i32 %__$rz[[RZ0]], i32 32) |
44 ; DUMP-NEXT: ret void | 44 ; DUMP-NEXT: ret void |
45 ; DUMP-NEXT: } | 45 ; DUMP-NEXT: } |
OLD | NEW |