Skip to content

Commit bc755ae

Browse files
authored
[compiler-rt] Fix binary-id-offset.c test to not require shell. (#157954)
As part of our migration for making lit internal shell be the default, this updates binary-id-offset.c to no longer require shell (at the cost of duplicating some code).
1 parent b22f94d commit bc755ae

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

compiler-rt/test/profile/Linux/binary-id-offset.c

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,30 @@
55
// (The DYN case would also apply to libraries, not explicitly tested here.)
66

77
// 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
148

159
// 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
1713

1814
// 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
2018

2119
// Moving the note after .bss also gives it extra LOAD segment padding,
2220
// making its memory offset different than its file offset.
2321
// RUN: echo "SECTIONS { .note.gnu.build-id : {} } INSERT AFTER .bss;" >%t.script
2422

2523
// 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
2727

2828
// 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
3032

3133
// CHECK-LABEL{LITERAL}: .note.gnu.build-id
3234
// CHECK: Build ID: [[ID:[0-9a-f]+]]

0 commit comments

Comments
 (0)