|
5 | 5 | // (The DYN case would also apply to libraries, not explicitly tested here.)
|
6 | 6 |
|
7 | 7 | // DEFINE: %{cflags} =
|
8 |
| -// DEFINE: %{check} = ( \ |
9 |
| -// DEFINE: %clang_profgen -fuse-ld=lld -Wl,--build-id -o %t %s %{cflags} && \ |
10 |
| -// DEFINE: env LLVM_PROFILE_FILE=%t.profraw %run %t && \ |
11 |
| -// DEFINE: llvm-readelf --notes %t && \ |
12 |
| -// DEFINE: llvm-profdata show --binary-ids %t.profraw \ |
13 |
| -// DEFINE: ) | FileCheck %s |
14 | 8 |
|
15 | 9 | // REDEFINE: %{cflags} = -no-pie
|
16 |
| -// RUN: %{check} |
| 10 | +// RUN: %clang_profgen -fuse-ld=lld -Wl,--build-id -o %t %s %{cflags} |
| 11 | +// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t |
| 12 | +// RUN: llvm-readelf --notes %t > %t2 && llvm-profdata show --binary-ids %t.profraw >> %t2 && FileCheck %s < %t2 |
17 | 13 |
|
18 | 14 | // REDEFINE: %{cflags} = -pie -fPIE
|
19 |
| -// RUN: %{check} |
| 15 | +// RUN: %clang_profgen -fuse-ld=lld -Wl,--build-id -o %t %s %{cflags} |
| 16 | +// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t |
| 17 | +// RUN: llvm-readelf --notes %t > %t2 && llvm-profdata show --binary-ids %t.profraw >> %t2 && FileCheck %s < %t2 |
20 | 18 |
|
21 | 19 | // Moving the note after .bss also gives it extra LOAD segment padding,
|
22 | 20 | // making its memory offset different than its file offset.
|
23 | 21 | // RUN: echo "SECTIONS { .note.gnu.build-id : {} } INSERT AFTER .bss;" >%t.script
|
24 | 22 |
|
25 | 23 | // REDEFINE: %{cflags} = -no-pie -Wl,--script=%t.script
|
26 |
| -// RUN: %{check} |
| 24 | +// RUN: %clang_profgen -fuse-ld=lld -Wl,--build-id -o %t %s %{cflags} |
| 25 | +// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t |
| 26 | +// RUN: llvm-readelf --notes %t > %t2 && llvm-profdata show --binary-ids %t.profraw >> %t2 && FileCheck %s < %t2 |
27 | 27 |
|
28 | 28 | // REDEFINE: %{cflags} = -pie -fPIE -Wl,--script=%t.script
|
29 |
| -// RUN: %{check} |
| 29 | +// RUN: %clang_profgen -fuse-ld=lld -Wl,--build-id -o %t %s %{cflags} |
| 30 | +// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t |
| 31 | +// RUN: llvm-readelf --notes %t > %t2 && llvm-profdata show --binary-ids %t.profraw >> %t2 && FileCheck %s < %t2 |
30 | 32 |
|
31 | 33 | // CHECK-LABEL{LITERAL}: .note.gnu.build-id
|
32 | 34 | // CHECK: Build ID: [[ID:[0-9a-f]+]]
|
|
0 commit comments