OLD | NEW |
1 ; Test to ensure that blacklisted functions are not instrumented and others are. | 1 ; Test to ensure that blacklisted functions are not instrumented and others are. |
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: -allow-externally-defined-symbols | FileCheck --check-prefix=DUMP %s | 6 ; RUN: -allow-externally-defined-symbols | FileCheck --check-prefix=DUMP %s |
7 | 7 |
8 declare external i32 @malloc(i32) | 8 declare external i32 @malloc(i32) |
9 declare external void @free(i32) | 9 declare external void @free(i32) |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 define internal void @func() { | 29 define internal void @func() { |
30 %local = alloca i8, i32 4, align 4 | 30 %local = alloca i8, i32 4, align 4 |
31 %heapvar = call i32 @malloc(i32 42) | 31 %heapvar = call i32 @malloc(i32 42) |
32 call void @free(i32 %heapvar) | 32 call void @free(i32 %heapvar) |
33 ret void | 33 ret void |
34 } | 34 } |
35 | 35 |
36 ; DUMP-LABEL: ================ Instrumented CFG ================ | 36 ; DUMP-LABEL: ================ Instrumented CFG ================ |
37 ; DUMP-NEXT: define internal void @func() { | 37 ; DUMP-NEXT: define internal void @func() { |
38 ; DUMP-NEXT: __0: | 38 ; DUMP-NEXT: __0: |
| 39 ; DUMP-NEXT: %__$rz0 = alloca i8, i32 32, align 8 |
39 ; DUMP-NEXT: %local = alloca i8, i32 64, align 8 | 40 ; DUMP-NEXT: %local = alloca i8, i32 64, align 8 |
40 ; DUMP-NEXT: %__$rz1 = alloca i8, i32 32, align 8 | 41 ; DUMP-NEXT: %shadowIndex = lshr i32 %__$rz0, 3 |
41 ; DUMP-NEXT: call void @__asan_poison(i32 %__$rz1, i32 32, i32 -1) | 42 ; DUMP-NEXT: %firstShadowLoc = add i32 %shadowIndex, 536870912 |
42 ; DUMP-NEXT: %__$rz0 = add i32 %local, 4 | 43 ; DUMP-NEXT: %__5 = add i32 %firstShadowLoc, 0 |
43 ; DUMP-NEXT: call void @__asan_poison(i32 %__$rz0, i32 60, i32 -1) | 44 ; DUMP-NEXT: store i32 -1, i32* %__5, align 1 |
| 45 ; DUMP-NEXT: %__6 = add i32 %firstShadowLoc, 4 |
| 46 ; DUMP-NEXT: store i32 -252, i32* %__6, align 1 |
| 47 ; DUMP-NEXT: %__7 = add i32 %firstShadowLoc, 8 |
| 48 ; DUMP-NEXT: store i32 -1, i32* %__7, align 1 |
44 ; DUMP-NEXT: %heapvar = call i32 @__asan_malloc(i32 42) | 49 ; DUMP-NEXT: %heapvar = call i32 @__asan_malloc(i32 42) |
45 ; DUMP-NEXT: call void @__asan_free(i32 %heapvar) | 50 ; DUMP-NEXT: call void @__asan_free(i32 %heapvar) |
46 ; DUMP-NEXT: call void @__asan_unpoison(i32 %__$rz0, i32 60) | 51 ; DUMP-NEXT: store i32 0, i32* %__5, align 1 |
47 ; DUMP-NEXT: call void @__asan_unpoison(i32 %__$rz1, i32 32) | 52 ; DUMP-NEXT: store i32 0, i32* %__6, align 1 |
| 53 ; DUMP-NEXT: store i32 0, i32* %__7, align 1 |
48 ; DUMP-NEXT: ret void | 54 ; DUMP-NEXT: ret void |
49 ; DUMP-NEXT: } | 55 ; DUMP-NEXT: } |
OLD | NEW |