Skip to content

Commit 6a92b9c

Browse files
committed
Make watchpoint_unaligned2 test pass with LTO enabled
1 parent 11b2f31 commit 6a92b9c

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

src/test/watchpoint_unaligned2.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,15 @@ struct {
77
uint32_t high;
88
} value;
99

10-
static void breakpoint(void) {
11-
// Put something in here so the optimizer can't eat this function.
12-
atomic_puts(".");
13-
}
14-
1510
int main(void) {
16-
breakpoint();
17-
18-
// -O3 should consolidate these into a single load.
11+
// -O3 should consolidate these into a single store.
1912
value.low = 1;
2013
value.high = 2;
2114

15+
// This will fail; we just want the compiler to not optimize out
16+
// the store.
17+
write(STDIN_FILENO, &value, sizeof(value));
18+
2219
atomic_puts("EXIT-SUCCESS");
2320
return 0;
2421
}

src/test/watchpoint_unaligned2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from util import *
22

3-
send_gdb('b breakpoint')
3+
send_gdb('b main')
44
expect_gdb('Breakpoint 1')
55

66
send_gdb('c')

0 commit comments

Comments
 (0)