brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 994d922 Raw
55 lines · plain
1; Test that the list of CFI jumptable entries is part of ThinLTO cache key.2 3; Linking Inputs/cache-icall.ll results in f() being added to CFI jumptable; otherwise it is not.4; This affects code generated for any users of f(). Make sure that we don't pull a stale object5; file for %t.o from the cache.6 7; RUN: opt -module-hash -module-summary -thinlto-bc -thinlto-split-lto-unit %s -o %t.bc8; RUN: opt -module-hash -module-summary -thinlto-bc -thinlto-split-lto-unit %p/Inputs/cache-icall.ll -o %t2.bc9 10; RUN: rm -Rf %t.cache && mkdir %t.cache11 12; RUN: llvm-lto2 run -o %t-no.o %t.bc -cache-dir %t.cache \13; RUN:   -r=%t.bc,_start,px \14; RUN:   -r=%t.bc,f,15 16; RUN: llvm-readelf -s %t-no.o.* | FileCheck %s --check-prefix=SYMBOLS-NO17 18; RUN: llvm-lto2 run -o %t-yes.o %t.bc %t2.bc -cache-dir %t.cache \19; RUN:   -r=%t.bc,_start,px \20; RUN:   -r=%t.bc,f, \21; RUN:   -r=%t2.bc,f,p22 23; RUN: llvm-readelf -s %t-yes.o.* | FileCheck %s --check-prefix=SYMBOLS-YES24 25; SYMBOLS-NO-DAG: {{FUNC .* f.cfi_jt$}}26; SYMBOLS-NO-DAG: {{NOTYPE .* UND f.cfi_jt$}}27 28; SYMBOLS-YES-NOT: f.cfi_jt29; SYMBOLS-YES-DAG: {{FUNC .* f.cfi$}}30; SYMBOLS-YES-DAG: {{NOTYPE .* UND f.cfi$}}31 32target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"33target triple = "x86_64-unknown-linux-gnu"34 35define ptr @_start(ptr %p) !type !0 {36entry:37  %0 = tail call i1 @llvm.type.test(ptr %p, metadata !"_ZTSFvvE")38  br i1 %0, label %cont, label %trap39 40trap:                                             ; preds = %entry41  tail call void @llvm.trap()42  unreachable43 44cont:                                             ; preds = %entry45  tail call void %p()46  ret ptr @f47}48 49declare i1 @llvm.type.test(ptr, metadata)50declare void @llvm.trap()51declare !type !1 void @f()52 53!0 = !{i64 0, !"_ZTSFPvPFvvEE"}54!1 = !{i64 0, !"_ZTSFvvE"}55