1// RUN: %clang_pgogen -c -o %t.o %s
2//
3// Test valid IDs:
4// (20-byte, ends with 2 zeroes, upper case)
5// RUN: %clang_pgogen -mxcoff-build-id=0x8d7AEC8b900dce6c14afe557dc8889230518be00 -o %t %t.o
6// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
7// RUN: llvm-profdata show --binary-ids %t.profraw | FileCheck %s --check-prefix=LONG
8
9// (all zeroes)
10// RUN: %clang_pgogen -mxcoff-build-id=0x00 -o %t %t.o
11// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
12// RUN: llvm-profdata show --binary-ids %t.profraw | FileCheck %s --check-prefix=00
13
14// (starts with one zero)
15// RUN: %clang_pgogen -mxcoff-build-id=0x0120 -o %t %t.o
16// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
17// RUN: llvm-profdata show --binary-ids %t.profraw | FileCheck %s --check-prefix=0120
18
19// (starts with 8 zeroes == 4 bytes)
20// RUN: %clang_pgogen -mxcoff-build-id=0x0000000012 -o %t %t.o
21// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
22// RUN: llvm-profdata show --binary-ids %t.profraw | FileCheck %s --check-prefix=0000000012
23
24// (starts with 16 zeroes == 8 bytes)
25// RUN: %clang_pgogen -mxcoff-build-id=0x0000000000000000ff -o %t %t.o
26// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
27// RUN: llvm-profdata show --binary-ids %t.profraw | FileCheck %s --check-prefix=0000000000000000ff
28
29// (starts with 17 zeroes)
30// RUN: %clang_pgogen -mxcoff-build-id=0x00000000000000000f -o %t %t.o
31// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
32// RUN: llvm-profdata show --binary-ids %t.profraw | FileCheck %s --check-prefix=00000000000000000f
33
34// LONG: Binary IDs:
35// LONG-NEXT: 8d7aec8b900dce6c14afe557dc8889230518be00
36// 00: Binary IDs:
37// 00-NEXT: {{^}}00{{$}}
38// 0120: Binary IDs:
39// 0120-NEXT: {{^}}0120{{$}}
40// 0000000012: Binary IDs:
41// 0000000012-NEXT: {{^}}0000000012{{$}}
42// 0000000000000000ff: Binary IDs:
43// 0000000000000000ff-NEXT: {{^}}0000000000000000ff{{$}}
44// 00000000000000000f: Binary IDs:
45// 00000000000000000f-NEXT: {{^}}00000000000000000f{{$}}
46
47int main() { return 0; }
48

source code of compiler-rt/test/profile/AIX/binary-id.c