diff options
author | Kostya Serebryany <kcc@google.com> | 2013-02-26 06:58:09 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2013-02-26 06:58:09 +0000 |
commit | 8eec41fc778e99d42172a7f6de76faa43a6d8847 (patch) | |
tree | a6b89a9fb83eab1457104a996ea7798c9068ec10 /test/Instrumentation | |
parent | ce522ee0a27062390f13e7ccb53fcff4fc36c473 (diff) | |
download | external_llvm-8eec41fc778e99d42172a7f6de76faa43a6d8847.zip external_llvm-8eec41fc778e99d42172a7f6de76faa43a6d8847.tar.gz external_llvm-8eec41fc778e99d42172a7f6de76faa43a6d8847.tar.bz2 |
Unify clang/llvm attributes for asan/tsan/msan (LLVM part)
These are two related changes (one in llvm, one in clang).
LLVM:
- rename address_safety => sanitize_address (the enum value is the same, so we preserve binary compatibility with old bitcode)
- rename thread_safety => sanitize_thread
- rename no_uninitialized_checks -> sanitize_memory
CLANG:
- add __attribute__((no_sanitize_address)) as a synonym for __attribute__((no_address_safety_analysis))
- add __attribute__((no_sanitize_thread))
- add __attribute__((no_sanitize_memory))
for S in address thread memory
If -fsanitize=S is present and __attribute__((no_sanitize_S)) is not
set llvm attribute sanitize_S
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176075 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Instrumentation')
12 files changed, 31 insertions, 31 deletions
diff --git a/test/Instrumentation/AddressSanitizer/X86/bug_11395.ll b/test/Instrumentation/AddressSanitizer/X86/bug_11395.ll index 35c5c4a..38168fc 100644 --- a/test/Instrumentation/AddressSanitizer/X86/bug_11395.ll +++ b/test/Instrumentation/AddressSanitizer/X86/bug_11395.ll @@ -36,14 +36,14 @@ target triple = "i386-unknown-linux-gnu" @ff_mlp_firorder_7 = external global i8 @ff_mlp_firorder_8 = external global i8 -define void @ff_mlp_init_x86(%struct.DSPContext* nocapture %c, %struct.AVCodecContext* nocapture %avctx) nounwind address_safety { +define void @ff_mlp_init_x86(%struct.DSPContext* nocapture %c, %struct.AVCodecContext* nocapture %avctx) nounwind sanitize_address { entry: %mlp_filter_channel = getelementptr inbounds %struct.DSPContext* %c, i32 0, i32 131 store void (i32*, i32*, i32, i32, i32, i32, i32, i32*)* @mlp_filter_channel_x86, void (i32*, i32*, i32, i32, i32, i32, i32, i32*)** %mlp_filter_channel, align 4, !tbaa !0 ret void } -define internal void @mlp_filter_channel_x86(i32* %state, i32* %coeff, i32 %firorder, i32 %iirorder, i32 %filter_shift, i32 %mask, i32 %blocksize, i32* %sample_buffer) nounwind address_safety { +define internal void @mlp_filter_channel_x86(i32* %state, i32* %coeff, i32 %firorder, i32 %iirorder, i32 %filter_shift, i32 %mask, i32 %blocksize, i32* %sample_buffer) nounwind sanitize_address { entry: %filter_shift.addr = alloca i32, align 4 %mask.addr = alloca i32, align 4 diff --git a/test/Instrumentation/AddressSanitizer/asan-vs-gvn.ll b/test/Instrumentation/AddressSanitizer/asan-vs-gvn.ll index c0fe15e..da8f541 100644 --- a/test/Instrumentation/AddressSanitizer/asan-vs-gvn.ll +++ b/test/Instrumentation/AddressSanitizer/asan-vs-gvn.ll @@ -11,9 +11,9 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 @f = global %struct_of_7_bytes_4_aligned zeroinitializer, align 4 -; Accessing bytes 4 and 6, not ok to widen to i32 if address_safety is set. +; Accessing bytes 4 and 6, not ok to widen to i32 if sanitize_address is set. -define i32 @test_widening_bad(i8* %P) nounwind ssp noredzone address_safety { +define i32 @test_widening_bad(i8* %P) nounwind ssp noredzone sanitize_address { entry: %tmp = load i8* getelementptr inbounds (%struct_of_7_bytes_4_aligned* @f, i64 0, i32 1), align 4 %conv = zext i8 %tmp to i32 @@ -36,7 +36,7 @@ define void @end_test_widening_bad() { ;; Accessing bytes 4 and 5. Ok to widen to i16. -define i32 @test_widening_ok(i8* %P) nounwind ssp noredzone address_safety { +define i32 @test_widening_ok(i8* %P) nounwind ssp noredzone sanitize_address { entry: %tmp = load i8* getelementptr inbounds (%struct_of_7_bytes_4_aligned* @f, i64 0, i32 1), align 4 %conv = zext i8 %tmp to i32 diff --git a/test/Instrumentation/AddressSanitizer/basic.ll b/test/Instrumentation/AddressSanitizer/basic.ll index 2f1b79e..c477b19 100644 --- a/test/Instrumentation/AddressSanitizer/basic.ll +++ b/test/Instrumentation/AddressSanitizer/basic.ll @@ -5,7 +5,7 @@ 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 @test_load(i32* %a) address_safety { +define i32 @test_load(i32* %a) sanitize_address { ; CHECK: @test_load ; CHECK-NOT: load ; CHECK: %[[LOAD_ADDR:[^ ]*]] = ptrtoint i32* %a to i64 @@ -38,7 +38,7 @@ entry: ret i32 %tmp1 } -define void @test_store(i32* %a) address_safety { +define void @test_store(i32* %a) sanitize_address { ; CHECK: @test_store ; CHECK-NOT: store ; CHECK: %[[STORE_ADDR:[^ ]*]] = ptrtoint i32* %a to i64 @@ -73,7 +73,7 @@ entry: ; Check that asan leaves just one alloca. declare void @alloca_test_use([10 x i8]*) -define void @alloca_test() address_safety { +define void @alloca_test() sanitize_address { entry: %x = alloca [10 x i8], align 1 %y = alloca [10 x i8], align 1 @@ -89,7 +89,7 @@ entry: ; CHECK-NOT: = alloca ; CHECK: ret void -define void @LongDoubleTest(x86_fp80* nocapture %a) nounwind uwtable address_safety { +define void @LongDoubleTest(x86_fp80* nocapture %a) nounwind uwtable sanitize_address { entry: store x86_fp80 0xK3FFF8000000000000000, x86_fp80* %a, align 16 ret void @@ -101,7 +101,7 @@ entry: ; CHECK: ret void -define void @i40test(i40* %a, i40* %b) nounwind uwtable address_safety { +define void @i40test(i40* %a, i40* %b) nounwind uwtable sanitize_address { entry: %t = load i40* %a store i40 %t, i40* %b, align 8 @@ -115,7 +115,7 @@ define void @i40test(i40* %a, i40* %b) nounwind uwtable address_safety { ; CHECK: __asan_report_store_n{{.*}}, i64 5) ; CHECK: ret void -define void @i80test(i80* %a, i80* %b) nounwind uwtable address_safety { +define void @i80test(i80* %a, i80* %b) nounwind uwtable sanitize_address { entry: %t = load i80* %a store i80 %t, i80* %b, align 8 diff --git a/test/Instrumentation/AddressSanitizer/debug_info.ll b/test/Instrumentation/AddressSanitizer/debug_info.ll index f686ac1..7822fd0 100644 --- a/test/Instrumentation/AddressSanitizer/debug_info.ll +++ b/test/Instrumentation/AddressSanitizer/debug_info.ll @@ -6,7 +6,7 @@ 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" -define i32 @_Z3zzzi(i32 %p) nounwind uwtable address_safety { +define i32 @_Z3zzzi(i32 %p) nounwind uwtable sanitize_address { entry: %p.addr = alloca i32, align 4 %r = alloca i32, align 4 diff --git a/test/Instrumentation/AddressSanitizer/different_scale_and_offset.ll b/test/Instrumentation/AddressSanitizer/different_scale_and_offset.ll index c07069c..b037176 100644 --- a/test/Instrumentation/AddressSanitizer/different_scale_and_offset.ll +++ b/test/Instrumentation/AddressSanitizer/different_scale_and_offset.ll @@ -9,7 +9,7 @@ target triple = "x86_64-unknown-linux-gnu" ; CHECK: @__asan_mapping_offset = linkonce_odr constant i64 0 ; CHECK: @__asan_mapping_scale = linkonce_odr constant i64 2 -define i32 @test_load(i32* %a) address_safety { +define i32 @test_load(i32* %a) sanitize_address { ; CHECK: @test_load ; CHECK-NOT: load ; CHECK: %[[LOAD_ADDR:[^ ]*]] = ptrtoint i32* %a to i64 diff --git a/test/Instrumentation/AddressSanitizer/do-not-instrument-internal-globals.ll b/test/Instrumentation/AddressSanitizer/do-not-instrument-internal-globals.ll index 28d4ac0..2efd6b1 100644 --- a/test/Instrumentation/AddressSanitizer/do-not-instrument-internal-globals.ll +++ b/test/Instrumentation/AddressSanitizer/do-not-instrument-internal-globals.ll @@ -5,7 +5,7 @@ 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" -define void @_Z3barv() uwtable address_safety { +define void @_Z3barv() uwtable sanitize_address { entry: %a = alloca i32, align 4 call void @_Z3fooPi(i32* %a) diff --git a/test/Instrumentation/AddressSanitizer/instrument-no-return.ll b/test/Instrumentation/AddressSanitizer/instrument-no-return.ll index 59654cb..2d835a3 100644 --- a/test/Instrumentation/AddressSanitizer/instrument-no-return.ll +++ b/test/Instrumentation/AddressSanitizer/instrument-no-return.ll @@ -7,7 +7,7 @@ target triple = "x86_64-unknown-linux-gnu" declare void @MyNoReturnFunc(i32) noreturn -define i32 @Call1(i8* nocapture %arg) uwtable address_safety { +define i32 @Call1(i8* nocapture %arg) uwtable sanitize_address { entry: call void @MyNoReturnFunc(i32 1) noreturn ; The call insn has noreturn attr. ; CHECK: @Call1 @@ -17,7 +17,7 @@ entry: unreachable } -define i32 @Call2(i8* nocapture %arg) uwtable address_safety { +define i32 @Call2(i8* nocapture %arg) uwtable sanitize_address { entry: call void @MyNoReturnFunc(i32 1) ; No noreturn attribure on the call. ; CHECK: @Call2 @@ -29,7 +29,7 @@ entry: declare i32 @__gxx_personality_v0(...) -define i64 @Invoke1(i8** %esc) nounwind uwtable ssp address_safety { +define i64 @Invoke1(i8** %esc) nounwind uwtable ssp sanitize_address { entry: invoke void @MyNoReturnFunc(i32 1) to label %invoke.cont unwind label %lpad diff --git a/test/Instrumentation/AddressSanitizer/instrument_initializer_metadata.ll b/test/Instrumentation/AddressSanitizer/instrument_initializer_metadata.ll index 042c06b..584db37 100644 --- a/test/Instrumentation/AddressSanitizer/instrument_initializer_metadata.ll +++ b/test/Instrumentation/AddressSanitizer/instrument_initializer_metadata.ll @@ -23,7 +23,7 @@ entry: ret void } -define internal void @_GLOBAL__I_a() address_safety section ".text.startup" { +define internal void @_GLOBAL__I_a() sanitize_address section ".text.startup" { entry: call void @__cxx_global_var_init() ret void @@ -40,7 +40,7 @@ entry: ; CHECK: ret ; Check that xxx is instrumented. -define void @touch_xxx() address_safety { +define void @touch_xxx() sanitize_address { store i32 0, i32 *@xxx, align 4 ret void ; CHECK: define void @touch_xxx @@ -49,7 +49,7 @@ define void @touch_xxx() address_safety { } ; Check that XXX is instrumented. -define void @touch_XXX() address_safety { +define void @touch_XXX() sanitize_address { store i32 0, i32 *@XXX, align 4 ret void ; CHECK: define void @touch_XXX @@ -59,7 +59,7 @@ define void @touch_XXX() address_safety { ; Check that yyy is NOT instrumented (as it does not have dynamic initializer). -define void @touch_yyy() address_safety { +define void @touch_yyy() sanitize_address { store i32 0, i32 *@yyy, align 4 ret void ; CHECK: define void @touch_yyy @@ -68,7 +68,7 @@ define void @touch_yyy() address_safety { } ; Check that YYY is NOT instrumented (as it does not have dynamic initializer). -define void @touch_YYY() address_safety { +define void @touch_YYY() sanitize_address { store i32 0, i32 *@YYY, align 4 ret void ; CHECK: define void @touch_YYY diff --git a/test/Instrumentation/AddressSanitizer/instrument_load_then_store.ll b/test/Instrumentation/AddressSanitizer/instrument_load_then_store.ll index 633bf9a..23cf6d2 100644 --- a/test/Instrumentation/AddressSanitizer/instrument_load_then_store.ll +++ b/test/Instrumentation/AddressSanitizer/instrument_load_then_store.ll @@ -4,7 +4,7 @@ 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 void @IncrementMe(i32* %a) address_safety { +define void @IncrementMe(i32* %a) sanitize_address { entry: %tmp1 = load i32* %a, align 4 %tmp2 = add i32 %tmp1, 1 diff --git a/test/Instrumentation/AddressSanitizer/lifetime.ll b/test/Instrumentation/AddressSanitizer/lifetime.ll index 982ad08..3348728 100644 --- a/test/Instrumentation/AddressSanitizer/lifetime.ll +++ b/test/Instrumentation/AddressSanitizer/lifetime.ll @@ -7,7 +7,7 @@ target triple = "x86_64-unknown-linux-gnu" declare void @llvm.lifetime.start(i64, i8* nocapture) nounwind declare void @llvm.lifetime.end(i64, i8* nocapture) nounwind -define void @lifetime_no_size() address_safety { +define void @lifetime_no_size() sanitize_address { entry: %i = alloca i32, align 4 %i.ptr = bitcast i32* %i to i8* @@ -23,7 +23,7 @@ entry: } ; Generic case of lifetime analysis. -define void @lifetime() address_safety { +define void @lifetime() sanitize_address { ; CHECK: @lifetime ; Regular variable lifetime intrinsics. @@ -61,7 +61,7 @@ define void @lifetime() address_safety { } ; Check that arguments of lifetime may come from phi nodes. -define void @phi_args(i1 %x) address_safety { +define void @phi_args(i1 %x) sanitize_address { ; CHECK: @phi_args entry: diff --git a/test/Instrumentation/AddressSanitizer/test64.ll b/test/Instrumentation/AddressSanitizer/test64.ll index b77869b..6aa5c28 100644 --- a/test/Instrumentation/AddressSanitizer/test64.ll +++ b/test/Instrumentation/AddressSanitizer/test64.ll @@ -1,7 +1,7 @@ ; RUN: opt < %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" -define i32 @read_4_bytes(i32* %a) address_safety { +define i32 @read_4_bytes(i32* %a) sanitize_address { entry: %tmp1 = load i32* %a, align 4 ret i32 %tmp1 @@ -13,7 +13,7 @@ entry: ; CHECK-NEXT: {{17592186044416|2147450880}} ; CHECK: ret -define void @example_atomicrmw(i64* %ptr) nounwind uwtable address_safety { +define void @example_atomicrmw(i64* %ptr) nounwind uwtable sanitize_address { entry: %0 = atomicrmw add i64* %ptr, i64 1 seq_cst ret void @@ -24,7 +24,7 @@ entry: ; CHECK: atomicrmw ; CHECK: ret -define void @example_cmpxchg(i64* %ptr, i64 %compare_to, i64 %new_value) nounwind uwtable address_safety { +define void @example_cmpxchg(i64* %ptr, i64 %compare_to, i64 %new_value) nounwind uwtable sanitize_address { entry: %0 = cmpxchg i64* %ptr, i64 %compare_to, i64 %new_value seq_cst ret void diff --git a/test/Instrumentation/ThreadSanitizer/tsan-vs-gvn.ll b/test/Instrumentation/ThreadSanitizer/tsan-vs-gvn.ll index 2eee6a5..a83a274 100644 --- a/test/Instrumentation/ThreadSanitizer/tsan-vs-gvn.ll +++ b/test/Instrumentation/ThreadSanitizer/tsan-vs-gvn.ll @@ -8,9 +8,9 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 @f = global %struct_of_8_bytes_4_aligned zeroinitializer, align 4 -; Accessing bytes 4 and 6, not ok to widen to i32 if thread_safety is set. +; Accessing bytes 4 and 6, not ok to widen to i32 if sanitize_thread is set. -define i32 @test_widening_bad(i8* %P) nounwind ssp noredzone thread_safety { +define i32 @test_widening_bad(i8* %P) nounwind ssp noredzone sanitize_thread { entry: %tmp = load i8* getelementptr inbounds (%struct_of_8_bytes_4_aligned* @f, i64 0, i32 1), align 4 %conv = zext i8 %tmp to i32 |