brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · a43c080 Raw
53 lines · plain
1; RUN: opt -module-summary %s -o %t.bc2 3; RUN: llvm-dis %t.bc -o - | FileCheck %s4 5; Tests that var and caller are not eligible to import and they don't have refs to ifunc 'callee'6 7; CHECK: gv: (name: "var", summaries: (variable: ({{.*}}, flags: ({{.*}}notEligibleToImport: 18; CHECK-NOT: refs9; CHECK-SAME: guid = 791938251656593937810 11; CHECK: gv: (name: "caller", summaries: (function: ({{.*}}, flags: ({{.*}}notEligibleToImport: 112; CHECK-NOT: refs13; CHECK-SAME: guid = 1667777238440230396814 15target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"16target triple = "x86_64-unknown-linux-gnu"17 18@__cpu_model = external global { i32, i32, i32, [1 x i32] }19 20@callee = internal ifunc void(), ptr @callee.resolver21 22@var = constant { [1 x ptr] } { [1 x ptr] [ptr @callee]}23 24define void @dispatch(ptr %func) {25    tail call void %func()26    ret void27}28 29define void @caller() {30  tail call void @dispatch(ptr @callee)31  ret void32}33 34define internal ptr @callee.resolver() {35resolver_entry: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)38  %1 = and i32 %0, 102439  %.not = icmp eq i32 %1, 040  %func_sel = select i1 %.not, ptr @callee.default.1, ptr @callee.avx2.041  ret ptr %func_sel42}43 44define internal void @callee.default.1(i32 %a) {45  ret void46}47 48define internal void @callee.avx2.0(i32 %a) {49  ret void50}51 52declare void @__cpu_indicator_init()53