1; RUN: opt < %s -asan -S -enable-new-pm=0 | FileCheck %s
2; RUN: opt < %s -passes='asan-function-pipeline' -S | FileCheck %s
3
4; Test that for call instructions, the byref arguments are not
5; instrumented, as no copy is implied.
6
7target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
8target triple = "x86_64-unknown-linux-gnu"
9
10%struct.bar = type { %struct.foo }
11%struct.foo = type { i8*, i8*, i8* }
12
13; CHECK-LABEL: @func2
14; CHECK-NEXT: tail call void @func1(
15; CHECK-NEXT: ret void
16define dso_local void @func2(%struct.foo* %foo) sanitize_address {
17  tail call void @func1(%struct.foo* byref(%struct.foo) align 8 %foo) #2
18  ret void
19}
20
21declare dso_local void @func1(%struct.foo* byref(%struct.foo) align 8)
22