1; RUN: llvm-link %s %p/Inputs/byref-type-input.ll -S | FileCheck %s
2
3%a = type { i64 }
4%struct = type { i32, i8 }
5
6; CHECK-LABEL: define void @f(%a* byref(%a) %0)
7define void @f(%a* byref(%a)) {
8  ret void
9}
10
11; CHECK-LABEL: define void @bar(
12; CHECK: call void @foo(%struct* byref(%struct) %ptr)
13define void @bar() {
14  %ptr = alloca %struct
15  call void @foo(%struct* byref(%struct) %ptr)
16  ret void
17}
18
19; CHECK-LABEL: define void @g(%a* byref(%a) %0)
20
21; CHECK-LABEL: define void @foo(%struct* byref(%struct) %a)
22; CHECK-NEXT:   call void @baz(%struct* byref(%struct) %a)
23declare void @foo(%struct* byref(%struct) %a)
24
25; CHECK: declare void @baz(%struct* byref(%struct))
26