OLD | NEW |
1 ; Check that functions with multiple returns are correctly instrumented | 1 ; Check that functions with multiple returns are correctly instrumented |
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 define internal void @ret_twice(i32 %condarg) { | 8 define internal void @ret_twice(i32 %condarg) { |
9 %local1 = alloca i8, i32 4, align 4 | 9 %local1 = alloca i8, i32 4, align 4 |
10 %local2 = alloca i8, i32 4, align 4 | 10 %local2 = alloca i8, i32 4, align 4 |
11 %cond = icmp ne i32 %condarg, 0 | 11 %cond = icmp ne i32 %condarg, 0 |
12 br i1 %cond, label %yes, label %no | 12 br i1 %cond, label %yes, label %no |
13 yes: | 13 yes: |
14 ret void | 14 ret void |
15 no: | 15 no: |
16 ret void | 16 ret void |
17 } | 17 } |
18 | 18 |
19 ; DUMP-LABEL: ================ Instrumented CFG ================ | 19 ; DUMP-LABEL:================ Instrumented CFG ================ |
20 ; DUMP-NEXT: define internal void @ret_twice(i32 %condarg) { | 20 ; DUMP-NEXT: define internal void @ret_twice(i32 %condarg) { |
21 ; DUMP-NEXT: __0: | 21 ; DUMP-NEXT: __0: |
| 22 ; DUMP-NEXT: %__$rz0 = alloca i8, i32 32, align 8 |
22 ; DUMP-NEXT: %local1 = alloca i8, i32 64, align 8 | 23 ; DUMP-NEXT: %local1 = alloca i8, i32 64, align 8 |
23 ; DUMP-NEXT: %local2 = alloca i8, i32 64, align 8 | 24 ; DUMP-NEXT: %local2 = alloca i8, i32 64, align 8 |
24 ; DUMP-NEXT: %__$rz2 = alloca i8, i32 32, align 8 | 25 ; DUMP-NEXT: %shadowIndex = lshr i32 %__$rz0, 3 |
25 ; DUMP-NEXT: call void @__asan_poison(i32 %__$rz2, i32 32, i32 -1) | 26 ; DUMP-NEXT: %firstShadowLoc = add i32 %shadowIndex, 53687091 |
26 ; DUMP-NEXT: %__$rz0 = add i32 %local1, 4 | 27 ; DUMP-NEXT: %__7 = add i32 %firstShadowLoc, 0 |
27 ; DUMP-NEXT: call void @__asan_poison(i32 %__$rz0, i32 60, i32 -1) | 28 ; DUMP-NEXT: store i32 -1, i32* %__7, align 1 |
28 ; DUMP-NEXT: %__$rz1 = add i32 %local2, 4 | 29 ; DUMP-NEXT: %__8 = add i32 %firstShadowLoc, 4 |
29 ; DUMP-NEXT: call void @__asan_poison(i32 %__$rz1, i32 60, i32 -1) | 30 ; DUMP-NEXT: store i32 -252, i32* %__8, align 1 |
| 31 ; DUMP-NEXT: %__9 = add i32 %firstShadowLoc, 8 |
| 32 ; DUMP-NEXT: store i32 -1, i32* %__9, align 1 |
| 33 ; DUMP-NEXT: %__10 = add i32 %firstShadowLoc, 12 |
| 34 ; DUMP-NEXT: store i32 -252, i32* %__10, align 1 |
| 35 ; DUMP-NEXT: %__11 = add i32 %firstShadowLoc, 16 |
| 36 ; DUMP-NEXT: store i32 -1, i32* %__11, align 1 |
30 ; DUMP-NEXT: %cond = icmp ne i32 %condarg, 0 | 37 ; DUMP-NEXT: %cond = icmp ne i32 %condarg, 0 |
31 ; DUMP-NEXT: br i1 %cond, label %yes, label %no | 38 ; DUMP-NEXT: br i1 %cond, label %yes, label %no |
32 ; DUMP-NEXT: yes: | 39 ; DUMP-NEXT: yes: |
33 ; DUMP-NEXT: call void @__asan_unpoison(i32 %__$rz0, i32 60) | 40 ; DUMP-NEXT: store i32 0, i32* %__7, align 1 |
34 ; DUMP-NEXT: call void @__asan_unpoison(i32 %__$rz1, i32 60) | 41 ; DUMP-NEXT: store i32 0, i32* %__8, align 1 |
35 ; DUMP-NEXT: call void @__asan_unpoison(i32 %__$rz2, i32 32) | 42 ; DUMP-NEXT: store i32 0, i32* %__9, align 1 |
| 43 ; DUMP-NEXT: store i32 0, i32* %__10, align 1 |
| 44 ; DUMP-NEXT: store i32 0, i32* %__11, align 1 |
36 ; DUMP-NEXT: ret void | 45 ; DUMP-NEXT: ret void |
37 ; DUMP-NEXT: no: | 46 ; DUMP-NEXT: no: |
38 ; DUMP-NEXT: call void @__asan_unpoison(i32 %__$rz0, i32 60) | 47 ; DUMP-NEXT: store i32 0, i32* %__7, align 1 |
39 ; DUMP-NEXT: call void @__asan_unpoison(i32 %__$rz1, i32 60) | 48 ; DUMP-NEXT: store i32 0, i32* %__8, align 1 |
40 ; DUMP-NEXT: call void @__asan_unpoison(i32 %__$rz2, i32 32) | 49 ; DUMP-NEXT: store i32 0, i32* %__9, align 1 |
| 50 ; DUMP-NEXT: store i32 0, i32* %__10, align 1 |
| 51 ; DUMP-NEXT: store i32 0, i32* %__11, align 1 |
41 ; DUMP-NEXT: ret void | 52 ; DUMP-NEXT: ret void |
42 ; DUMP-NEXT: } | 53 ; DUMP-NEXT: } |
OLD | NEW |