Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/test/Instrumentation/AddressSanitizer/scale-offset.ll
; Test that the scale (-asan-mapping-scale) and offset (-asan-mapping-offset) command-line options work as expected | ; Test that the scale (-asan-mapping-scale) and offset (-asan-mapping-offset) command-line options work as expected | ||||
; | ; | ||||
; RUN: opt < %s -asan -asan-module -asan-mapping-offset 0xdeadbeef -S | FileCheck --check-prefix=CHECK-OFFSET %s | ; RUN: %opt_asan < %s -asan -asan-module -asan-mapping-offset 0xdeadbeef -S | FileCheck --check-prefixes=CHECK-OFFSET,CHECK-OFFSET-S%scale %s | ||||
; RUN: opt < %s -asan -asan-module -asan-mapping-scale 1 -S | FileCheck --check-prefix=CHECK-SCALE %s | ; RUN: opt < %s -asan -asan-module -asan-mapping-scale 1 -S | FileCheck --check-prefix=CHECK-SCALE %s | ||||
; RUN: opt < %s -asan -asan-module -asan-mapping-offset 0xc0ffee -asan-mapping-scale 0 -S | FileCheck --check-prefix=CHECK-BOTH %s | ; RUN: opt < %s -asan -asan-module -asan-mapping-offset 0xc0ffee -asan-mapping-scale 0 -S | FileCheck --check-prefix=CHECK-BOTH %s | ||||
target triple = "x86_64-unknown-linux-gnu" | target triple = "x86_64-unknown-linux-gnu" | ||||
define i32 @read_offset(i32* %a) sanitize_address { | define i32 @read_offset(i32* %a) sanitize_address { | ||||
entry: | entry: | ||||
%tmp1 = load i32, i32* %a, align 4 | %tmp1 = load i32, i32* %a, align 4 | ||||
ret i32 %tmp1 | ret i32 %tmp1 | ||||
} | } | ||||
; CHECK-OFFSET-LABEL: @read_offset | ; CHECK-OFFSET-LABEL: @read_offset | ||||
; CHECK-OFFSET-NOT: ret | ; CHECK-OFFSET-NOT: ret | ||||
; CHECK-OFFSET: lshr {{.*}} 3 | ; CHECK-OFFSET-S3: lshr {{.*}} 3 | ||||
; CHECK-OFFSET-S5: lshr {{.*}} 5 | |||||
; CHECK-OFFSET-NEXT: add{{.*}}3735928559 | ; CHECK-OFFSET-NEXT: add{{.*}}3735928559 | ||||
; CHECK-OFFSET: ret | ; CHECK-OFFSET: ret | ||||
define i32 @read_scale(i32* %a) sanitize_address { | define i32 @read_scale(i32* %a) sanitize_address { | ||||
entry: | entry: | ||||
%tmp1 = load i32, i32* %a, align 4 | %tmp1 = load i32, i32* %a, align 4 | ||||
ret i32 %tmp1 | ret i32 %tmp1 | ||||
} | } | ||||
Show All 16 Lines |