1 ; RUN: opt -module-summary %s -o %t.bc
3 ; RUN: llvm-dis %t.bc -o - | FileCheck %s
5 ; Tests that var and caller are not eligible to import and they don't have refs to ifunc 'callee'
7 ; CHECK: gv: (name: "var", summaries: (variable: ({{.*}}, flags: ({{.*}}notEligibleToImport: 1
9 ; CHECK-SAME: guid = 7919382516565939378
11 ; CHECK: gv: (name: "caller", summaries: (function: ({{.*}}, flags: ({{.*}}notEligibleToImport: 1
13 ; CHECK-SAME: guid = 16677772384402303968
15 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
16 target triple = "x86_64-unknown-linux-gnu"
18 @__cpu_model = external global { i32, i32, i32, [1 x i32] }
20 @callee = internal ifunc void(), ptr @callee.resolver
22 @var = constant { [1 x ptr] } { [1 x ptr] [ptr @callee]}
24 define void @dispatch(ptr %func) {
25 tail call void %func()
29 define void @caller() {
30 tail call void @dispatch(ptr @callee)
34 define internal ptr @callee.resolver() {
36 tail call void @__cpu_indicator_init()
37 %0 = load i32, ptr getelementptr inbounds ({ i32, i32, i32, [1 x i32] }, ptr @__cpu_model, i64 0, i32 3, i64 0)
39 %.not = icmp eq i32 %1, 0
40 %func_sel = select i1 %.not, ptr @callee.default.1, ptr @callee.avx2.0
44 define internal void @callee.default.1(i32 %a) {
48 define internal void @callee.avx2.0(i32 %a) {
52 declare void @__cpu_indicator_init()