1 ; Test -msan-instrumentation-with-call-threshold
2 ; Test that in with-calls mode there are no calls to __msan_chain_origin - they
3 ; are done from __msan_maybe_store_origin_*.
5 ; RUN: opt < %s -msan-check-access-address=0 -msan-instrumentation-with-call-threshold=0 -S -passes=msan 2>&1 | FileCheck %s
6 ; 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 %s
7 ; 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 %s
9 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"
10 target triple = "x86_64-unknown-linux-gnu"
12 define void @LoadAndCmp(ptr nocapture %a) nounwind uwtable sanitize_memory {
14 %0 = load i32, ptr %a, align 4
15 %tobool = icmp eq i32 %0, 0
16 br i1 %tobool, label %if.end, label %if.then
18 if.then: ; preds = %entry
19 tail call void (...) @foo() nounwind
22 if.end: ; preds = %entry, %if.then
26 declare void @foo(...)
28 ; CHECK-LABEL: @LoadAndCmp
31 ; CHECK: = zext i1 {{.*}} to i8
32 ; CHECK: call void @__msan_maybe_warning_1(i8 zeroext {{.*}}, i32 zeroext {{.*}})
33 ; CHECK-NOT: unreachable
37 define void @Store(ptr nocapture %p, i64 %x) nounwind uwtable sanitize_memory {
39 store i64 %x, ptr %p, align 4
44 ; CHECK: load {{.*}} @__msan_param_tls
45 ; CHECK-ORIGINS: load {{.*}} @__msan_param_origin_tls
47 ; CHECK-ORIGINS-NOT: __msan_chain_origin
48 ; CHECK-ORIGINS: call void @__msan_maybe_store_origin_8(i64 zeroext {{.*}}, ptr {{.*}}, i32 zeroext {{.*}})
49 ; CHECK-ORIGINS-NOT: __msan_chain_origin