Skip to content

Commit ad9be29

Browse files
committed
Simplify test case by removing useless steps
1 parent 115b11b commit ad9be29

File tree

1 file changed

+4
-25
lines changed

1 file changed

+4
-25
lines changed

compiler-rt/test/asan/TestCases/fakestack_alignment.cpp

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,8 @@ struct alignas(16384) larry {
1717

1818
bool misaligned = false;
1919

20-
void grandchild(void) {
21-
larry l2;
22-
uint alignment = (unsigned long)&l2 % alignof(larry);
23-
if (alignment != 0)
24-
misaligned = true;
25-
26-
printf("Grandchild: address modulo alignment %u\n", alignment);
27-
}
28-
29-
// Even if the FakeStack frame is aligned by chance to 16384, we can use an
30-
// intervening stack frame to knock it out of alignment.
31-
void child(void) {
32-
page p1;
33-
uint alignment = (unsigned long)&p1 % alignof(page);
34-
printf("Child: address modulo alignment is %u\n", alignment);
35-
if (alignment != 0)
36-
misaligned = true;
37-
38-
grandchild();
39-
}
40-
4120
// Check whether the FakeStack frame is sufficiently aligned. Alignment can
42-
// happen by chance, so try this on many threads if you don't want
21+
// happen by chance, so try this on many threads.
4322
void *Thread(void *unused) {
4423
larry l1;
4524
uint alignment = (unsigned long)&l1 % alignof(larry);
@@ -56,12 +35,12 @@ int main(int argc, char **argv) {
5635
pthread_attr_t attr;
5736
pthread_attr_init(&attr);
5837

59-
pthread_t t[10];
60-
for (int i = 0; i < 10; i++) {
38+
pthread_t t[32];
39+
for (int i = 0; i < 32; i++) {
6140
pthread_create(&t[i], &attr, Thread, 0);
6241
}
6342
pthread_attr_destroy(&attr);
64-
for (int i = 0; i < 10; i++) {
43+
for (int i = 0; i < 32; i++) {
6544
pthread_join(t[i], 0);
6645
}
6746

0 commit comments

Comments
 (0)