1 ; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=instructions --test FileCheck --test-arg --check-prefixes=CHECK,INTERESTING --test-arg %s --test-arg --input-file %s -o %t
2 ; RUN: FileCheck -check-prefixes=CHECK,RESULT %s < %t
4 %Foo = type { i32, i32 }
6 declare token @llvm.call.preallocated.setup(i32)
7 declare ptr @llvm.call.preallocated.arg(token, i32)
8 declare void @init(ptr)
9 declare void @foo_p(ptr preallocated(%Foo))
11 ; CHECK-LABEL: define void @preallocated_with_init() {
12 ; INTERESTING: call void @foo_p
14 ; RESULT: %t = call token @llvm.call.preallocated.setup(i32 1)
15 ; RESULT-NEXT: call void @foo_p(ptr preallocated(%Foo) null) [ "preallocated"(token %t) ]
16 ; RESULT-NEXT: ret void
17 define void @preallocated_with_init() {
18 %t = call token @llvm.call.preallocated.setup(i32 1)
19 %a = call ptr @llvm.call.preallocated.arg(token %t, i32 0) preallocated(%Foo)
20 call void @init(ptr %a)
21 call void @foo_p(ptr preallocated(%Foo) %a) ["preallocated"(token %t)]