Skip to content

Commit d2a8351

Browse files
[CompilerRT][Tests] Fix profile/darwin-proof-of-concept.c (#104237)
Fix profile/darwin-proof-of-concept.c on AppleSilicon Mac where there is a different page alignment. The previous fix to drop alignment is actually breaking the tests on Apple Silicon Mac. Revert to the original section alignment and requires an ARM64 target for this test to run.
1 parent 5696984 commit d2a8351

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

compiler-rt/test/profile/ContinuousSyncMode/darwin-proof-of-concept.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
// mode to a new platform, but is not in and of itself a test of the profiling
55
// runtime.
66

7-
// REQUIRES: darwin
7+
// REQUIRES: darwin, target={{arm64.*}}
88

99
// Align counters and data to the maximum expected page size (16K).
1010
// RUN: %clang -g -o %t %s \
11-
// RUN: -Wl,-sectalign,__DATA,__pcnts,0x1000 \
12-
// RUN: -Wl,-sectalign,__DATA,__pdata,0x1000
11+
// RUN: -Wl,-sectalign,__DATA,__pcnts,0x4000 \
12+
// RUN: -Wl,-sectalign,__DATA,__pdata,0x4000
1313

1414
// Create a 'profile' using mmap() and validate it.
1515
// RUN: %run %t create %t.tmpfile
@@ -24,7 +24,7 @@
2424

2525
__attribute__((section("__DATA,__pcnts"))) int counters[] = {0xbad};
2626
extern int cnts_start __asm("section$start$__DATA$__pcnts");
27-
const size_t cnts_len = 0x1000;
27+
const size_t cnts_len = 0x4000;
2828

2929
__attribute__((section("__DATA,__pdata"))) int data[] = {1, 2, 3};
3030
extern int data_start __asm("section$start$__DATA$__pdata");
@@ -131,12 +131,12 @@ int main(int argc, char **argv) {
131131
fprintf(stderr, "__pcnts is not page-aligned: 0x%lx.\n", cnts_start_int);
132132
return EXIT_FAILURE;
133133
}
134-
if (data_start_int % 0x1000 != 0) {
134+
if (data_start_int % 0x4000 != 0) {
135135
fprintf(stderr, "__pdata is not correctly aligned: 0x%lx.\n",
136136
data_start_int);
137137
return EXIT_FAILURE;
138138
}
139-
if (cnts_start_int + 0x1000 != data_start_int) {
139+
if (cnts_start_int + 0x4000 != data_start_int) {
140140
fprintf(stderr, "__pdata not ordered after __pcnts.\n");
141141
return EXIT_FAILURE;
142142
}

0 commit comments

Comments
 (0)