xref: /llvm-project/llvm/test/tools/llvm-reduce/ifunc-nonsense-resolvers.ll (revision bc3e492323f34eb92f49897d22468aef2d831d5a)
1; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=ifuncs --test FileCheck --test-arg --check-prefixes=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t
2; RUN: FileCheck --check-prefixes=CHECK-FINAL --input-file=%t %s
3
4; Check some cases that should probably be invalid IR don't break
5; anything.
6
7; CHECK-FINAL: @ifunc_with_arg = ifunc void (), ptr @resolver_with_arg
8@ifunc_with_arg = ifunc void (), ptr @resolver_with_arg
9
10define ptr @resolver_with_arg(i64 %arg) {
11  %cast = inttoptr i64 %arg to ptr
12  ret ptr %cast
13}
14
15; CHECK-INTERESTINGNESS: define void @call_with_arg()
16define void @call_with_arg() {
17  ; CHECK-FINAL: define void @call_with_arg() {
18  ; CHECK-FINAL-NEXT: call void @ifunc_with_arg()
19  ; CHECK-FINAL-NEXT: ret void
20  call void @ifunc_with_arg()
21  ret void
22}
23