Files
TheRock/compiler/amd-llvm/llvm/test/tools/llvm-profgen/coff-profile.test
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

132 lines
4.3 KiB
Plaintext

; RUN: llvm-profgen --format=text --use-dwarf-correlation --perfscript=%S/Inputs/coff-profile.perfscript --binary=%S/Inputs/coff-profile.exe --output=%t
; RUN: FileCheck %s --input-file %t --check-prefix=DWARF
; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/coff-profile.perfscript --binary=%S/Inputs/coff-profile.exe --output=%t
; RUN: FileCheck %s --input-file %t --check-prefix=PROBE
; RUN: mkdir %t.dir
; RUN: llvm-objcopy --strip-debug --remove-section=.pseudo_probe --remove-section=.pseudo_probe_desc %S/Inputs/coff-profile.exe %t.dir/coff-profile.exe
; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/coff-profile.perfscript --binary=%t.dir/coff-profile.exe --debug-binary=%S/Inputs/coff-profile.exe --output=%t
; RUN: FileCheck %s --input-file %t --check-prefix=PROBE
; RUN: llvm-objcopy --strip-debug %S/Inputs/coff-profile.exe %t.dir/coff-profile.exe
; RUN: cp %S/Inputs/coff-profile.pdb %t.dir
; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/coff-profile.perfscript --binary=%t.dir/coff-profile.exe --output=%t
; RUN: FileCheck %s --input-file %t --check-prefix=PROBE
DWARF: main:31341:0
DWARF-NEXT: 0: 0
DWARF-NEXT: 3: 0
DWARF-NEXT: 3.1: 0
DWARF-NEXT: 3.2: 0
DWARF-NEXT: 8: 0
DWARF-NEXT: 65501: 0
DWARF-NEXT: 1: ??$init@HG@MyNameSpace2@@YAXHPEAG@Z:0
DWARF-NEXT: 1: 0
DWARF-NEXT: 1.1: 0
DWARF-NEXT: 1.2: 0
DWARF-NEXT: 2: 0
DWARF-NEXT: 65514: 0
DWARF-NEXT: 4: ?work1@?$MyClass@GH@MyNameSpace1@@QEAAXQEAGH@Z:3038
DWARF-NEXT: 0: ?work@?$MyClass@GH@MyNameSpace1@@AEAAXQEAGHH@Z:3038
DWARF-NEXT: 1.1: 31
DWARF-NEXT: 1.2: 31
DWARF-NEXT: 2: 31
DWARF-NEXT: 3: 31
DWARF-NEXT: 65530: 0
DWARF-NEXT: 5: ?work2@?$MyClass@GH@MyNameSpace1@@QEAAXQEAGH@Z:28303
DWARF-NEXT: 0: ?work@?$MyClass@GH@MyNameSpace1@@AEAAXQEAGHH@Z:28303
DWARF-NEXT: 1.1: 341
DWARF-NEXT: 1.2: 341
DWARF-NEXT: 2: 341
DWARF-NEXT: 3: 341
DWARF-NEXT: 65530: 0
DWARF-NEXT: 7: ?print@MyNameSpace2@@YAXPEAGH@Z:0
DWARF-NEXT: 1: 0
PROBE: main:1116:0
PROBE-NEXT: 1: 0
PROBE-NEXT: 3: 0
PROBE-NEXT: 4: 0
PROBE-NEXT: 5: 0
PROBE-NEXT: 8: 0
PROBE-NEXT: 9: 0
PROBE-NEXT: 2: ??$init@HG@MyNameSpace2@@YAXHPEAG@Z:0
PROBE-NEXT: 1: 0
PROBE-NEXT: 2: 0
PROBE-NEXT: 3: 0
PROBE-NEXT: 4: 0
PROBE-NEXT: 5: 0
PROBE-NEXT: 6: 0
PROBE-NEXT: !CFGChecksum: 107105011060
PROBE-NEXT: 6: ?work1@?$MyClass@GH@MyNameSpace1@@QEAAXQEAGH@Z:93
PROBE-NEXT: 1: 0
PROBE-NEXT: 2: ?work@?$MyClass@GH@MyNameSpace1@@AEAAXQEAGHH@Z:93
PROBE-NEXT: 1: 0
PROBE-NEXT: 2: 31
PROBE-NEXT: 4: 31
PROBE-NEXT: 5: 31
PROBE-NEXT: !CFGChecksum: 107105011060
PROBE-NEXT: !CFGChecksum: 281479271677951
PROBE-NEXT: 7: ?work2@?$MyClass@GH@MyNameSpace1@@QEAAXQEAGH@Z:1023
PROBE-NEXT: 2: ?work@?$MyClass@GH@MyNameSpace1@@AEAAXQEAGHH@Z:1023
PROBE-NEXT: 2: 341
PROBE-NEXT: 3: 0
PROBE-NEXT: 4: 341
PROBE-NEXT: 5: 341
PROBE-NEXT: 6: 0
PROBE-NEXT: !CFGChecksum: 107105011060
PROBE-NEXT: !CFGChecksum: 281479271677951
PROBE-NEXT: 10: ?print@MyNameSpace2@@YAXPEAGH@Z:0
PROBE-NEXT: 1: 0
PROBE-NEXT: 2: 0
PROBE-NEXT: !CFGChecksum: 281479271677951
PROBE-NEXT: !CFGChecksum: 1126005794311845
; Original code
; clang-cl.exe -O2 -gdwarf -gline-tables-only -fpseudo-probe-for-profiling coff-profile.cpp -fuse-ld=lld -Xclang -fdebug-info-for-profiling -link -debug:dwarf
#include <stdio.h>
namespace MyNameSpace1 {
template <typename T1, typename T2> class MyClass {
void work(T1 map[], T2 n, T2 m) {
for (int i = 1; i < n; i++) {
map[i] = map[i - 1] * map[i - 1];
map[i] += (i * map[i - 1]) / m + i % m;
}
}
public:
void work1(T1 map[], T2 n) { work(map, n, 7); }
void work2(T1 map[], T2 n) { work(map, n, 3); }
};
} // namespace MyNameSpace1
namespace MyNameSpace2 {
template <typename T1, typename T2> void init(T1 c, T2 *p) {
for (int i = 0; i < c * 1000000; i++) {
p[i] = i / 3 + (i * i) % 3;
}
}
void print(unsigned short *p, int i) {
printf("%d %d %d\n", p[i * i * 100], p[i * i * 100 + 1], p[i * i * 100 + 2]);
}
} // namespace MyNameSpace2
unsigned short M[3000000];
int main(int argc, char *argv[]) {
MyNameSpace2::init(argc, M);
MyNameSpace1::MyClass<unsigned short, int> Obj;
for (int i = 0; i <= argc * 10; i++) {
Obj.work1(&M[argc], argc * 100000);
Obj.work2(&M[argc * argc], argc * 1000000);
}
MyNameSpace2::print(M, argc);
return 0;
}