Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: tests_lit/asan_tests/errorlocaloffbynegative.ll

Issue 2101173002: Added tests for bug detection on locals (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 ; Make sure off-by-negative 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 \
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 -4, %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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698