1 @var = dso_local global i32 0, align 4
3 ; Function Attrs: noinline nounwind optnone uwtable
4 define dso_local void @symb_w_whitespace() #0 {
5 store volatile i32 1, i32* @var, align 4
9 ; Function Attrs: noinline nounwind optnone uwtable
10 define dso_local void @symb_backslash_b() #0 {
11 call void @symb_w_whitespace()
12 store volatile i32 2, i32* @var, align 4
16 ; Function Attrs: noinline nounwind optnone uwtable
17 define dso_local i32 @main() #0 {
18 %1 = alloca i32, align 4
19 %2 = alloca i32, align 4
20 store i32 0, i32* %1, align 4
21 call void @static_symb_backslash_b()
22 call void @symb_w_whitespace()
23 store i32 0, i32* %2, align 4
27 %4 = load i32, i32* %2, align 4
28 %5 = icmp slt i32 %4, 2
29 br i1 %5, label %6, label %10
32 call void @symb_backslash_b()
36 %8 = load i32, i32* %2, align 4
37 %9 = add nsw i32 %8, 1
38 store i32 %9, i32* %2, align 4
42 %11 = load i32, i32* %1, align 4
46 ; Function Attrs: noinline nounwind optnone uwtable
47 define internal void @static_symb_backslash_b() #0 {
48 call void @symb_w_whitespace()
49 store volatile i32 3, i32* @var, align 4
53 ; REQUIRES: system-linux,bolt-runtime
56 ; RUN: %clang %cflags -O0 %t.s -o %t.exe -Wl,-q
57 ; RUN: llvm-objcopy --redefine-syms=%p/Inputs/fdata-escape-chars-syms.txt %t.exe
59 ; RUN: llvm-bolt %t.exe -o %t.exe.instrumented --instrument \
60 ; RUN: --instrumentation-file=%t.fdata
61 ; RUN: %t.exe.instrumented
62 ; RUN: cat %t.fdata | \
63 ; RUN: FileCheck --check-prefix="FDATA_CHECK" %s
64 ; RUN: llvm-bolt %t.exe -o %t.fdata.exe --data %t.fdata --print-finalized | \
65 ; RUN: FileCheck --check-prefix="INSTR_CHECK" %s
67 ; RUN: link_fdata %p/Inputs/fdata-escape-chars.txt %t.exe %t.pre "PREAGR"
68 ; RUN: perf2bolt %t.exe -o %t.pre.fdata -pa -p %t.pre
69 ; RUN: cat %t.pre.fdata | FileCheck --check-prefix="PREAGR_FDATA_CHECK" %s
70 ; RUN: llvm-bolt %t.exe -o %t.pre.fdata.exe --data %t.pre.fdata --print-finalized | \
71 ; RUN: FileCheck --check-prefix="PREAGR_CHECK" %s
73 ; FDATA_CHECK: 1 symb\ backslash\\ {{([[:xdigit:]]+)}} 1 symb\ whitespace 0 0 2
74 ; FDATA_CHECK: 1 main {{([[:xdigit:]]+)}} 1 symb\ whitespace 0 0 1
75 ; FDATA_CHECK: 1 main {{([[:xdigit:]]+)}} 1 symb\ backslash\\ 0 0 2
77 ; INSTR_CHECK: Binary Function "symb whitespace"
78 ; INSTR_CHECK: Exec Count : 4
79 ; INSTR_CHECK: Binary Function "symb backslash\"
80 ; INSTR_CHECK: Exec Count : 2
81 ; INSTR_CHECK: {{([[:xdigit:]]+)}}: callq "symb whitespace" # Count: 2
82 ; INSTR_CHECK: Binary Function "main"
83 ; INSTR_CHECK: Exec Count : 1
84 ; INSTR_CHECK: {{([[:xdigit:]]+)}}: callq "symb whitespace" # Count: 1
85 ; INSTR_CHECK: {{([[:xdigit:]]+)}}: callq "symb backslash\" # Count: 2
86 ; INSTR_CHECK: Binary Function "static symb backslash\/1(*2)"
87 ; INSTR_CHECK: Exec Count : 1
88 ; INSTR_CHECK: {{([[:xdigit:]]+)}}: callq "symb whitespace" # Count: 1
90 ; PREAGR_FDATA_CHECK: 1 main 0 1 static\ symb\ backslash\\/1 0 0 1
91 ; PREAGR_FDATA_CHECK: 1 main 0 1 symb\ backslash\\ 0 0 2
92 ; PREAGR_FDATA_CHECK: 1 main 0 1 symb\ whitespace 0 0 1
93 ; PREAGR_FDATA_CHECK: 1 static\ symb\ backslash\\/1 0 1 symb\ whitespace 0 0 1
94 ; PREAGR_FDATA_CHECK: 1 symb\ backslash\\ 0 1 symb\ whitespace 0 0 2
96 ; PREAGR_CHECK: Binary Function "symb whitespace"
97 ; PREAGR_CHECK-DAG: Exec Count : 4
98 ; PREAGR_CHECK: Binary Function "symb backslash\"
99 ; PREAGR_CHECK-DAG: Exec Count : 2
100 ; PREAGR_CHECK: Binary Function "static symb backslash\/1(*2)"
101 ; PREAGR_CHECK-DAG: Exec Count : 1