67 lines
1.8 KiB
Plaintext
67 lines
1.8 KiB
Plaintext
|
; Firstly test uncompression(--compress-recursion=0)
|
||
|
; RUN: llvm-profgen --perfscript=%S/Inputs/recursion-compression-noprobe.perfscript --binary=%S/Inputs/recursion-compression-noprobe.perfbin --output=%t --compress-recursion=0 --csprof-cold-thres=0
|
||
|
; RUN: FileCheck %s --input-file %t -check-prefix=CHECK-UNCOMPRESS
|
||
|
; RUN: llvm-profgen --perfscript=%S/Inputs/recursion-compression-noprobe.perfscript --binary=%S/Inputs/recursion-compression-noprobe.perfbin --output=%t --csprof-cold-thres=0
|
||
|
; RUN: FileCheck %s --input-file %t
|
||
|
|
||
|
; CHECK-UNCOMPRESS:[main:1 @ foo:3 @ fa:2 @ fb]:48:0
|
||
|
; CHECK-UNCOMPRESS: 1: 11
|
||
|
; CHECK-UNCOMPRESS: 2: 1 fa:1
|
||
|
; CHECK-UNCOMPRESS:[main:1 @ foo:3 @ fa]:24:0
|
||
|
; CHECK-UNCOMPRESS: 1: 1
|
||
|
; CHECK-UNCOMPRESS: 2: 13 fb:11
|
||
|
; CHECK-UNCOMPRESS:[main:1 @ foo]:7:0
|
||
|
; CHECK-UNCOMPRESS: 2: 1
|
||
|
; CHECK-UNCOMPRESS: 3: 2 fa:1
|
||
|
; CHECK-UNCOMPRESS:[main:1 @ foo:3 @ fa:2 @ fb:2 @ fa]:7:0
|
||
|
; CHECK-UNCOMPRESS: 1: 1
|
||
|
; CHECK-UNCOMPRESS: 2: 2 fb:1
|
||
|
; CHECK-UNCOMPRESS:[main:1 @ foo:3 @ fa:2 @ fb:2 @ fa:2 @ fb]:2:0
|
||
|
; CHECK-UNCOMPRESS: 2: 1 fa:1
|
||
|
; CHECK-UNCOMPRESS:[main:1 @ foo:3 @ fa:2 @ fb:2 @ fa:2 @ fb:2 @ fa]:2:0
|
||
|
; CHECK-UNCOMPRESS: 4: 1
|
||
|
|
||
|
|
||
|
; CHECK: [main:1 @ foo:3 @ fa:2 @ fb]:48:0
|
||
|
; CHECK: 1: 11
|
||
|
; CHECK: 2: 1 fa:1
|
||
|
; CHECK: [main:1 @ foo:3 @ fa]:24:0
|
||
|
; CHECK: 1: 1
|
||
|
; CHECK: 2: 13 fb:11
|
||
|
; CHECK: [main:1 @ foo:3 @ fa:2 @ fb:2 @ fa]:9:0
|
||
|
; CHECK: 1: 1
|
||
|
; CHECK: 2: 2 fb:1
|
||
|
; CHECK: 4: 1
|
||
|
; CHECK: [main:1 @ foo]:7:0
|
||
|
; CHECK: 2: 1
|
||
|
; CHECK: 3: 2 fa:1
|
||
|
; CHECK: [main:1 @ foo:3 @ fa:2 @ fb:2 @ fa:2 @ fb]:1:0
|
||
|
|
||
|
|
||
|
; original code:
|
||
|
; clang -O3 -g test.c -o a.out
|
||
|
#include <stdio.h>
|
||
|
|
||
|
int fb(int n) {
|
||
|
if(n > 10) return fb(n / 2);
|
||
|
return fa(n - 1);
|
||
|
}
|
||
|
|
||
|
int fa(int n) {
|
||
|
if(n < 2) return n;
|
||
|
if(n % 2) return fb(n - 1);
|
||
|
return fa(n - 1);
|
||
|
}
|
||
|
|
||
|
void foo() {
|
||
|
int s, i = 0;
|
||
|
while (i++ < 10000)
|
||
|
s += fa(i);
|
||
|
printf("sum is %d\n", s);
|
||
|
}
|
||
|
|
||
|
int main() {
|
||
|
foo();
|
||
|
return 0;
|
||
|
}
|