2 ; The verifier should xeject this
3 ; 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
4 ; RUN: FileCheck --check-prefixes=CHECK-FINAL --input-file=%t %s
6 ; CHECK-INTERESTINGNESS: @ifunc_getelementptr
8 ; FIXME: Why is this legal?
9 @ifunc_getelementptr = ifunc void (), ptr getelementptr (i8, ptr @resolver1, i32 4)
11 define ptr @resolver1() {
12 ret ptr inttoptr (i64 123 to ptr)
15 define void @call_ifunc_getelementptr(ptr %ptr) {
16 ; CHECK-FINAL-LABEL: define void @call_ifunc_getelementptr(ptr %ptr) {
17 ; CHECK-FINAL-NEXT: call void @ifunc_getelementptr()
18 ; CHECK-FINAL-NEXT: store ptr @ifunc_getelementptr, ptr %ptr, align 8
19 ; CHECK-FINAL-NEXT: store ptr %ptr, ptr @ifunc_getelementptr, align 8
20 ; CHECK-FINAL-NEXT: ret void
21 call void @ifunc_getelementptr()
22 store ptr @ifunc_getelementptr, ptr %ptr
23 store ptr %ptr, ptr @ifunc_getelementptr