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

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

Issue 2115693002: Implemented loose checking for potential widened loads (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Added test to commit 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
« no previous file with comments | « tests_lit/asan_tests/instrumentstore.ll ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 ; Test that potentially widened loads to not trigger an error report
2
3 ; REQUIRES: no_minimal_build
4
5 ; check for wide load exception
6 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \
7 ; RUN: --fsanitize-address --sz="-allow-externally-defined-symbols" \
8 ; RUN: %t.pexe -o %t && %t
Karl 2016/07/01 21:16:19 Run this through FileCheck --check-prefix=WIDE
tlively 2016/07/02 00:34:06 Done.
9
10 ; check for error reporting
11 ; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \
12 ; RUN: --fsanitize-address --sz="-allow-externally-defined-symbols" \
13 ; RUN: %t.pexe -o %t && %t 1 2>&1 | FileCheck %s --check-prefix=NOWIDE
14
15
16 declare external void @exit(i32)
17
18 define internal void @wide_load() {
19 %str = alloca i8, i32 1, align 1
20 %str4 = bitcast i8* %str to i32*
21 %contents = load i32, i32* %str4, align 1
22 call void @exit(i32 0)
23 unreachable
24 }
25
26 define internal void @no_wide_load() {
27 %str = alloca i8, i32 1, align 1
28 %straddr = ptrtoint i8* %str to i32
29 %off1addr = add i32 %straddr, 1
30 %off1 = inttoptr i32 %off1addr to i8*
31 %contents = load i8, i8* %off1, align 1
32 call void @exit(i32 1)
33 unreachable
34 }
35
36 ; NOWIDE: Illegal access of 1 bytes at
37
38 ; use argc to determine which test routine to run
39 define void @_start(i32 %arg) {
40 %argcaddr = add i32 %arg, 8
41 %argcptr = inttoptr i32 %argcaddr to i32*
42 %argc = load i32, i32* %argcptr, align 1
43 switch i32 %argc, label %error [i32 1, label %wide_load
44 i32 2, label %no_wide_load]
45 wide_load:
46 call void @wide_load()
47 br label %error
48 no_wide_load:
49 call void @no_wide_load()
50 br label %error
51 error:
52 call void @exit(i32 1)
53 unreachable
54 }
OLDNEW
« no previous file with comments | « tests_lit/asan_tests/instrumentstore.ll ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698