Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(140)

Delta Between Two Patch Sets: test/Instrumentation/AddressSanitizer/OptKnownBounds/struct-byval.ll

Issue 6643048: Add a known bounds optimization to ASan.
Left Patch Set: New version after ASan was converted to a function pass. Created 11 years, 5 months ago
Right Patch Set: Match the DataLayout getIntPtrType change. Created 11 years, 5 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
1 ; Valid access to a part of a byval argument. 1 ; Valid access to a part of a byval argument.
2 2
3 ; RUN: opt < %s -asan -S -asan-opt=1 | FileCheck %s -check-prefix=OPT1 3 ; RUN: opt < %s -asan -S -asan-opt=1 -asan-opt-known-bounds=1 | FileCheck %s -ch eck-prefix=OPT1
4 ; RUN: opt < %s -asan -S -asan-opt=0 | FileCheck %s -check-prefix=OPT0 4 ; RUN: opt < %s -asan -S -asan-opt=0 | FileCheck %s -check-prefix=OPT0
5 5
6 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 2:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:6 4-S128" 6 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 2:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:6 4-S128"
7 target triple = "x86_64-unknown-linux-gnu" 7 target triple = "x86_64-unknown-linux-gnu"
8 8
9 %struct.state_type = type { i64, [50 x i32] } 9 %struct.state_type = type { i64, [50 x i32] }
10 10
11 define i32 @_Z7example10state_type(%struct.state_type* nocapture byval align 8 % state) address_safety nounwind uwtable readonly { 11 define i32 @_Z7example10state_type(%struct.state_type* nocapture byval align 8 % state) address_safety nounwind uwtable readonly {
12 entry: 12 entry:
13 %size = getelementptr inbounds %struct.state_type* %state, i64 0, i32 0 13 %size = getelementptr inbounds %struct.state_type* %state, i64 0, i32 0
(...skipping 14 matching lines...) Expand all
28 ; C++-example: #include <cstring> 28 ; C++-example: #include <cstring>
29 ; C++-example: 29 ; C++-example:
30 ; C++-example: struct state_type { 30 ; C++-example: struct state_type {
31 ; C++-example: size_t size; 31 ; C++-example: size_t size;
32 ; C++-example: int array[50]; 32 ; C++-example: int array[50];
33 ; C++-example: }; 33 ; C++-example: };
34 ; C++-example: 34 ; C++-example:
35 ; C++-example: int example(state_type state) { 35 ; C++-example: int example(state_type state) {
36 ; C++-example: return state.size; // ok because state has the byval attribute 36 ; C++-example: return state.size; // ok because state has the byval attribute
37 ; C++-example: } 37 ; C++-example: }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b