xref: /llvm-project/llvm/test/Instrumentation/MemorySanitizer/byval-alignment.ll (revision fe7f5f9126cea9ceba703d5bd07b766181f2bd72)
1; Test that copy alignment for byval arguments is limited by param-tls slot alignment.
2
3; RUN: opt < %s -msan-check-access-address=0 -S -passes=msan 2>&1 | FileCheck %s
4
5target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
6target triple = "x86_64-unknown-linux-gnu"
7
8%struct.S = type { i64, i64, i64, [8 x i8] }
9
10; CHECK: call void @llvm.memcpy.p0.p0.i64(ptr align 8 {{.*}} add {{.*}} ptrtoint {{.*}} @__msan_param_tls {{.*}} i64 8) {{.*}}, ptr align 8 {{.*}}, i64 32, i1 false)
11
12define void @Caller() sanitize_memory {
13entry:
14  %agg.tmp = alloca %struct.S, align 16
15  call void @Callee(i32 1, ptr byval(%struct.S) align 16 %agg.tmp)
16  ret void
17}
18
19declare void @Callee(i32, ptr byval(%struct.S) align 16)
20