1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals --include-generated-funcs
2 ; RUN: opt -S -passes=lower-ifunc < %s | FileCheck %s
4 @ifunc_with_arg = ifunc void (), ptr @resolver_with_arg
6 ; Test a resolver with an argument (which probably should not be legal
8 define ptr @resolver_with_arg(i64 %arg) {
9 %cast = inttoptr i64 %arg to ptr
13 define void @call_with_arg() {
14 call void @ifunc_with_arg()
18 ; CHECK: @[[GLOB0:[0-9]+]] = internal global [1 x ptr] poison, align 8
19 ; CHECK: @[[LLVM_GLOBAL_CTORS:[a-zA-Z0-9_$"\\.-]+]] = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 10, ptr @[[GLOB1:[0-9]+]], ptr null }]
20 ; CHECK: @[[IFUNC_WITH_ARG:[a-zA-Z0-9_$"\\.-]+]] = ifunc void (), ptr @resolver_with_arg
22 ; CHECK-LABEL: define {{[^@]+}}@resolver_with_arg(
23 ; CHECK-NEXT: [[CAST:%.*]] = inttoptr i64 [[ARG:%.*]] to ptr
24 ; CHECK-NEXT: ret ptr [[CAST]]
27 ; CHECK-LABEL: define {{[^@]+}}@call_with_arg(
28 ; CHECK-NEXT: call void @ifunc_with_arg()
29 ; CHECK-NEXT: ret void
32 ; CHECK-LABEL: define {{[^@]+}}@1(
33 ; CHECK-NEXT: ret void