Index: llvm/test/CMakeLists.txt =================================================================== --- llvm/test/CMakeLists.txt +++ llvm/test/CMakeLists.txt @@ -12,6 +12,7 @@ LLVM_LINK_LLVM_DYLIB ) +set (LLVM_ASAN_TEST_SHADOW_SCALE 3) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py @@ -153,8 +154,19 @@ add_custom_target(llvm-test-depends DEPENDS ${LLVM_TEST_DEPENDS}) set_target_properties(llvm-test-depends PROPERTIES FOLDER "Tests") +# Add testsute for testing ASan instrumentation with shadow scale of +# 5. +set (LLVM_ASAN_TEST_SHADOW_SCALE 5) +configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in + ${CMAKE_CURRENT_BINARY_DIR}/ShadowScale5/lit.site.cfg.py + MAIN_CONFIG + ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py + ) + add_lit_testsuite(check-llvm "Running the LLVM regression tests" ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR}/ShadowScale5/Instrumentation/AddressSanitizer DEPENDS ${LLVM_TEST_DEPENDS} ) set_target_properties(check-llvm PROPERTIES FOLDER "Tests") Index: llvm/test/Instrumentation/AddressSanitizer/ShadowScale3/lifetime-throw.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/ShadowScale3/lifetime-throw.ll +++ llvm/test/Instrumentation/AddressSanitizer/ShadowScale3/lifetime-throw.ll @@ -1,5 +1,5 @@ ; Test handling of llvm.lifetime intrinsics with C++ exceptions. -; RUN: opt < %s -asan -asan-module -asan-use-after-scope -asan-use-after-return=0 -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -asan-use-after-scope -asan-use-after-return=0 -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/test/Instrumentation/AddressSanitizer/ShadowScale3/lifetime-uar-uas.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/ShadowScale3/lifetime-uar-uas.ll +++ llvm/test/Instrumentation/AddressSanitizer/ShadowScale3/lifetime-uar-uas.ll @@ -1,8 +1,8 @@ ; Test handling of llvm.lifetime intrinsics in UAR/UAS modes. -; RUN: opt < %s -asan -asan-module -asan-use-after-return=0 -asan-use-after-scope=0 -S | FileCheck %s -; RUN: opt < %s -asan -asan-module -asan-use-after-return=1 -asan-use-after-scope=0 -S | FileCheck %s -; RUN: opt < %s -asan -asan-module -asan-use-after-return=0 -asan-use-after-scope=1 -S | FileCheck %s --check-prefix=CHECK-UAS -; RUN: opt < %s -asan -asan-module -asan-use-after-return=1 -asan-use-after-scope=1 -S | FileCheck %s --check-prefix=CHECK-UAS +; RUN: %opt_asan < %s -asan -asan-module -asan-use-after-return=0 -asan-use-after-scope=0 -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -asan-use-after-return=1 -asan-use-after-scope=0 -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -asan-use-after-return=0 -asan-use-after-scope=1 -S | FileCheck %s --check-prefix=CHECK-UAS +; RUN: %opt_asan < %s -asan -asan-module -asan-use-after-return=1 -asan-use-after-scope=1 -S | FileCheck %s --check-prefix=CHECK-UAS 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" Index: llvm/test/Instrumentation/AddressSanitizer/ShadowScale3/lifetime.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/ShadowScale3/lifetime.ll +++ llvm/test/Instrumentation/AddressSanitizer/ShadowScale3/lifetime.ll @@ -1,6 +1,6 @@ ; Test handling of llvm.lifetime intrinsics. -; RUN: opt < %s -asan -asan-module -asan-use-after-scope -asan-use-after-return=0 -S | FileCheck %s --check-prefixes=CHECK,CHECK-DEFAULT -; RUN: opt < %s -asan -asan-module -asan-use-after-scope -asan-use-after-return=0 -asan-instrument-dynamic-allocas=0 -S | FileCheck %s --check-prefixes=CHECK,CHECK-NO-DYNAMIC +; RUN: %opt_asan < %s -asan -asan-module -asan-use-after-scope -asan-use-after-return=0 -S | FileCheck %s --check-prefixes=CHECK,CHECK-DEFAULT +; RUN: %opt_asan < %s -asan -asan-module -asan-use-after-scope -asan-use-after-return=0 -asan-instrument-dynamic-allocas=0 -S | FileCheck %s --check-prefixes=CHECK,CHECK-NO-DYNAMIC 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/test/Instrumentation/AddressSanitizer/ShadowScale3/lit.local.cfg =================================================================== --- /dev/null +++ llvm/test/Instrumentation/AddressSanitizer/ShadowScale3/lit.local.cfg @@ -0,0 +1,2 @@ +if config.asan_test_shadow_scale != '3': + config.unsupported = True Index: llvm/test/Instrumentation/AddressSanitizer/ShadowScale3/stack-poisoning-and-lifetime-be.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/ShadowScale3/stack-poisoning-and-lifetime-be.ll +++ llvm/test/Instrumentation/AddressSanitizer/ShadowScale3/stack-poisoning-and-lifetime-be.ll @@ -1,8 +1,8 @@ ; Regular stack poisoning. -; RUN: opt < %s -asan -asan-module -asan-use-after-scope=0 -S | FileCheck --check-prefixes=CHECK,ENTRY,EXIT %s +; RUN: %opt_asan < %s -asan -asan-module -asan-use-after-scope=0 -S | FileCheck --check-prefixes=CHECK,ENTRY,EXIT %s ; Stack poisoning with stack-use-after-scope. -; RUN: opt < %s -asan -asan-module -asan-use-after-scope=1 -S | FileCheck --check-prefixes=CHECK,ENTRY-UAS,EXIT-UAS %s +; RUN: %opt_asan < %s -asan -asan-module -asan-use-after-scope=1 -S | FileCheck --check-prefixes=CHECK,ENTRY-UAS,EXIT-UAS %s target datalayout = "E-m:e-i64:64-n32:64" target triple = "powerpc64-unknown-linux-gnu" Index: llvm/test/Instrumentation/AddressSanitizer/ShadowScale3/stack-poisoning-and-lifetime.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/ShadowScale3/stack-poisoning-and-lifetime.ll +++ llvm/test/Instrumentation/AddressSanitizer/ShadowScale3/stack-poisoning-and-lifetime.ll @@ -1,8 +1,8 @@ ; Regular stack poisoning. -; RUN: opt < %s -asan -asan-module -asan-use-after-scope=0 -S | FileCheck --check-prefixes=CHECK,ENTRY,EXIT %s +; RUN: %opt_asan < %s -asan -asan-module -asan-use-after-scope=0 -S | FileCheck --check-prefixes=CHECK,ENTRY,EXIT %s ; Stack poisoning with stack-use-after-scope. -; RUN: opt < %s -asan -asan-module -asan-use-after-scope=1 -S | FileCheck --check-prefixes=CHECK,ENTRY-UAS,EXIT-UAS %s +; RUN: %opt_asan < %s -asan -asan-module -asan-use-after-scope=1 -S | FileCheck --check-prefixes=CHECK,ENTRY-UAS,EXIT-UAS %s target datalayout = "e-i64:64-f80:128-s:64-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" Index: llvm/test/Instrumentation/AddressSanitizer/ShadowScale3/stack-poisoning.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/ShadowScale3/stack-poisoning.ll +++ llvm/test/Instrumentation/AddressSanitizer/ShadowScale3/stack-poisoning.ll @@ -1,5 +1,5 @@ -; RUN: opt < %s -asan -asan-module -asan-use-after-return -S | FileCheck --check-prefix=CHECK-UAR %s -; RUN: opt < %s -asan -asan-module -asan-use-after-return=0 -S | FileCheck --check-prefix=CHECK-PLAIN %s +; RUN: %opt_asan < %s -asan -asan-module -asan-use-after-return -S | FileCheck --check-prefix=CHECK-UAR %s +; RUN: %opt_asan < %s -asan -asan-module -asan-use-after-return=0 -S | FileCheck --check-prefix=CHECK-PLAIN %s target datalayout = "e-i64:64-f80:128-s:64-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" Index: llvm/test/Instrumentation/AddressSanitizer/ShadowScale3/stack_layout.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/ShadowScale3/stack_layout.ll +++ llvm/test/Instrumentation/AddressSanitizer/ShadowScale3/stack_layout.ll @@ -1,8 +1,8 @@ ; Test the ASan's stack layout. ; More tests in tests/Transforms/Utils/ASanStackFrameLayoutTest.cpp -; RUN: opt < %s -asan -asan-module -asan-stack-dynamic-alloca=0 -asan-use-after-scope -S \ +; RUN: %opt_asan < %s -asan -asan-module -asan-stack-dynamic-alloca=0 -asan-use-after-scope -S \ ; RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-STATIC -; RUN: opt < %s -asan -asan-module -asan-stack-dynamic-alloca=1 -asan-use-after-scope -S \ +; RUN: %opt_asan < %s -asan -asan-module -asan-stack-dynamic-alloca=1 -asan-use-after-scope -S \ ; RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-DYNAMIC 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" Index: llvm/test/Instrumentation/AddressSanitizer/X86/asm_cpuid.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/X86/asm_cpuid.ll +++ llvm/test/Instrumentation/AddressSanitizer/X86/asm_cpuid.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -asan -S -o %t.ll +; RUN: %opt_asan < %s -asan -S -o %t.ll ; RUN: FileCheck %s < %t.ll ; RUN: llc < %t.ll | FileCheck %s --check-prefix=ASM Index: llvm/test/Instrumentation/AddressSanitizer/X86/lit.local.cfg =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/X86/lit.local.cfg +++ llvm/test/Instrumentation/AddressSanitizer/X86/lit.local.cfg @@ -1,3 +1,5 @@ if not 'X86' in config.root.targets: config.unsupported = True +if config.asan_test_shadow_scale != '3': + config.unsupported = True Index: llvm/test/Instrumentation/AddressSanitizer/adaptive_global_redzones.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/adaptive_global_redzones.ll +++ llvm/test/Instrumentation/AddressSanitizer/adaptive_global_redzones.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -asan -asan-module -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -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/test/Instrumentation/AddressSanitizer/asan-masked-load-store.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/asan-masked-load-store.ll +++ llvm/test/Instrumentation/AddressSanitizer/asan-masked-load-store.ll @@ -1,10 +1,10 @@ -; RUN: opt < %s -asan -asan-instrumentation-with-call-threshold=0 -S \ +; RUN: %opt_asan < %s -asan -asan-instrumentation-with-call-threshold=0 -S \ ; RUN: | FileCheck %s -check-prefix=LOAD -check-prefix=STORE -check-prefix=ALL -; RUN: opt < %s -asan -asan-instrumentation-with-call-threshold=0 -asan-instrument-reads=0 -S \ +; RUN: %opt_asan < %s -asan -asan-instrumentation-with-call-threshold=0 -asan-instrument-reads=0 -S \ ; RUN: | FileCheck %s -check-prefix=NOLOAD -check-prefix=STORE -check-prefix=ALL -; RUN: opt < %s -asan -asan-instrumentation-with-call-threshold=0 -asan-instrument-writes=0 -S \ +; RUN: %opt_asan < %s -asan -asan-instrumentation-with-call-threshold=0 -asan-instrument-writes=0 -S \ ; RUN: | FileCheck %s -check-prefix=LOAD -check-prefix=NOSTORE -check-prefix=ALL -; RUN: opt < %s -asan -asan-instrumentation-with-call-threshold=0 -asan-instrument-reads=0 -asan-instrument-writes=0 -S \ +; RUN: %opt_asan < %s -asan -asan-instrumentation-with-call-threshold=0 -asan-instrument-reads=0 -asan-instrument-writes=0 -S \ ; RUN: | FileCheck %s -check-prefix=NOLOAD -check-prefix=NOSTORE -check-prefix=ALL ; Support ASan instrumentation for constant-mask llvm.masked.{load,store} Index: llvm/test/Instrumentation/AddressSanitizer/asan-vs-gvn.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/asan-vs-gvn.ll +++ llvm/test/Instrumentation/AddressSanitizer/asan-vs-gvn.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -basicaa -gvn -asan -asan-module -S | FileCheck %s +; RUN: %opt_asan < %s -basicaa -gvn -asan -asan-module -S | FileCheck %s ; ASAN conflicts with load widening iff the widened load accesses data out of bounds ; (while the original unwidened loads do not). ; http://code.google.com/p/address-sanitizer/issues/detail?id=20#c1 Index: llvm/test/Instrumentation/AddressSanitizer/asan_address_space_attr.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/asan_address_space_attr.ll +++ llvm/test/Instrumentation/AddressSanitizer/asan_address_space_attr.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -asan -S | FileCheck %s +; RUN: %opt_asan < %s -asan -S | FileCheck %s target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-macosx10.11.0" Index: llvm/test/Instrumentation/AddressSanitizer/basic-msvc64.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/basic-msvc64.ll +++ llvm/test/Instrumentation/AddressSanitizer/basic-msvc64.ll @@ -1,6 +1,6 @@ ; Test basic address sanitizer instrumentation. ; -; RUN: opt -asan -asan-module -S < %s | FileCheck %s +; RUN: %opt_asan -asan -asan-module -S < %s | FileCheck %s target triple = "x86_64-pc-windows-msvc" ; CHECK: @llvm.global_ctors = {{.*}}@asan.module_ctor Index: llvm/test/Instrumentation/AddressSanitizer/basic.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/basic.ll +++ llvm/test/Instrumentation/AddressSanitizer/basic.ll @@ -1,6 +1,6 @@ ; Test basic address sanitizer instrumentation. ; -; RUN: opt < %s -asan -asan-module -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -S | FileCheck --check-prefixes=CHECK,CHECK-S%scale %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 +10,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 +19,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 +45,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 +54,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/test/Instrumentation/AddressSanitizer/debug-info-global-var.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/debug-info-global-var.ll +++ llvm/test/Instrumentation/AddressSanitizer/debug-info-global-var.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -asan -asan-module -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -S | FileCheck %s source_filename = "version.c" target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-macosx10.12.0" Index: llvm/test/Instrumentation/AddressSanitizer/debug_info.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/debug_info.ll +++ llvm/test/Instrumentation/AddressSanitizer/debug_info.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -asan -asan-module -asan-use-after-return=0 -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -asan-use-after-return=0 -S | FileCheck %s ; Checks that llvm.dbg.declare instructions are updated ; accordingly as we merge allocas. Index: llvm/test/Instrumentation/AddressSanitizer/debug_info_noninstrumented_alloca.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/debug_info_noninstrumented_alloca.ll +++ llvm/test/Instrumentation/AddressSanitizer/debug_info_noninstrumented_alloca.ll @@ -2,8 +2,8 @@ ; Only first-basic-block allocas are considered stack slots, and moving them ; breaks debug info. -; RUN: opt < %s -asan -asan-module -S | FileCheck %s -; RUN: opt < %s -asan -asan-module -asan-instrument-dynamic-allocas -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -asan-instrument-dynamic-allocas -S | FileCheck %s target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-macosx10.10.0" Index: llvm/test/Instrumentation/AddressSanitizer/debug_info_noninstrumented_alloca2.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/debug_info_noninstrumented_alloca2.ll +++ llvm/test/Instrumentation/AddressSanitizer/debug_info_noninstrumented_alloca2.ll @@ -1,7 +1,7 @@ ; Make sure we don't break the IR when moving non-instrumented allocas -; RUN: opt < %s -asan -asan-module -S | FileCheck %s -; RUN: opt < %s -asan -asan-module -asan-instrument-dynamic-allocas -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -asan-instrument-dynamic-allocas -S | FileCheck %s target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-macosx10.10.0" Index: llvm/test/Instrumentation/AddressSanitizer/do-not-instrument-globals-darwin.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/do-not-instrument-globals-darwin.ll +++ llvm/test/Instrumentation/AddressSanitizer/do-not-instrument-globals-darwin.ll @@ -1,6 +1,6 @@ ; This test checks that we are not instrumenting unnecessary globals ; (llvm.metadata and other llvm internal globals). -; RUN: opt < %s -asan -asan-module -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -S | FileCheck %s target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-macosx10.10.0" Index: llvm/test/Instrumentation/AddressSanitizer/do-not-instrument-globals-linux.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/do-not-instrument-globals-linux.ll +++ llvm/test/Instrumentation/AddressSanitizer/do-not-instrument-globals-linux.ll @@ -1,6 +1,6 @@ ; This test checks that we are not instrumenting unnecessary globals ; (llvm.metadata, init_array sections, and other llvm internal globals). -; RUN: opt < %s -asan -asan-module -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -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/test/Instrumentation/AddressSanitizer/do-not-instrument-internal-globals.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/do-not-instrument-internal-globals.ll +++ llvm/test/Instrumentation/AddressSanitizer/do-not-instrument-internal-globals.ll @@ -1,6 +1,6 @@ ; This test checks that we are not instrumenting globals ; that we created ourselves. -; RUN: opt < %s -asan -asan-module -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -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/test/Instrumentation/AddressSanitizer/do-not-instrument-profiling-globals.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/do-not-instrument-profiling-globals.ll +++ llvm/test/Instrumentation/AddressSanitizer/do-not-instrument-profiling-globals.ll @@ -1,5 +1,5 @@ ; This test checks that we don't instrument globals created by profiling passes. -; RUN: opt < %s -asan -asan-module -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -S | FileCheck %s @__profc_test = private global [1 x i64] zeroinitializer, section "__DATA,__llvm_prf_cnts", align 8 @__llvm_gcov_ctr = internal global [1 x i64] zeroinitializer Index: llvm/test/Instrumentation/AddressSanitizer/do-not-instrument-promotable-allocas.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/do-not-instrument-promotable-allocas.ll +++ llvm/test/Instrumentation/AddressSanitizer/do-not-instrument-promotable-allocas.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -asan -asan-module -asan-instrument-dynamic-allocas -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -asan-instrument-dynamic-allocas -S | FileCheck %s target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-macosx10.10.0" Index: llvm/test/Instrumentation/AddressSanitizer/do-not-instrument-sanitizers.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/do-not-instrument-sanitizers.ll +++ llvm/test/Instrumentation/AddressSanitizer/do-not-instrument-sanitizers.ll @@ -1,5 +1,5 @@ ; This test checks that we are not instrumenting sanitizer code. -; RUN: opt < %s -asan -asan-module -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -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/test/Instrumentation/AddressSanitizer/do-not-touch-comdat-global.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/do-not-touch-comdat-global.ll +++ llvm/test/Instrumentation/AddressSanitizer/do-not-touch-comdat-global.ll @@ -1,6 +1,6 @@ ; This test checks that we instrument regular globals, but do not touch ; the COMDAT ones. -; RUN: opt < %s -asan -asan-module -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -S | FileCheck %s target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32" target triple = "i686-pc-windows-msvc" ; no action should be taken for these globals Index: llvm/test/Instrumentation/AddressSanitizer/do-not-touch-odr-global.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/do-not-touch-odr-global.ll +++ llvm/test/Instrumentation/AddressSanitizer/do-not-touch-odr-global.ll @@ -1,6 +1,6 @@ ; This test checks that we instrument regular globals, but do not touch ; the linkonce_odr ones. -; RUN: opt < %s -asan -asan-module -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -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" ; no action should be taken for these globals Index: llvm/test/Instrumentation/AddressSanitizer/do-not-touch-threadlocal.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/do-not-touch-threadlocal.ll +++ llvm/test/Instrumentation/AddressSanitizer/do-not-touch-threadlocal.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -asan -asan-module -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -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" ; no action should be taken for thread locals Index: llvm/test/Instrumentation/AddressSanitizer/experiment-call.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/experiment-call.ll +++ llvm/test/Instrumentation/AddressSanitizer/experiment-call.ll @@ -1,6 +1,6 @@ ; Test optimization experiments. ; -asan-force-experiment flag turns all memory accesses into experiments. -; RUN: opt < %s -asan -asan-module -asan-force-experiment=42 -asan-instrumentation-with-call-threshold=0 -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -asan-force-experiment=42 -asan-instrumentation-with-call-threshold=0 -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/test/Instrumentation/AddressSanitizer/experiment.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/experiment.ll +++ llvm/test/Instrumentation/AddressSanitizer/experiment.ll @@ -1,6 +1,6 @@ ; Test optimization experiments. ; -asan-force-experiment flag turns all memory accesses into experiments. -; RUN: opt < %s -asan -asan-module -asan-force-experiment=42 -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -asan-force-experiment=42 -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/test/Instrumentation/AddressSanitizer/force-dynamic-shadow.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/force-dynamic-shadow.ll +++ llvm/test/Instrumentation/AddressSanitizer/force-dynamic-shadow.ll @@ -1,7 +1,7 @@ ; Test -asan-force-dynamic-shadow flag. ; -; RUN: opt -asan -asan-module -S -asan-force-dynamic-shadow=1 < %s | FileCheck %s --check-prefixes=CHECK,CHECK-FDS -; RUN: opt -asan -asan-module -S -asan-force-dynamic-shadow=0 < %s | FileCheck %s --check-prefixes=CHECK,CHECK-NDS +; RUN: %opt_asan -asan -asan-module -S -asan-force-dynamic-shadow=1 < %s | FileCheck %s --check-prefixes=CHECK,CHECK-FDS +; RUN: %opt_asan -asan -asan-module -S -asan-force-dynamic-shadow=0 < %s | FileCheck %s --check-prefixes=CHECK,CHECK-NDS target triple = "x86_64-unknown-linux-gnu" Index: llvm/test/Instrumentation/AddressSanitizer/freebsd.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/freebsd.ll +++ llvm/test/Instrumentation/AddressSanitizer/freebsd.ll @@ -1,12 +1,12 @@ -; RUN: opt < %s -asan -asan-module -S \ +; RUN: %opt_asan < %s -asan -asan-module -S \ ; RUN: -mtriple=i386-unknown-freebsd \ ; RUN: -data-layout="e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128" | \ -; RUN: FileCheck --check-prefix=CHECK-32 %s +; RUN: FileCheck --check-prefixes=CHECK-32,CHECK-32-S%scale %s -; RUN: opt < %s -asan -asan-module -S \ +; RUN: %opt_asan < %s -asan -asan-module -S \ ; RUN: -mtriple=x86_64-unknown-freebsd \ ; RUN: -data-layout="e-m:e-i64:64-f80:128-n8:16:32:64-S128" | \ -; RUN: FileCheck --check-prefix=CHECK-64 %s +; RUN: FileCheck --check-prefixes=CHECK-64,CHECK-64-S%scale %s define i32 @read_4_bytes(i32* %a) sanitize_address { entry: @@ -17,13 +17,15 @@ ; CHECK-32: @read_4_bytes ; CHECK-32-NOT: ret ; Check for ASAN's Offset for 32-bit (2^30 or 0x40000000) -; CHECK-32: lshr {{.*}} 3 +; CHECK-32-S3: lshr {{.*}} 3 +; CHECK-32-S5: lshr {{.*}} 5 ; CHECK-32-NEXT: {{1073741824}} ; CHECK-32: ret ; CHECK-64: @read_4_bytes ; CHECK-64-NOT: ret ; Check for ASAN's Offset for 64-bit (2^46 or 0x400000000000) -; CHECK-64: lshr {{.*}} 3 +; CHECK-64-S3: lshr {{.*}} 3 +; CHECK-64-S5: lshr {{.*}} 5 ; CHECK-64-NEXT: {{70368744177664}} ; CHECK-64: ret Index: llvm/test/Instrumentation/AddressSanitizer/global_cstring_darwin.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/global_cstring_darwin.ll +++ llvm/test/Instrumentation/AddressSanitizer/global_cstring_darwin.ll @@ -1,5 +1,5 @@ ; This test checks that instrumented global C (null terminated) strings are put into a special section on Darwin. -; RUN: opt < %s -asan -asan-module -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -S | FileCheck %s target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-macosx10.10.0" Index: llvm/test/Instrumentation/AddressSanitizer/global_metadata.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/global_metadata.ll +++ llvm/test/Instrumentation/AddressSanitizer/global_metadata.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -asan -asan-module -asan-globals-live-support=1 -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -asan-globals-live-support=1 -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/test/Instrumentation/AddressSanitizer/global_metadata_array.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/global_metadata_array.ll +++ llvm/test/Instrumentation/AddressSanitizer/global_metadata_array.ll @@ -1,6 +1,6 @@ -; 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_asan < %s -asan -asan-module -asan-globals-live-support=0 -mtriple=x86_64-unknown-linux-gnu -S | FileCheck --check-prefixes=CHECK,CHECK-S%scale %s +; RUN: %opt_asan < %s -asan -asan-module -asan-globals-live-support=0 -mtriple=x86_64-apple-macosx10.11.0 -S | FileCheck --check-prefixes=CHECK,CHECK-S%scale %s +; RUN: %opt_asan < %s -asan -asan-module -asan-globals-live-support=0 -mtriple=x86_64-pc-windows-msvc19.0.24215 -S | FileCheck --check-prefixes=CHECK,CHECK-S%scale %s target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" Index: llvm/test/Instrumentation/AddressSanitizer/global_metadata_darwin.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/global_metadata_darwin.ll +++ llvm/test/Instrumentation/AddressSanitizer/global_metadata_darwin.ll @@ -2,7 +2,7 @@ ; allowing dead stripping to be performed, and that the appropriate runtime ; routines are invoked. -; RUN: opt < %s -asan -asan-module -asan-globals-live-support=1 -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -asan-globals-live-support=1 -S | FileCheck %s target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-macosx10.11.0" Index: llvm/test/Instrumentation/AddressSanitizer/global_metadata_windows.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/global_metadata_windows.ll +++ llvm/test/Instrumentation/AddressSanitizer/global_metadata_windows.ll @@ -4,7 +4,7 @@ ; FIXME: Later we can use this to instrument linkonce odr string literals. -; RUN: opt < %s -asan -asan-module -asan-globals-live-support=1 -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -asan-globals-live-support=1 -S | FileCheck %s target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-windows-msvc19.0.24215" Index: llvm/test/Instrumentation/AddressSanitizer/instrument-dynamic-allocas.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/instrument-dynamic-allocas.ll +++ llvm/test/Instrumentation/AddressSanitizer/instrument-dynamic-allocas.ll @@ -1,7 +1,7 @@ ; Test asan internal compiler flags: ; -asan-instrument-dynamic-allocas -; RUN: opt < %s -asan -asan-module -asan-instrument-dynamic-allocas -S | FileCheck %s --check-prefix=CHECK-ALLOCA +; RUN: %opt_asan < %s -asan -asan-module -asan-instrument-dynamic-allocas -S | FileCheck %s --check-prefix=CHECK-ALLOCA 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/test/Instrumentation/AddressSanitizer/instrument-no-return.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/instrument-no-return.ll +++ llvm/test/Instrumentation/AddressSanitizer/instrument-no-return.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -asan -asan-module -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -S | FileCheck %s ; AddressSanitizer must insert __asan_handle_no_return ; before every noreturn call or invoke. Index: llvm/test/Instrumentation/AddressSanitizer/instrument-stack.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/instrument-stack.ll +++ llvm/test/Instrumentation/AddressSanitizer/instrument-stack.ll @@ -1,5 +1,5 @@ ; 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_asan < %s -asan -asan-module -asan-opt-stack -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/test/Instrumentation/AddressSanitizer/instrument_global.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/instrument_global.ll +++ llvm/test/Instrumentation/AddressSanitizer/instrument_global.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -asan -asan-module -asan-globals-live-support=1 -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -asan-globals-live-support=1 -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/test/Instrumentation/AddressSanitizer/instrument_initializer_metadata.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/instrument_initializer_metadata.ll +++ llvm/test/Instrumentation/AddressSanitizer/instrument_initializer_metadata.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -asan -asan-module -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -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/test/Instrumentation/AddressSanitizer/instrument_load_then_store.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/instrument_load_then_store.ll +++ llvm/test/Instrumentation/AddressSanitizer/instrument_load_then_store.ll @@ -1,6 +1,6 @@ ; Test that AddressSanitizer instruments "(*a)++" only once. -; RUN: opt < %s -asan -asan-module -S -asan-opt=1 | FileCheck %s -check-prefix=OPT1 -; RUN: opt < %s -asan -asan-module -S -asan-opt=0 | FileCheck %s -check-prefix=OPT0 +; RUN: %opt_asan < %s -asan -asan-module -S -asan-opt=1 | FileCheck %s -check-prefix=OPT1 +; RUN: %opt_asan < %s -asan -asan-module -S -asan-opt=0 | FileCheck %s -check-prefix=OPT0 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/test/Instrumentation/AddressSanitizer/instrumentation-with-call-threshold.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/instrumentation-with-call-threshold.ll +++ llvm/test/Instrumentation/AddressSanitizer/instrumentation-with-call-threshold.ll @@ -2,11 +2,11 @@ ; -asan-instrumentation-with-call-threshold ; -asan-memory-access-callback-prefix -; RUN: opt < %s -asan -asan-module -asan-instrumentation-with-call-threshold=1 -S | FileCheck %s --check-prefix=CHECK-CALL -; RUN: opt < %s -asan -asan-module -asan-instrumentation-with-call-threshold=0 -S | FileCheck %s --check-prefix=CHECK-CALL -; RUN: opt < %s -asan -asan-module -asan-instrumentation-with-call-threshold=0 -asan-memory-access-callback-prefix=__foo_ -S | FileCheck %s --check-prefix=CHECK-CUSTOM-PREFIX -; RUN: opt < %s -asan -asan-module -asan-instrumentation-with-call-threshold=5 -S | FileCheck %s --check-prefix=CHECK-INLINE -; RUN: opt < %s -asan -asan-module -S | FileCheck %s --check-prefix=CHECK-INLINE +; RUN: %opt_asan < %s -asan -asan-module -asan-instrumentation-with-call-threshold=1 -S | FileCheck %s --check-prefix=CHECK-CALL +; RUN: %opt_asan < %s -asan -asan-module -asan-instrumentation-with-call-threshold=0 -S | FileCheck %s --check-prefix=CHECK-CALL +; RUN: %opt_asan < %s -asan -asan-module -asan-instrumentation-with-call-threshold=0 -asan-memory-access-callback-prefix=__foo_ -S | FileCheck %s --check-prefix=CHECK-CUSTOM-PREFIX +; RUN: %opt_asan < %s -asan -asan-module -asan-instrumentation-with-call-threshold=5 -S | FileCheck %s --check-prefix=CHECK-INLINE +; RUN: %opt_asan < %s -asan -asan-module -S | FileCheck %s --check-prefix=CHECK-INLINE 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/test/Instrumentation/AddressSanitizer/keep_going.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/keep_going.ll +++ llvm/test/Instrumentation/AddressSanitizer/keep_going.ll @@ -1,7 +1,7 @@ ; Test asan internal compiler flags: ; -asan-recover=1 -; RUN: opt < %s -asan -asan-recover -asan-module -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-recover -asan-module -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/test/Instrumentation/AddressSanitizer/local_alias.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/local_alias.ll +++ llvm/test/Instrumentation/AddressSanitizer/local_alias.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -asan -asan-module -asan-use-private-alias=1 -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -asan-use-private-alias=1 -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/test/Instrumentation/AddressSanitizer/localescape.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/localescape.ll +++ llvm/test/Instrumentation/AddressSanitizer/localescape.ll @@ -1,5 +1,5 @@ -; RUN: opt < %s -asan -asan-module -asan-use-after-return -asan-stack-dynamic-alloca -S | FileCheck %s -; RUN: opt < %s -asan -asan-module -asan-use-after-return=0 -asan-stack-dynamic-alloca=0 -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -asan-use-after-return -asan-stack-dynamic-alloca -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -asan-use-after-return=0 -asan-stack-dynamic-alloca=0 -S | FileCheck %s target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32" target triple = "i686-pc-windows-msvc18.0.0" Index: llvm/test/Instrumentation/AddressSanitizer/no-globals.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/no-globals.ll +++ llvm/test/Instrumentation/AddressSanitizer/no-globals.ll @@ -1,5 +1,5 @@ ; A module with no asan-instrumented globals has no asan destructor, and has an asan constructor in a comdat. -; RUN: opt -mtriple=x86_64-unknown-linux-gnu < %s -asan -asan-module -asan-with-comdat=1 -asan-globals-live-support=1 -S | FileCheck %s +; RUN: %opt_asan -mtriple=x86_64-unknown-linux-gnu < %s -asan -asan-module -asan-with-comdat=1 -asan-globals-live-support=1 -S | FileCheck %s define void @f() { ret void Index: llvm/test/Instrumentation/AddressSanitizer/ps4.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/ps4.ll +++ llvm/test/Instrumentation/AddressSanitizer/ps4.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -asan -asan-module -S -mtriple=x86_64-scei-ps4 | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -S -mtriple=x86_64-scei-ps4 | FileCheck --check-prefixes=CHECK,CHECK-S%scale %s define i32 @read_4_bytes(i32* %a) sanitize_address { entry: @@ -9,6 +9,7 @@ ; CHECK: @read_4_bytes ; CHECK-NOT: ret ; Check for ASAN's Offset on the PS4 (2^40 or 0x10000000000) -; CHECK: lshr {{.*}} 3 +; CHECK-S3: lshr {{.*}} 3 +; CHECK-S5: lshr {{.*}} 5 ; CHECK-NEXT: {{1099511627776}} ; CHECK: ret Index: llvm/test/Instrumentation/AddressSanitizer/scale-offset.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/scale-offset.ll +++ llvm/test/Instrumentation/AddressSanitizer/scale-offset.ll @@ -1,6 +1,6 @@ ; 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-offset 0xc0ffee -asan-mapping-scale 0 -S | FileCheck --check-prefix=CHECK-BOTH %s target triple = "x86_64-unknown-linux-gnu" @@ -12,7 +12,8 @@ } ; CHECK-OFFSET-LABEL: @read_offset ; 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: ret Index: llvm/test/Instrumentation/AddressSanitizer/stack-poisoning-byval-args.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/stack-poisoning-byval-args.ll +++ llvm/test/Instrumentation/AddressSanitizer/stack-poisoning-byval-args.ll @@ -1,6 +1,6 @@ ; 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_asan < %s -asan -asan-realign-stack=32 -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-realign-stack=32 -asan-force-dynamic-shadow -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/test/Instrumentation/AddressSanitizer/stack_dynamic_alloca.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/stack_dynamic_alloca.ll +++ llvm/test/Instrumentation/AddressSanitizer/stack_dynamic_alloca.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -asan -asan-module -asan-stack-dynamic-alloca \ +; RUN: %opt_asan < %s -asan -asan-module -asan-stack-dynamic-alloca \ ; 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/test/Instrumentation/AddressSanitizer/str-nobuiltin.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/str-nobuiltin.ll +++ llvm/test/Instrumentation/AddressSanitizer/str-nobuiltin.ll @@ -1,6 +1,6 @@ ; Test marking string functions as nobuiltin in address sanitizer. ; -; RUN: opt < %s -asan -S | FileCheck %s +; RUN: %opt_asan < %s -asan -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/test/Instrumentation/AddressSanitizer/test64.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/test64.ll +++ llvm/test/Instrumentation/AddressSanitizer/test64.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -asan -asan-module -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -S | FileCheck --check-prefixes=CHECK,CHECK-S%scale %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 +8,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 +22,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 +36,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 Index: llvm/test/Instrumentation/AddressSanitizer/twice.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/twice.ll +++ llvm/test/Instrumentation/AddressSanitizer/twice.ll @@ -1,5 +1,5 @@ ; Check that the address sanitizer pass can be reused -; RUN: opt < %s -S -run-twice -asan +; RUN: %opt_asan < %s -S -run-twice -asan define void @foo(i64* %b) nounwind uwtable sanitize_address { entry: Index: llvm/test/Instrumentation/AddressSanitizer/ubsan.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/ubsan.ll +++ llvm/test/Instrumentation/AddressSanitizer/ubsan.ll @@ -1,6 +1,6 @@ ; ASan shouldn't instrument code added by UBSan. -; RUN: opt < %s -asan -asan-module -S | FileCheck %s +; RUN: %opt_asan < %s -asan -asan-module -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/test/lit.cfg.py =================================================================== --- llvm/test/lit.cfg.py +++ llvm/test/lit.cfg.py @@ -14,8 +14,12 @@ from lit.llvm.subst import FindTool from lit.llvm.subst import ToolSubst -# name: The name of this test suite. -config.name = 'LLVM' +# name: The name of this test suite. Append shadow scale value if it +# is non-default. +if config.asan_test_shadow_scale != '3': + config.name = 'LLVM-Scale%s' % config.asan_test_shadow_scale +else: + config.name = 'LLVM' # testFormat: The test format to use to interpret tests. config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell) @@ -32,9 +36,6 @@ # test_source_root: The root path where tests are located. config.test_source_root = os.path.dirname(__file__) -# test_exec_root: The root path where tests should be run. -config.test_exec_root = os.path.join(config.llvm_obj_root, 'test') - # Tweak the PATH to include the tools dir. llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True) @@ -90,6 +91,13 @@ config.substitutions.append(('%shlibext', config.llvm_shlib_ext)) config.substitutions.append(('%exeext', config.llvm_exe_ext)) config.substitutions.append(('%host_cc', config.host_cc)) +if config.asan_test_shadow_scale == '3': + config.substitutions.append(('%opt_asan', 'opt')) +else: + config.substitutions.append(('%opt_asan', + 'opt -asan-mapping-scale %s' % + config.asan_test_shadow_scale)) +config.substitutions.append(('%scale', config.asan_test_shadow_scale)) lli_args = [] Index: llvm/test/lit.site.cfg.py.in =================================================================== --- llvm/test/lit.site.cfg.py.in +++ llvm/test/lit.site.cfg.py.in @@ -43,6 +43,7 @@ config.llvm_libxml2_enabled = "@LLVM_LIBXML2_ENABLED@" config.llvm_host_triple = '@LLVM_HOST_TRIPLE@' config.host_arch = "@HOST_ARCH@" +config.asan_test_shadow_scale = "@LLVM_ASAN_TEST_SHADOW_SCALE@" # Support substitution of the tools_dir with user parameters. This is # used when we can't determine the tool dir at configuration time.