1 ; Verify that calls with !nosanitize are not instrumented by MSan.
2 ; RUN: opt < %s -S -passes=msan 2>&1 | FileCheck %s
3 ; RUN: opt < %s -msan-track-origins=1 -S -passes=msan 2>&1 | FileCheck %s
4 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
5 target triple = "x86_64-unknown-linux-gnu"
7 declare void @bar(i32 %x)
10 call void @bar(i32 7), !nosanitize !{}
14 ; CHECK-LABEL: define void @foo
15 ; CHECK-NOT: store {{.*}} @__msan_param_tls
16 ; CHECK: call void @bar
20 @__sancov_gen_ = private global [1 x i8] zeroinitializer, section "__sancov_cntrs", align 1
21 define void @sancov() sanitize_memory {
23 %0 = load i8, ptr @__sancov_gen_, !nosanitize !{}
25 store i8 %1, ptr @__sancov_gen_, !nosanitize !{}
29 ; CHECK-LABEL: define void @sancov
31 ; CHECK-NOT: 87960930222080
35 define void @load_store() sanitize_memory {
37 %x = alloca i32, align 4, !nosanitize !{}
38 store i32 4, ptr %x, align 4, !nosanitize !{}
39 %0 = load i32, ptr %x, align 4, !nosanitize !{}
40 %add = add nsw i32 %0, %0
41 store i32 %add, ptr %x, align 4, !nosanitize !{}
45 ; CHECK-LABEL: define void @load_store
47 ; CHECK-NOT: 87960930222080