brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · b0069d2 Raw
52 lines · plain
1; Test -msan-instrumentation-with-call-threshold2; Test that in with-calls mode there are no calls to __msan_chain_origin - they3; are done from __msan_maybe_store_origin_*.4 5; RUN: opt < %s -msan-check-access-address=0 -msan-instrumentation-with-call-threshold=0 -S -passes=msan 2>&1 | FileCheck %s6; RUN: opt < %s -msan-check-access-address=0 -msan-instrumentation-with-call-threshold=0 -msan-track-origins=1 -S -passes=msan 2>&1 | FileCheck -check-prefix=CHECK -check-prefix=CHECK-ORIGINS %s7; RUN: opt < %s -msan-check-access-address=0 -msan-instrumentation-with-call-threshold=0 -msan-track-origins=2 -S -passes=msan 2>&1 | FileCheck -check-prefix=CHECK -check-prefix=CHECK-ORIGINS %s8 9target 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"10target triple = "x86_64-unknown-linux-gnu"11 12define void @LoadAndCmp(ptr nocapture %a) nounwind uwtable sanitize_memory {13entry:14  %0 = load i32, ptr %a, align 415  %tobool = icmp eq i32 %0, 016  br i1 %tobool, label %if.end, label %if.then17 18if.then:                                          ; preds = %entry19  tail call void (...) @foo() nounwind20  br label %if.end21 22if.end:                                           ; preds = %entry, %if.then23  ret void24}25 26declare void @foo(...)27 28; CHECK-LABEL: @LoadAndCmp29; CHECK: = load30; CHECK: = load31; CHECK: = zext i1 {{.*}} to i832; CHECK: call void @__msan_maybe_warning_1(i8 zeroext {{.*}}, i32 zeroext {{.*}})33; CHECK-NOT: unreachable34; CHECK: ret void35 36 37define void @Store(ptr nocapture %p, i64 %x) nounwind uwtable sanitize_memory {38entry:39  store i64 %x, ptr %p, align 440  ret void41}42 43; CHECK-LABEL: @Store44; CHECK: load {{.*}} @__msan_param_tls45; CHECK-ORIGINS: load {{.*}} @__msan_param_origin_tls46; CHECK: store47; CHECK-ORIGINS-NOT: __msan_chain_origin48; CHECK-ORIGINS: call void @__msan_maybe_store_origin_8(i64 zeroext {{.*}}, ptr {{.*}}, i32 zeroext {{.*}})49; CHECK-ORIGINS-NOT: __msan_chain_origin50; CHECK: store i6451; CHECK: ret void52