LEFT | RIGHT |
1 ; Access an invalid (off by 1 at the end) discontinuous range of an array in a s
ingle loop. | 1 ; Access an invalid (off by 1 at the end) discontinuous range of an array in a s
ingle loop. |
2 | 2 |
3 ; RUN: opt < %s -asan -S -asan-opt=1 | FileCheck %s -check-prefix=OPT1 | 3 ; RUN: opt < %s -asan -S -asan-opt=1 -asan-opt-known-bounds=1 | FileCheck %s -ch
eck-prefix=OPT1 |
4 ; RUN: opt < %s -asan -S -asan-opt=0 | FileCheck %s -check-prefix=OPT0 | 4 ; RUN: opt < %s -asan -S -asan-opt=0 | FileCheck %s -check-prefix=OPT0 |
5 | 5 |
6 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
2:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:6
4-S128" | 6 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
2:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:6
4-S128" |
7 target triple = "x86_64-unknown-linux-gnu" | 7 target triple = "x86_64-unknown-linux-gnu" |
8 | 8 |
9 @char_array = global [395 x i8] zeroinitializer, align 16 | 9 @char_array = global [395 x i8] zeroinitializer, align 16 |
10 | 10 |
11 define void @_Z7examplev() address_safety nounwind uwtable { | 11 define void @_Z7examplev() address_safety nounwind uwtable { |
12 entry: | 12 entry: |
13 br label %for.body | 13 br label %for.body |
(...skipping 23 matching lines...) Expand all Loading... |
37 ; OPT0-NOT: call void @__asan_report_ | 37 ; OPT0-NOT: call void @__asan_report_ |
38 ; OPT0: @asan.module_ctor | 38 ; OPT0: @asan.module_ctor |
39 | 39 |
40 ; C++-example: char char_array[99 * sizeof(int) - 1]; | 40 ; C++-example: char char_array[99 * sizeof(int) - 1]; |
41 ; C++-example: | 41 ; C++-example: |
42 ; C++-example: void example() { | 42 ; C++-example: void example() { |
43 ; C++-example: int *array = (int*)&char_array[0]; | 43 ; C++-example: int *array = (int*)&char_array[0]; |
44 ; C++-example: for(int i = 0; i < 50; ++i) | 44 ; C++-example: for(int i = 0; i < 50; ++i) |
45 ; C++-example: array[2 * i] = i; // BUG (if i == 49) | 45 ; C++-example: array[2 * i] = i; // BUG (if i == 49) |
46 ; C++-example: } | 46 ; C++-example: } |
LEFT | RIGHT |