Index: llvm/trunk/test/Instrumentation/AddressSanitizer/adaptive_global_redzones.ll =================================================================== --- llvm/trunk/test/Instrumentation/AddressSanitizer/adaptive_global_redzones.ll +++ llvm/trunk/test/Instrumentation/AddressSanitizer/adaptive_global_redzones.ll @@ -1,4 +1,5 @@ ; RUN: opt < %s -asan -asan-module -S | FileCheck %s +; RUN: opt < %s -asan -asan-module -asan-mapping-scale=5 -S | FileCheck %s target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" target triple = "x86_64-unknown-linux-gnu" Index: llvm/trunk/test/Instrumentation/AddressSanitizer/basic.ll =================================================================== --- llvm/trunk/test/Instrumentation/AddressSanitizer/basic.ll +++ llvm/trunk/test/Instrumentation/AddressSanitizer/basic.ll @@ -1,6 +1,7 @@ ; Test basic address sanitizer instrumentation. ; -; RUN: opt < %s -asan -asan-module -S | FileCheck %s +; RUN: opt < %s -asan -asan-module -S | FileCheck --check-prefixes=CHECK,CHECK-S3 %s +; RUN: opt < %s -asan -asan-module -asan-mapping-scale=5 -S | FileCheck --check-prefixes=CHECK,CHECK-S5 %s target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" target triple = "x86_64-unknown-linux-gnu" @@ -10,7 +11,8 @@ ; CHECK-LABEL: @test_load ; CHECK-NOT: load ; CHECK: %[[LOAD_ADDR:[^ ]*]] = ptrtoint i32* %a to i64 -; CHECK: lshr i64 %[[LOAD_ADDR]], 3 +; CHECK-S3: lshr i64 %[[LOAD_ADDR]], 3 +; CHECK-S5: lshr i64 %[[LOAD_ADDR]], 5 ; CHECK: {{or|add}} ; CHECK: %[[LOAD_SHADOW_PTR:[^ ]*]] = inttoptr ; CHECK: %[[LOAD_SHADOW:[^ ]*]] = load i8, i8* %[[LOAD_SHADOW_PTR]] @@ -18,7 +20,8 @@ ; CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}!prof ![[PROF:[0-9]+]] ; ; First instrumentation block refines the shadow test. -; CHECK: and i64 %[[LOAD_ADDR]], 7 +; CHECK-S3: and i64 %[[LOAD_ADDR]], 7 +; CHECK-S5: and i64 %[[LOAD_ADDR]], 31 ; CHECK: add i64 %{{.*}}, 3 ; CHECK: trunc i64 %{{.*}} to i8 ; CHECK: icmp sge i8 %{{.*}}, %[[LOAD_SHADOW]] @@ -43,7 +46,8 @@ ; CHECK-LABEL: @test_store ; CHECK-NOT: store ; CHECK: %[[STORE_ADDR:[^ ]*]] = ptrtoint i32* %a to i64 -; CHECK: lshr i64 %[[STORE_ADDR]], 3 +; CHECK-S3: lshr i64 %[[STORE_ADDR]], 3 +; CHECK-S5: lshr i64 %[[STORE_ADDR]], 5 ; CHECK: {{or|add}} ; CHECK: %[[STORE_SHADOW_PTR:[^ ]*]] = inttoptr ; CHECK: %[[STORE_SHADOW:[^ ]*]] = load i8, i8* %[[STORE_SHADOW_PTR]] @@ -51,7 +55,8 @@ ; CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}} ; ; First instrumentation block refines the shadow test. -; CHECK: and i64 %[[STORE_ADDR]], 7 +; CHECK-S3: and i64 %[[STORE_ADDR]], 7 +; CHECK-S5: and i64 %[[STORE_ADDR]], 31 ; CHECK: add i64 %{{.*}}, 3 ; CHECK: trunc i64 %{{.*}} to i8 ; CHECK: icmp sge i8 %{{.*}}, %[[STORE_SHADOW]] Index: llvm/trunk/test/Instrumentation/AddressSanitizer/global_metadata.ll =================================================================== --- llvm/trunk/test/Instrumentation/AddressSanitizer/global_metadata.ll +++ llvm/trunk/test/Instrumentation/AddressSanitizer/global_metadata.ll @@ -1,4 +1,5 @@ ; RUN: opt < %s -asan -asan-module -asan-globals-live-support=1 -S | FileCheck %s +; RUN: opt < %s -asan -asan-module -asan-globals-live-support=1 -asan-mapping-scale=5 -S | FileCheck %s target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" Index: llvm/trunk/test/Instrumentation/AddressSanitizer/global_metadata_array.ll =================================================================== --- llvm/trunk/test/Instrumentation/AddressSanitizer/global_metadata_array.ll +++ llvm/trunk/test/Instrumentation/AddressSanitizer/global_metadata_array.ll @@ -1,6 +1,7 @@ -; RUN: opt < %s -asan -asan-module -asan-globals-live-support=0 -mtriple=x86_64-unknown-linux-gnu -S | FileCheck %s -; RUN: opt < %s -asan -asan-module -asan-globals-live-support=0 -mtriple=x86_64-apple-macosx10.11.0 -S | FileCheck %s -; RUN: opt < %s -asan -asan-module -asan-globals-live-support=0 -mtriple=x86_64-pc-windows-msvc19.0.24215 -S | FileCheck %s +; RUN: opt < %s -asan -asan-module -asan-globals-live-support=0 -mtriple=x86_64-unknown-linux-gnu -S | FileCheck --check-prefixes=CHECK,CHECK-S3 %s +; RUN: opt < %s -asan -asan-module -asan-globals-live-support=0 -mtriple=x86_64-apple-macosx10.11.0 -S | FileCheck --check-prefixes=CHECK,CHECK-S3 %s +; RUN: opt < %s -asan -asan-module -asan-globals-live-support=0 -mtriple=x86_64-pc-windows-msvc19.0.24215 -S | FileCheck --check-prefixes=CHECK,CHECK-S3 %s +; RUN: opt < %s -asan -asan-module -asan-globals-live-support=0 -asan-mapping-scale=5 -mtriple=x86_64-unknown-linux-gnu -S | FileCheck --check-prefixes=CHECK,CHECK-S5 %s target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" Index: llvm/trunk/test/Instrumentation/AddressSanitizer/instrument-stack.ll =================================================================== --- llvm/trunk/test/Instrumentation/AddressSanitizer/instrument-stack.ll +++ llvm/trunk/test/Instrumentation/AddressSanitizer/instrument-stack.ll @@ -1,5 +1,6 @@ ; This test checks that we are not instrumenting direct inbound stack accesses. ; RUN: opt < %s -asan -asan-module -asan-opt-stack -S | FileCheck %s +; RUN: opt < %s -asan -asan-module -asan-opt-stack -asan-mapping-scale=5 -S | FileCheck %s target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" Index: llvm/trunk/test/Instrumentation/AddressSanitizer/instrument_global.ll =================================================================== --- llvm/trunk/test/Instrumentation/AddressSanitizer/instrument_global.ll +++ llvm/trunk/test/Instrumentation/AddressSanitizer/instrument_global.ll @@ -1,4 +1,5 @@ ; RUN: opt < %s -asan -asan-module -asan-globals-live-support=1 -S | FileCheck %s +; RUN: opt < %s -asan -asan-module -asan-globals-live-support=1 -asan-mapping-scale=5 -S | FileCheck %s target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" target triple = "x86_64-unknown-linux-gnu" @xxx = global i32 0, align 4 Index: llvm/trunk/test/Instrumentation/AddressSanitizer/instrument_initializer_metadata.ll =================================================================== --- llvm/trunk/test/Instrumentation/AddressSanitizer/instrument_initializer_metadata.ll +++ llvm/trunk/test/Instrumentation/AddressSanitizer/instrument_initializer_metadata.ll @@ -1,4 +1,5 @@ ; RUN: opt < %s -asan -asan-module -S | FileCheck %s +; RUN: opt < %s -asan -asan-module -asan-mapping-scale=5 -S | FileCheck %s target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" target triple = "x86_64-unknown-linux-gnu" @xxx = internal global i32 0, align 4 ; With dynamic initializer. Index: llvm/trunk/test/Instrumentation/AddressSanitizer/stack-poisoning-byval-args.ll =================================================================== --- llvm/trunk/test/Instrumentation/AddressSanitizer/stack-poisoning-byval-args.ll +++ llvm/trunk/test/Instrumentation/AddressSanitizer/stack-poisoning-byval-args.ll @@ -1,6 +1,8 @@ ; This check verifies that arguments passed by value get redzones. ; RUN: opt < %s -asan -asan-realign-stack=32 -S | FileCheck %s ; RUN: opt < %s -asan -asan-realign-stack=32 -asan-force-dynamic-shadow -S | FileCheck %s +; RUN: opt < %s -asan -asan-realign-stack=32 -asan-mapping-scale=5 -S | FileCheck %s +; RUN: opt < %s -asan -asan-realign-stack=32 -asan-force-dynamic-shadow -asan-mapping-scale=5 -S | FileCheck %s target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" Index: llvm/trunk/test/Instrumentation/AddressSanitizer/stack_dynamic_alloca.ll =================================================================== --- llvm/trunk/test/Instrumentation/AddressSanitizer/stack_dynamic_alloca.ll +++ llvm/trunk/test/Instrumentation/AddressSanitizer/stack_dynamic_alloca.ll @@ -1,5 +1,7 @@ ; RUN: opt < %s -asan -asan-module -asan-stack-dynamic-alloca \ ; RUN: -asan-use-after-return -S | FileCheck %s +; RUN: opt < %s -asan -asan-module -asan-stack-dynamic-alloca -asan-mapping-scale=5 \ +; RUN: -asan-use-after-return -S | FileCheck %s target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" Index: llvm/trunk/test/Instrumentation/AddressSanitizer/test64.ll =================================================================== --- llvm/trunk/test/Instrumentation/AddressSanitizer/test64.ll +++ llvm/trunk/test/Instrumentation/AddressSanitizer/test64.ll @@ -1,4 +1,5 @@ -; RUN: opt < %s -asan -asan-module -S | FileCheck %s +; RUN: opt < %s -asan -asan-module -S | FileCheck --check-prefixes=CHECK,CHECK-S3 %s +; RUN: opt < %s -asan -asan-module -asan-mapping-scale=5 -S | FileCheck --check-prefixes=CHECK,CHECK-S5 %s target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" target triple = "x86_64-unknown-linux-gnu" define i32 @read_4_bytes(i32* %a) sanitize_address { @@ -8,9 +9,11 @@ } ; CHECK-LABEL: @read_4_bytes ; CHECK-NOT: ret -; CHECK: lshr {{.*}} 3 -; Check for ASAN's Offset for 64-bit (7fff8000) -; CHECK-NEXT: add{{.*}}2147450880 +; CHECK-S3: lshr {{.*}} 3 +; CHECK-S5: lshr {{.*}} 5 +; Check for ASAN's Offset for 64-bit (7fff8000|7ffe0000) +; CHECK-S3-NEXT: add{{.*}}2147450880 +; CHECK-S5-NEXT: add{{.*}}2147352576 ; CHECK: ret define void @example_atomicrmw(i64* %ptr) nounwind uwtable sanitize_address { @@ -20,7 +23,8 @@ } ; CHECK-LABEL: @example_atomicrmw -; CHECK: lshr {{.*}} 3 +; CHECK-S3: lshr {{.*}} 3 +; CHECK-S5: lshr {{.*}} 5 ; CHECK: __asan_report_store8 ; CHECK-NOT: __asan_report ; CHECK: atomicrmw @@ -33,7 +37,8 @@ } ; CHECK-LABEL: @example_cmpxchg -; CHECK: lshr {{.*}} 3 +; CHECK-S3: lshr {{.*}} 3 +; CHECK-S5: lshr {{.*}} 5 ; CHECK: __asan_report_store8 ; CHECK-NOT: __asan_report ; CHECK: cmpxchg