Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 ; Make sure off-by-many OOB accesses of locals are caught | |
| 2 | |
| 3 ; REQUIRES: no_minimal_build | |
| 4 | |
| 5 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ | |
|
Jim Stichnoth
2016/06/28 13:46:08
This is a very clever way to make a lit test actua
tlively
2016/06/28 21:11:23
Done.
| |
| 6 ; RUN: --fsanitize-address --sz="-allow-externally-defined-symbols" \ | |
| 7 ; RUN: %t.pexe -o %t && not --crash %t 2>&1 | FileCheck \ | |
| 8 ; RUN: --check-prefix=CHECK32 %s | |
| 9 | |
| 10 declare external void @exit(i32) | |
| 11 | |
| 12 ; A global array | |
| 13 @arr = internal constant [12 x i8] zeroinitializer | |
| 14 | |
| 15 define i32 @access() { | |
| 16 %arr = alloca i8, i32 12, align 1 | |
| 17 %arraddr = ptrtoint i8* %arr to i32 | |
| 18 %badaddr = add i32 20, %arraddr | |
| 19 %badptr = inttoptr i32 %badaddr to i32* | |
| 20 %result = load i32, i32* %badptr, align 1 | |
| 21 ret i32 %result | |
| 22 } | |
| 23 | |
| 24 define void @_start(i32 %__0) { | |
| 25 %result = call i32 @access() | |
| 26 call void @exit(i32 0) | |
| 27 unreachable | |
| 28 } | |
| 29 | |
| 30 ; CHECK32: Illegal access of 4 bytes at | |
| 31 | |
|
Jim Stichnoth
2016/06/28 13:46:08
remove trailing whitespace (i.e. blank line)
tlively
2016/06/28 21:11:23
Done.
| |
| OLD | NEW |