diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 01d781f190..628261b5fb 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2021-03-29 Tankut Baris Aktemur + + * gdb.mi/user-selected-context-sync.exp: Spin on a variable in + the infinite loop to avoid a Clang bug. + 2021-03-26 Will Schmidt * gdb.arch/powerpc-disassembler-options.exp: Extend some test diff --git a/gdb/testsuite/gdb.mi/user-selected-context-sync.c b/gdb/testsuite/gdb.mi/user-selected-context-sync.c index 500a118a2d..9818f30277 100644 --- a/gdb/testsuite/gdb.mi/user-selected-context-sync.c +++ b/gdb/testsuite/gdb.mi/user-selected-context-sync.c @@ -27,7 +27,10 @@ static pthread_barrier_t barrier; static void child_sub_function (void) { - while (1); /* thread loop line */ + /* Deliberately spin on a variable instead of plain 'while (1)' to + avoid the Clang bug https://bugs.llvm.org/show_bug.cgi?id=49614. */ + int spin = 1; + while (spin); /* thread loop line */ } static void * @@ -57,7 +60,10 @@ main (void) pthread_barrier_wait (&barrier); - while (1); /* main break line */ + /* Deliberately spin on a variable instead of plain 'while (1)' to + avoid the Clang bug https://bugs.llvm.org/show_bug.cgi?id=49614. */ + int spin = 1; + while (spin); /* main break line */ return 0; }