Skip to content

Commit

Permalink
debug heisenbug
Browse files Browse the repository at this point in the history
  • Loading branch information
giulianobelinassi committed Apr 11, 2024
1 parent 06681d1 commit 6c46c8a
Showing 1 changed file with 11 additions and 1 deletion.
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

0 comments on commit 6c46c8a

Please sign in to comment.