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

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

Issue 2067403002: Instrumented load and store with dummy calls to __asan_check(). (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Improved tests Created 4 years, 6 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 | « src/IceCompileServer.cpp ('k') | tests_lit/asan_tests/instrumentstore.ll » ('j') | 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 for a call to __asan_check() preceding loads
2
3 ; REQUIRES: allow_dump
4
5 ; RUN: %p2i -i %s --args -verbose=inst -threads=0 -fsanitize-address \
6 ; RUN: | FileCheck --check-prefix=DUMP %s
7
8 ; Constants to load data from
9 @srcConst8 = internal constant [1 x i8] c"D"
10 @srcConst16 = internal constant [2 x i8] c"DA"
11 @srcConst32 = internal constant [4 x i8] c"DATA"
12 @srcConst64 = internal constant [8 x i8] c"DATADATA"
13 @srcConst128 = internal constant [16 x i8] c"DATADATADATADATA"
14
15 ; A global to load data from
16 @srcGlobal8 = internal global [1 x i8] c"D"
17 @srcGlobal16 = internal global [2 x i8] c"DA"
18 @srcGlobal32 = internal global [4 x i8] c"DATA"
19 @srcGlobal64 = internal global [8 x i8] c"DATADATA"
20 @srcGlobal128 = internal global [16 x i8] c"DATADATADATADATA"
21
22 ; A function with a local variable that does the loads
23 define internal void @doLoads() {
24 %srcLocal8 = alloca i8, i32 1, align 4
25 %srcLocal16 = alloca i8, i32 2, align 4
26 %srcLocal32 = alloca i8, i32 4, align 4
27 %srcLocal64 = alloca i8, i32 8, align 4
28 %srcLocal128 = alloca i8, i32 16, align 4
29
30 %ptrConst8 = bitcast [1 x i8]* @srcConst8 to i8*
31 %ptrConst16 = bitcast [2 x i8]* @srcConst16 to i16*
32 %ptrConst32 = bitcast [4 x i8]* @srcConst32 to i32*
33 %ptrConst64 = bitcast [8 x i8]* @srcConst64 to i64*
34 %ptrConst128 = bitcast [16 x i8]* @srcConst128 to <4 x i32>*
35
36 %ptrGlobal8 = bitcast [1 x i8]* @srcGlobal8 to i8*
37 %ptrGlobal16 = bitcast [2 x i8]* @srcGlobal16 to i16*
38 %ptrGlobal32 = bitcast [4 x i8]* @srcGlobal32 to i32*
39 %ptrGlobal64 = bitcast [8 x i8]* @srcGlobal64 to i64*
40 %ptrGlobal128 = bitcast [16 x i8]* @srcGlobal128 to <4 x i32>*
41
42 %ptrLocal8 = bitcast i8* %srcLocal8 to i8*
43 %ptrLocal16 = bitcast i8* %srcLocal16 to i16*
44 %ptrLocal32 = bitcast i8* %srcLocal32 to i32*
45 %ptrLocal64 = bitcast i8* %srcLocal64 to i64*
46 %ptrLocal128 = bitcast i8* %srcLocal128 to <4 x i32>*
47
48 %dest1 = load i8, i8* %ptrConst8, align 1
49 %dest2 = load i16, i16* %ptrConst16, align 1
50 %dest3 = load i32, i32* %ptrConst32, align 1
51 %dest4 = load i64, i64* %ptrConst64, align 1
52 %dest5 = load <4 x i32>, <4 x i32>* %ptrConst128, align 4
53
54 %dest6 = load i8, i8* %ptrGlobal8, align 1
55 %dest7 = load i16, i16* %ptrGlobal16, align 1
56 %dest8 = load i32, i32* %ptrGlobal32, align 1
57 %dest9 = load i64, i64* %ptrGlobal64, align 1
58 %dest10 = load <4 x i32>, <4 x i32>* %ptrGlobal128, align 4
59
60 %dest11 = load i8, i8* %ptrLocal8, align 1
61 %dest12 = load i16, i16* %ptrLocal16, align 1
62 %dest13 = load i32, i32* %ptrLocal32, align 1
63 %dest14 = load i64, i64* %ptrLocal64, align 1
64 %dest15 = load <4 x i32>, <4 x i32>* %ptrLocal128, align 4
65
66 ret void
67 }
68
69 ; DUMP-LABEL: ================ Instrumented CFG ================
70 ; DUMP-NEXT: define internal void @doLoads() {
71 ; DUMP-NEXT: __0:
72 ; DUMP-NEXT: %srcLocal8 = alloca i8, i32 1, align 4
73 ; DUMP-NEXT: %srcLocal16 = alloca i8, i32 2, align 4
74 ; DUMP-NEXT: %srcLocal32 = alloca i8, i32 4, align 4
75 ; DUMP-NEXT: %srcLocal64 = alloca i8, i32 8, align 4
76 ; DUMP-NEXT: %srcLocal128 = alloca i8, i32 16, align 4
77 ; DUMP-NEXT: call void @__asan_check(i32 @srcConst8, i32 1)
78 ; DUMP-NEXT: %dest1 = load i8, i8* @srcConst8, align 1
79 ; DUMP-NEXT: call void @__asan_check(i32 @srcConst16, i32 2)
80 ; DUMP-NEXT: %dest2 = load i16, i16* @srcConst16, align 1
81 ; DUMP-NEXT: call void @__asan_check(i32 @srcConst32, i32 4)
82 ; DUMP-NEXT: %dest3 = load i32, i32* @srcConst32, align 1
83 ; DUMP-NEXT: call void @__asan_check(i32 @srcConst64, i32 8)
84 ; DUMP-NEXT: %dest4 = load i64, i64* @srcConst64, align 1
85 ; DUMP-NEXT: call void @__asan_check(i32 @srcConst128, i32 16)
86 ; DUMP-NEXT: %dest5 = load <4 x i32>, <4 x i32>* @srcConst128, align 4
87 ; DUMP-NEXT: call void @__asan_check(i32 @srcGlobal8, i32 1)
88 ; DUMP-NEXT: %dest6 = load i8, i8* @srcGlobal8, align 1
89 ; DUMP-NEXT: call void @__asan_check(i32 @srcGlobal16, i32 2)
90 ; DUMP-NEXT: %dest7 = load i16, i16* @srcGlobal16, align 1
91 ; DUMP-NEXT: call void @__asan_check(i32 @srcGlobal32, i32 4)
92 ; DUMP-NEXT: %dest8 = load i32, i32* @srcGlobal32, align 1
93 ; DUMP-NEXT: call void @__asan_check(i32 @srcGlobal64, i32 8)
94 ; DUMP-NEXT: %dest9 = load i64, i64* @srcGlobal64, align 1
95 ; DUMP-NEXT: call void @__asan_check(i32 @srcGlobal128, i32 16)
96 ; DUMP-NEXT: %dest10 = load <4 x i32>, <4 x i32>* @srcGlobal128, align 4
97 ; DUMP-NEXT: call void @__asan_check(i32 %srcLocal8, i32 1)
98 ; DUMP-NEXT: %dest11 = load i8, i8* %srcLocal8, align 1
99 ; DUMP-NEXT: call void @__asan_check(i32 %srcLocal16, i32 2)
100 ; DUMP-NEXT: %dest12 = load i16, i16* %srcLocal16, align 1
101 ; DUMP-NEXT: call void @__asan_check(i32 %srcLocal32, i32 4)
102 ; DUMP-NEXT: %dest13 = load i32, i32* %srcLocal32, align 1
103 ; DUMP-NEXT: call void @__asan_check(i32 %srcLocal64, i32 8)
104 ; DUMP-NEXT: %dest14 = load i64, i64* %srcLocal64, align 1
105 ; DUMP-NEXT: call void @__asan_check(i32 %srcLocal128, i32 16)
106 ; DUMP-NEXT: %dest15 = load <4 x i32>, <4 x i32>* %srcLocal128, align 4
107 ; DUMP-NEXT: ret void
108 ; DUMP-NEXT }
OLDNEW
« no previous file with comments | « src/IceCompileServer.cpp ('k') | tests_lit/asan_tests/instrumentstore.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698