54 lines · plain
1# Meta test using merge-fdata binary2UNSUPPORTED: asan3# Instrumentation currently only works on X864REQUIRES: x86_64-linux,bolt-runtime5 6# Instrumentation, should test:7# - Direct branches8# - Unmapped calls coming from uninstrumented code (libc)9# - Direct calls10RUN: llvm-bolt merge-fdata -o %t.inst --instrument \11RUN: --instrumentation-file=%t.fdata12 13# Execute with no input14RUN: %t.inst --version15RUN: mv %t.fdata %t.fdata116 17# Check unmapped calls coverage - libc should be calling _start via18# uninstrumented code19RUN: cat %t.fdata1 | FileCheck %s --check-prefix=CHECK-FDATA20CHECK-FDATA: 0 [unknown] 0 1 _start 0 0 121 22# Check that BOLT works with this profile23RUN: llvm-bolt merge-fdata -o %t.bolt --data %t.fdata1 \24RUN: --reorder-blocks=ext-tsp --reorder-functions=hfsort+ \25RUN: --split-functions 2>&1 \26RUN: | FileCheck %s --check-prefix=CHECK-BOLT127CHECK-BOLT1-NOT: invalid (possibly stale) profile28 29# Execute again30RUN: %t.inst --help31RUN: mv %t.fdata %t.fdata232 33# Check profile coverage34RUN: llvm-boltdiff merge-fdata merge-fdata \35RUN: --data %t.fdata1 --data2 %t.fdata2 --display-count=20 | \36RUN: FileCheck %s --check-prefix=CHECK-BOLTDIFF37CHECK-BOLTDIFF: Inputs share [[#]] functions38 39# Check that instrumented binary produces the same result40RUN: merge-fdata %t.fdata1 %t.fdata2 > %t.fdata.base41RUN: %t.inst %t.fdata1 %t.fdata2 > %t.fdata.inst42RUN: cmp %t.fdata.base %t.fdata.inst43 44# Optimize using merged fdata45RUN: llvm-bolt merge-fdata -o %t.opt --data %t.fdata.base \46RUN: --reorder-blocks=ext-tsp --reorder-functions=hfsort+ \47RUN: --split-functions 2>&1 \48RUN: | FileCheck %s --check-prefix=CHECK-BOLT249CHECK-BOLT2-NOT: invalid (possibly stale) profile50 51# Check that optimized binary produces the same result52RUN: %t.opt %t.fdata1 %t.fdata2 > %t.fdata.opt53RUN: cmp %t.fdata.base %t.fdata.opt54