| OLD | NEW |
| 1 ; Verify that ASan properly catches and reports bugs | 1 ; Verify that ASan properly catches and reports bugs |
| 2 | 2 |
| 3 ; REQUIRES: no_minimal_build | 3 ; REQUIRES: no_minimal_build |
| 4 | 4 |
| 5 ; check with a one off the end local load | 5 ; check with a one off the end local load |
| 6 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ | 6 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ |
| 7 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols \ | 7 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols \ |
| 8 ; RUN: %t.pexe -o %t && %t 2>&1 | FileCheck --check-prefix=LOCAL-LOAD %s | 8 ; RUN: %t.pexe -o %t && %t 2>&1 | FileCheck --check-prefix=LOCAL-LOAD %s |
| 9 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ |
| 10 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols -O2 \ |
| 11 ; RUN: %t.pexe -o %t && %t 2>&1 | FileCheck --check-prefix=LOCAL-LOAD %s |
| 9 | 12 |
| 10 ; check with a many off the end local load | 13 ; check with a many off the end local load |
| 11 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ | 14 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ |
| 12 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols \ | 15 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols \ |
| 13 ; RUN: %t.pexe -o %t && %t 1 2>&1 | FileCheck --check-prefix=LOCAL-LOAD %s | 16 ; RUN: %t.pexe -o %t && %t 1 2>&1 | FileCheck --check-prefix=LOCAL-LOAD %s |
| 17 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ |
| 18 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols -O2 \ |
| 19 ; RUN: %t.pexe -o %t && %t 1 2>&1 | FileCheck --check-prefix=LOCAL-LOAD %s |
| 14 | 20 |
| 15 ; check with a one before the front local load | 21 ; check with a one before the front local load |
| 16 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ | 22 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ |
| 17 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols \ | 23 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols \ |
| 18 ; RUN: %t.pexe -o %t && %t 1 2 2>&1 | FileCheck --check-prefix=LOCAL-LOAD %s | 24 ; RUN: %t.pexe -o %t && %t 1 2 2>&1 | FileCheck --check-prefix=LOCAL-LOAD %s |
| 25 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ |
| 26 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols -O2\ |
| 27 ; RUN: %t.pexe -o %t && %t 1 2 2>&1 | FileCheck --check-prefix=LOCAL-LOAD %s |
| 19 | 28 |
| 20 ; check with a one off the end global load | 29 ; check with a one off the end global load |
| 21 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ | 30 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ |
| 22 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols \ | 31 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols \ |
| 23 ; RUN: %t.pexe -o %t && %t 1 2 3 2>&1 | FileCheck \ | 32 ; RUN: %t.pexe -o %t && %t 1 2 3 2>&1 | FileCheck \ |
| 24 ; RUN: --check-prefix=GLOBAL-LOAD %s | 33 ; RUN: --check-prefix=GLOBAL-LOAD %s |
| 34 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ |
| 35 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols -O2 \ |
| 36 ; RUN: %t.pexe -o %t && %t 1 2 3 2>&1 | FileCheck \ |
| 37 ; RUN: --check-prefix=GLOBAL-LOAD %s |
| 25 | 38 |
| 26 ; check with a many off the end global load | 39 ; check with a many off the end global load |
| 27 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ | 40 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ |
| 28 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols \ | 41 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols \ |
| 29 ; RUN: %t.pexe -o %t && %t 1 2 3 4 2>&1 | FileCheck \ | 42 ; RUN: %t.pexe -o %t && %t 1 2 3 4 2>&1 | FileCheck \ |
| 30 ; RUN: --check-prefix=GLOBAL-LOAD %s | 43 ; RUN: --check-prefix=GLOBAL-LOAD %s |
| 44 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ |
| 45 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols -O2 \ |
| 46 ; RUN: %t.pexe -o %t && %t 1 2 3 4 2>&1 | FileCheck \ |
| 47 ; RUN: --check-prefix=GLOBAL-LOAD %s |
| 31 | 48 |
| 32 ; check with a one before the front global load | 49 ; check with a one before the front global load |
| 33 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ | 50 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ |
| 34 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols \ | 51 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols \ |
| 35 ; RUN: %t.pexe -o %t && %t 1 2 3 4 5 2>&1 | FileCheck \ | 52 ; RUN: %t.pexe -o %t && %t 1 2 3 4 5 2>&1 | FileCheck \ |
| 36 ; RUN: --check-prefix=GLOBAL-LOAD %s | 53 ; RUN: --check-prefix=GLOBAL-LOAD %s |
| 54 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ |
| 55 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols -O2 \ |
| 56 ; RUN: %t.pexe -o %t && %t 1 2 3 4 5 2>&1 | FileCheck \ |
| 57 ; RUN: --check-prefix=GLOBAL-LOAD %s |
| 37 | 58 |
| 38 ; check with a one off the end local store | 59 ; check with a one off the end local store |
| 39 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ | 60 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ |
| 40 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols \ | 61 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols \ |
| 41 ; RUN: %t.pexe -o %t && %t 1 2 3 4 5 6 2>&1 | FileCheck \ | 62 ; RUN: %t.pexe -o %t && %t 1 2 3 4 5 6 2>&1 | FileCheck \ |
| 42 ; RUN: --check-prefix=LOCAL-STORE %s | 63 ; RUN: --check-prefix=LOCAL-STORE %s |
| 64 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ |
| 65 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols -O2 \ |
| 66 ; RUN: %t.pexe -o %t && %t 1 2 3 4 5 6 2>&1 | FileCheck \ |
| 67 ; RUN: --check-prefix=LOCAL-STORE %s |
| 43 | 68 |
| 44 ; check with a many off the end local store | 69 ; check with a many off the end local store |
| 45 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ | 70 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ |
| 46 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols \ | 71 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols \ |
| 47 ; RUN: %t.pexe -o %t && %t 1 2 3 4 5 6 7 2>&1 | FileCheck \ | 72 ; RUN: %t.pexe -o %t && %t 1 2 3 4 5 6 7 2>&1 | FileCheck \ |
| 48 ; RUN: --check-prefix=LOCAL-STORE %s | 73 ; RUN: --check-prefix=LOCAL-STORE %s |
| 74 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ |
| 75 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols -O2 \ |
| 76 ; RUN: %t.pexe -o %t && %t 1 2 3 4 5 6 7 2>&1 | FileCheck \ |
| 77 ; RUN: --check-prefix=LOCAL-STORE %s |
| 49 | 78 |
| 50 ; check with a one before the front local store | 79 ; check with a one before the front local store |
| 51 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ | 80 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ |
| 52 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols \ | 81 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols \ |
| 53 ; RUN: %t.pexe -o %t && %t 1 2 3 4 5 6 7 8 2>&1 | FileCheck \ | 82 ; RUN: %t.pexe -o %t && %t 1 2 3 4 5 6 7 8 2>&1 | FileCheck \ |
| 54 ; RUN: --check-prefix=LOCAL-STORE %s | 83 ; RUN: --check-prefix=LOCAL-STORE %s |
| 84 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ |
| 85 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols -O2 \ |
| 86 ; RUN: %t.pexe -o %t && %t 1 2 3 4 5 6 7 8 2>&1 | FileCheck \ |
| 87 ; RUN: --check-prefix=LOCAL-STORE %s |
| 55 | 88 |
| 56 ; check with a one off the end global store | 89 ; check with a one off the end global store |
| 57 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ | 90 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ |
| 58 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols \ | 91 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols \ |
| 59 ; RUN: %t.pexe -o %t && %t 1 2 3 4 5 6 7 8 9 2>&1 | FileCheck \ | 92 ; RUN: %t.pexe -o %t && %t 1 2 3 4 5 6 7 8 9 2>&1 | FileCheck \ |
| 60 ; RUN: --check-prefix=GLOBAL-STORE %s | 93 ; RUN: --check-prefix=GLOBAL-STORE %s |
| 94 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ |
| 95 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols -O2 \ |
| 96 ; RUN: %t.pexe -o %t && %t 1 2 3 4 5 6 7 8 9 2>&1 | FileCheck \ |
| 97 ; RUN: --check-prefix=GLOBAL-STORE %s |
| 61 | 98 |
| 62 ; check with a many off the end global store | 99 ; check with a many off the end global store |
| 63 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ | 100 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ |
| 64 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols \ | 101 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols \ |
| 65 ; RUN: %t.pexe -o %t && %t 1 2 3 4 5 6 7 8 9 10 2>&1 | FileCheck \ | 102 ; RUN: %t.pexe -o %t && %t 1 2 3 4 5 6 7 8 9 10 2>&1 | FileCheck \ |
| 66 ; RUN: --check-prefix=GLOBAL-STORE %s | 103 ; RUN: --check-prefix=GLOBAL-STORE %s |
| 104 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ |
| 105 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols -O2 \ |
| 106 ; RUN: %t.pexe -o %t && %t 1 2 3 4 5 6 7 8 9 10 2>&1 | FileCheck \ |
| 107 ; RUN: --check-prefix=GLOBAL-STORE %s |
| 67 | 108 |
| 68 ; check with a one before the front global store | 109 ; check with a one before the front global store |
| 69 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ | 110 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ |
| 70 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols \ | 111 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols \ |
| 71 ; RUN: %t.pexe -o %t && %t 1 2 3 4 5 6 7 8 9 10 11 2>&1 | FileCheck \ | 112 ; RUN: %t.pexe -o %t && %t 1 2 3 4 5 6 7 8 9 10 11 2>&1 | FileCheck \ |
| 72 ; RUN: --check-prefix=GLOBAL-STORE %s | 113 ; RUN: --check-prefix=GLOBAL-STORE %s |
| 114 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ |
| 115 ; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols -O2 \ |
| 116 ; RUN: %t.pexe -o %t && %t 1 2 3 4 5 6 7 8 9 10 11 2>&1 | FileCheck \ |
| 117 ; RUN: --check-prefix=GLOBAL-STORE %s |
| 73 | 118 |
| 74 declare external void @exit(i32) | 119 declare external void @exit(i32) |
| 75 | 120 |
| 76 ; A global array | 121 ; A global array |
| 77 @array = internal constant [12 x i8] zeroinitializer | 122 @array = internal constant [12 x i8] zeroinitializer |
| 78 | 123 |
| 79 define void @access(i32 %is_local_i, i32 %is_load_i, i32 %err) { | 124 define void @access(i32 %is_local_i, i32 %is_load_i, i32 %err) { |
| 80 ; get the base pointer to either the local or global array | 125 ; get the base pointer to either the local or global array |
| 81 %local = alloca i8, i32 12, align 1 | 126 %local = alloca i8, i32 12, align 1 |
| 82 %global = bitcast [12 x i8]* @array to i8* | 127 %global = bitcast [12 x i8]* @array to i8* |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 br label %error | 219 br label %error |
| 175 error: | 220 error: |
| 176 call void @exit(i32 1) | 221 call void @exit(i32 1) |
| 177 unreachable | 222 unreachable |
| 178 } | 223 } |
| 179 | 224 |
| 180 ; LOCAL-LOAD: Illegal 1 byte load from stack object at | 225 ; LOCAL-LOAD: Illegal 1 byte load from stack object at |
| 181 ; LOCAL-STORE: Illegal 1 byte store to stack object at | 226 ; LOCAL-STORE: Illegal 1 byte store to stack object at |
| 182 ; GLOBAL-LOAD: Illegal 1 byte load from global object at | 227 ; GLOBAL-LOAD: Illegal 1 byte load from global object at |
| 183 ; GLOBAL-STORE: Illegal 1 byte store to global object at | 228 ; GLOBAL-STORE: Illegal 1 byte store to global object at |
| OLD | NEW |