xref: /llvm-project/llvm/test/Linker/byref-types.ll (revision f2e868c566107eb2f54e3e6033199297ba11e2d9)
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(ptr byref(%a) %0)
7define void @f(ptr byref(%a)) {
8  ret void
9}
10
11; CHECK-LABEL: define void @bar(
12; CHECK: call void @foo(ptr byref(%struct) %ptr)
13define void @bar() {
14  %ptr = alloca %struct
15  call void @foo(ptr byref(%struct) %ptr)
16  ret void
17}
18
19; CHECK-LABEL: define void @g(ptr byref(%a) %0)
20
21; CHECK-LABEL: define void @foo(ptr byref(%struct) %a)
22; CHECK-NEXT:   call void @baz(ptr byref(%struct) %a)
23declare void @foo(ptr byref(%struct) %a)
24
25; CHECK: declare void @baz(ptr byref(%struct))
26