brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.5 KiB · f468278 Raw
125 lines · plain
1;; The test fails on Windows. Fix it before removing the following requirement.2; REQUIRES: x86_64-linux3; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/noinline-cs-noprobe.perfscript --binary=%S/Inputs/noinline-cs-noprobe.perfbin --output=%t --skip-symbolization --profile-summary-cold-count=04; RUN: FileCheck %s --input-file %t --check-prefix=CHECK-UNWINDER5; RUN: llvm-profgen --format=text --unsymbolized-profile=%t --binary=%S/Inputs/noinline-cs-noprobe.perfbin --output=%t1 --profile-summary-cold-count=0 --csspgo-preinliner=0 --gen-cs-nested-profile=06; RUN: FileCheck %s --input-file %t17; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/noinline-cs-noprobe.perfscript --binary=%S/Inputs/noinline-cs-noprobe.perfbin --output=%t --profile-summary-cold-count=0 --ignore-stack-samples --csspgo-preinliner=0 --gen-cs-nested-profile=08; RUN: FileCheck %s --input-file %t --check-prefix=CHECK-STRIP-CTX9; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/noinline-cs-noprobe.aggperfscript --binary=%S/Inputs/noinline-cs-noprobe.perfbin --output=%t --skip-symbolization --profile-summary-cold-count=010; RUN: FileCheck %s --input-file %t --check-prefix=CHECK-AGG-UNWINDER11; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/noinline-cs-noprobe.aggperfscript --binary=%S/Inputs/noinline-cs-noprobe.perfbin --output=%t --profile-summary-cold-count=0 --csspgo-preinliner=0 --gen-cs-nested-profile=012; RUN: FileCheck %s --input-file %t --check-prefix=CHECK-AGG13 14; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/noinline-cs-noprobe.perfscript --binary=%S/Inputs/noinline-cs-noprobe.perfbin --output=%t1 --profile-summary-cold-count=015; RUN: llvm-profgen --format=extbinary --perfscript=%S/Inputs/noinline-cs-noprobe.perfscript --binary=%S/Inputs/noinline-cs-noprobe.perfbin --output=%t2 --profile-summary-cold-count=0 -use-md516; RUN: llvm-profdata show --sample -show-sec-info-only %t2 | FileCheck %s --check-prefix=CHECK-MD517; RUN: llvm-profdata show --sample -detailed-summary --function=dummy %t1 > %t.summary18; RUN: llvm-profdata show --sample -detailed-summary --function=dummy %t2 > %t2.summary19; RUN: diff -b %t.summary %t2.summary20 21 22; CHECK-AGG:[main:1 @ foo]:108:023; CHECK-AGG: 2: 624; CHECK-AGG: 3: 6 bar:625; CHECK-AGG:[main:1 @ foo:3 @ bar]:100:626; CHECK-AGG: 0: 627; CHECK-AGG: 1: 628; CHECK-AGG: 2: 429; CHECK-AGG: 4: 230; CHECK-AGG: 5: 631 32; CHECK-AGG-UNWINDER:      [main:1 @ foo]33; CHECK-AGG-UNWINDER-NEXT:   334; CHECK-AGG-UNWINDER-NEXT:   5ff-62f:635; CHECK-AGG-UNWINDER-NEXT:   634-637:636; CHECK-AGG-UNWINDER-NEXT:   645-645:637; CHECK-AGG-UNWINDER-NEXT:   338; CHECK-AGG-UNWINDER-NEXT:   62f->5b0:639; CHECK-AGG-UNWINDER-NEXT:   637->645:640; CHECK-AGG-UNWINDER-NEXT:   645->5ff:641; CHECK-AGG-UNWINDER-NEXT: [main:1 @ foo:3 @ bar]42; CHECK-AGG-UNWINDER-NEXT:   443; CHECK-AGG-UNWINDER-NEXT:   5b0-5c8:244; CHECK-AGG-UNWINDER-NEXT:   5b0-5d7:445; CHECK-AGG-UNWINDER-NEXT:   5dc-5e9:246; CHECK-AGG-UNWINDER-NEXT:   5e5-5e9:447; CHECK-AGG-UNWINDER-NEXT:   348; CHECK-AGG-UNWINDER-NEXT:   5c8->5dc:449; CHECK-AGG-UNWINDER-NEXT:   5d7->5e5:450; CHECK-AGG-UNWINDER-NEXT:   5e9->634:651 52 53; CHECK:[main:1 @ foo]:54:054; CHECK: 2: 355; CHECK: 3: 3 bar:356; CHECK:[main:1 @ foo:3 @ bar]:50:357; CHECK: 0: 358; CHECK: 1: 359; CHECK: 2: 260; CHECK: 4: 161; CHECK: 5: 362 63; CHECK-STRIP-CTX: foo:198:064; CHECK-STRIP-CTX:  0: 065; CHECK-STRIP-CTX:  1: 066; CHECK-STRIP-CTX:  2: 367; CHECK-STRIP-CTX:  3: 3 bar:368; CHECK-STRIP-CTX:  4: 069; CHECK-STRIP-CTX:  5: 070; CHECK-STRIP-CTX: bar:142:371; CHECK-STRIP-CTX:  0: 372; CHECK-STRIP-CTX:  1: 373; CHECK-STRIP-CTX:  2: 274; CHECK-STRIP-CTX:  4: 175; CHECK-STRIP-CTX:  5: 376 77; CHECK-UNWINDER:      [main:1 @ foo]78; CHECK-UNWINDER-NEXT:   379; CHECK-UNWINDER-NEXT:   5ff-62f:380; CHECK-UNWINDER-NEXT:   634-637:381; CHECK-UNWINDER-NEXT:   645-645:382; CHECK-UNWINDER-NEXT:   383; CHECK-UNWINDER-NEXT:   62f->5b0:384; CHECK-UNWINDER-NEXT:   637->645:385; CHECK-UNWINDER-NEXT:   645->5ff:386; CHECK-UNWINDER-NEXT: [main:1 @ foo:3 @ bar]87; CHECK-UNWINDER-NEXT:   488; CHECK-UNWINDER-NEXT:   5b0-5c8:189; CHECK-UNWINDER-NEXT:   5b0-5d7:290; CHECK-UNWINDER-NEXT:   5dc-5e9:191; CHECK-UNWINDER-NEXT:   5e5-5e9:292; CHECK-UNWINDER-NEXT:   393; CHECK-UNWINDER-NEXT:   5c8->5dc:294; CHECK-UNWINDER-NEXT:   5d7->5e5:295; CHECK-UNWINDER-NEXT:   5e9->634:396 97; CHECK-MD5: NameTableSection {{.*}} {fixlenmd5}98 99 100 101 102 103; original code:104; clang -O0 -g test.c -o a.out105#include <stdio.h>106 107int bar(int x, int y) {108  if (x % 3) {109    return x - y;110  }111  return x + y;112}113 114void foo() {115  int s, i = 0;116  while (i++ < 4000 * 4000)117    if (i % 91) s = bar(i, s); else s += 30;118  printf("sum is %d\n", s);119}120 121int main() {122  foo();123  return 0;124}125