Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug heisenbug #202

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion tests/process_access.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,19 @@
static char *banner = "Original banner";

/* Noinline must be set, else no calls are issued. */
char *__attribute__((noinline)) banner_get(void) { return banner; }
char *__attribute__((noinline)) banner_get(void) { printf("banner addr: 0x%lx\n", (unsigned long)banner); return banner; }


/* Since clang-18 when compiling this function it is broken in two parts:
banner_set and banner_set.specialized.1. We don't want it on this test so
we disable optimizations in this test. */
#ifdef __clang__
#pragma clang optimize off
#endif
void __attribute__((noinline)) banner_set(char *new) { banner = new; }
#ifdef __clang__
#pragma clang optimize on
#endif

int
main(void)
Expand Down
Loading