• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -msan-check-access-address=0 -msan-track-origins=2 -S          \
2; RUN: -passes=msan 2>&1 | FileCheck %s
3; RUN: opt < %s -msan -msan-check-access-address=0 -msan-track-origins=2 -S | FileCheck %s
4
5target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"
6target triple = "aarch64-unknown-linux-gnu"
7
8; Check origin handling of array types.
9
10define void @foo([2 x i64] %v, [2 x i64]* %p) sanitize_memory {
11entry:
12  store [2 x i64] %v, [2 x i64]* %p, align 8
13  ret void
14}
15
16; CHECK-LABEL: @foo
17; CHECK: [[PARAM:%[01-9a-z]+]] = load {{.*}} @__msan_param_tls
18; CHECK: [[ORIGIN:%[01-9a-z]+]] = load {{.*}} @__msan_param_origin_tls
19
20; CHECK: [[TMP1:%[01-9a-z]+]] = ptrtoint
21; CHECK: [[TMP2:%[01-9a-z]+]] = xor i64 [[TMP1]]
22; CHECK: [[TMP3:%[01-9a-z]+]] = inttoptr i64 [[TMP2]] to [2 x i64]*
23; CHECK: store [2 x i64] [[PARAM]], [2 x i64]* [[TMP3]]
24
25; CHECK: {{.*}} call i32 @__msan_chain_origin(i32 {{.*}}[[ORIGIN]])
26