binutils-gdb/gdb/testsuite/gdb.threads
Tom de Vries b243ba58e8 [gdb/testsuite] Stabilize execution order in omp-par-scope.c
In openmp test-case gdb.threads/omp-par-scope.exp we xfail and kfail dependent
on omp_get_thread_num ().  Since execution order of the threads can vary from
execution to execution, this can cause changes in test results.

F.i., we can see this difference between two test runs:
...
-KFAIL: single_scope: first thread: print i3 (PRMS: gdb/22214)
+PASS: single_scope: first thread: print i3
-PASS: single_scope: second thread: print i3
+KFAIL: single_scope: second thread: print i3 (PRMS: gdb/22214)
...
In both cases, the KFAIL is for omp_get_thread_num () == 1, but in one case
that corresponds to the first thread executing that bit of code, and in the
other case to the second thread.

Get rid of this difference by stabilizing execution order.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2020-07-20  Tom de Vries  <tdevries@suse.de>

	* gdb.threads/omp-par-scope.c (lock, lock2): New variable.
	(omp_set_lock_in_order): New function.
	(single_scope, multi_scope, nested_func, nested_parallel): Use
	omp_set_lock_in_order and omp_unset_lock.
	(main): Init and destroy lock and lock2.
2020-07-20 14:40:52 +02:00
..
async.c Preserve selected thread in all-stop w/ background execution 2020-01-10 20:05:41 +00:00
async.exp Preserve selected thread in all-stop w/ background execution 2020-01-10 20:05:41 +00:00
attach-into-signal.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
attach-into-signal.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
attach-many-short-lived-threads.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
attach-many-short-lived-threads.exp [gdb/testsuite] Fix check-read1 FAIL in attach-many-short-lived-threads.exp 2020-03-14 15:48:26 +01:00
attach-slow-waitpid.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
attach-slow-waitpid.exp [gdb/testsuite] Bail out after gdb_start error in gdb.threads/attach-slow-waitpid.exp 2020-07-20 10:54:31 +02:00
attach-stopped.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
attach-stopped.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
bp_in_thread.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
bp_in_thread.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
break-while-running.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
break-while-running.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
check-libthread-db.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
check-libthread-db.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
clone-attach-detach.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
clone-attach-detach.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
clone-new-thread-event.c [gdb/testsuite] Fix clone-new-thread-event.c with glibc 2.30 2020-07-14 10:36:17 +02:00
clone-new-thread-event.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
clone-thread_db.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
clone-thread_db.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
continue-pending-after-query.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
continue-pending-after-query.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
continue-pending-status.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
continue-pending-status.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
corethreads.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
corethreads.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
create-fail.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
create-fail.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
current-lwp-dead.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
current-lwp-dead.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
dlopen-libpthread-lib.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
dlopen-libpthread.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
dlopen-libpthread.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
execl1.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
execl.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
execl.exp [gdb/testsuite] Avoid breakpoint in GLIBC in gdb.threads/execl.exp 2020-03-12 14:37:15 +01:00
fork-child-threads.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
fork-child-threads.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
fork-plus-threads.c Fix "control reaches end of non-void function" errors in testsuite 2020-05-15 15:03:42 +01:00
fork-plus-threads.exp Add "info connections" command, "info inferiors" connection number/string 2020-01-10 20:06:14 +00:00
fork-thread-pending.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
fork-thread-pending.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
forking-threads-plus-breakpoint.c Fix "control reaches end of non-void function" errors in testsuite 2020-05-15 15:03:42 +01:00
forking-threads-plus-breakpoint.exp Add "info connections" command, "info inferiors" connection number/string 2020-01-10 20:06:14 +00:00
gcore-stale-thread.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
gcore-stale-thread.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
gcore-thread.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
hand-call-in-threads.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
hand-call-in-threads.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
hand-call-new-thread.c Fix "control reaches end of non-void function" errors in testsuite 2020-05-15 15:03:42 +01:00
hand-call-new-thread.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
ia64-sigill.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
ia64-sigill.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
info-threads-cur-sal-2.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
info-threads-cur-sal.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
info-threads-cur-sal.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
interrupt-while-step-over.c Fix "control reaches end of non-void function" errors in testsuite 2020-05-15 15:03:42 +01:00
interrupt-while-step-over.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
interrupted-hand-call.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
interrupted-hand-call.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
kill.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
kill.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
killed-outside.c [gdb] Fix hang after ext sigkill 2020-04-21 15:45:57 +02:00
killed-outside.exp [gdb] Fix hang after ext sigkill 2020-04-21 15:45:57 +02:00
killed.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
killed.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
leader-exit.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
leader-exit.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
linux-dp.c
linux-dp.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
local-watch-wrong-thread.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
local-watch-wrong-thread.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
manythreads.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
manythreads.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
multi-create-ns-info-thr.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
multi-create.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
multi-create.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
multiple-step-overs.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
multiple-step-overs.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
multiple-successive-infcall.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
multiple-successive-infcall.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
names.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
names.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
next-bp-other-thread.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
next-bp-other-thread.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
next-while-other-thread-longjmps.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
next-while-other-thread-longjmps.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
no-unwaited-for-left.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
no-unwaited-for-left.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
non-ldr-exc-1.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
non-ldr-exc-1.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
non-ldr-exc-2.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
non-ldr-exc-2.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
non-ldr-exc-3.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
non-ldr-exc-3.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
non-ldr-exc-4.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
non-ldr-exc-4.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
non-ldr-exit.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
non-ldr-exit.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
non-stop-fair-events.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
non-stop-fair-events.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
omp-par-scope.c [gdb/testsuite] Stabilize execution order in omp-par-scope.c 2020-07-20 14:40:52 +02:00
omp-par-scope.exp [gdb/testsuite] Fix gdb.threads/omp-par-scope.exp XPASS 2020-03-20 19:32:07 +01:00
pending-step.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
pending-step.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
print-threads.c
print-threads.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
process-dies-while-detaching.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
process-dies-while-detaching.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
process-dies-while-handling-bp.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
process-dies-while-handling-bp.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
pthread_cond_wait.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
pthread_cond_wait.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
pthreads.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
pthreads.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
queue-signal.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
queue-signal.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
reconnect-signal.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
reconnect-signal.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
schedlock.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
schedlock.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
siginfo-threads.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
siginfo-threads.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
signal-command-handle-nopass.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
signal-command-handle-nopass.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
signal-command-multiple-signals-pending.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
signal-command-multiple-signals-pending.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
signal-delivered-right-thread.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
signal-delivered-right-thread.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
signal-sigtrap.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
signal-sigtrap.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
signal-while-stepping-over-bp-other-thread.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
signal-while-stepping-over-bp-other-thread.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
sigstep-threads.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
sigstep-threads.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
sigthread.c
sigthread.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
slow-waitpid.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
staticthreads.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
staticthreads.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
step-bg-decr-pc-switch-thread.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
step-bg-decr-pc-switch-thread.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
step-over-lands-on-breakpoint.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
step-over-lands-on-breakpoint.exp [gdb/testsuite] Fix timeouts in gdb.threads/step-over-*.exp 2020-03-20 14:59:01 +01:00
step-over-trips-on-watchpoint.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
step-over-trips-on-watchpoint.exp [gdb/testsuite] Fix timeouts in gdb.threads/step-over-*.exp 2020-03-20 14:59:01 +01:00
stepi-random-signal.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
stepi-random-signal.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
stop-with-handle.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
stop-with-handle.exp Fix typo (thead -> thread) 2020-04-28 11:38:26 +02:00
switch-threads.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
switch-threads.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
thread_check.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
thread_check.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
thread_events.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
thread_events.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
thread-execl.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
thread-execl.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
thread-find.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
thread-specific-bp.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
thread-specific-bp.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
thread-specific.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
thread-specific.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
thread-unwindonsignal.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
threadapply.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
threadapply.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
threxit-hop-specific.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
threxit-hop-specific.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
tid-reuse.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
tid-reuse.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
tls2.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
tls-core.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
tls-core.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
tls-main.c
tls-nodebug-pie.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
tls-nodebug-pie.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
tls-nodebug.c
tls-nodebug.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
tls-shared.c
tls-shared.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
tls-so_extern_main.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
tls-so_extern.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
tls-so_extern.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
tls-var-main.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
tls-var.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
tls-var.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
tls.c
tls.exp [gdb/symtab] Store external var decls in psymtab 2020-04-22 08:38:44 +02:00
vfork-follow-child-exec.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
vfork-follow-child-exec.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
vfork-follow-child-exit.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
vfork-follow-child-exit.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
watchpoint-fork-child.c [gdb/testsuite] Fix gdb.threads/watchpoint-fork.exp race 2020-01-29 08:48:53 +01:00
watchpoint-fork-mt.c [gdb/testsuite] Fix gdb.threads/watchpoint-fork.exp race 2020-01-29 08:48:53 +01:00
watchpoint-fork-parent.c [gdb/testsuite] Fix gdb.threads/watchpoint-fork.exp race 2020-01-29 08:48:53 +01:00
watchpoint-fork-st.c [gdb/testsuite] Fix gdb.threads/watchpoint-fork.exp race 2020-01-29 08:48:53 +01:00
watchpoint-fork.exp [gdb/testsuite] Fix gdb.threads/watchpoint-fork.exp race 2020-01-29 08:48:53 +01:00
watchpoint-fork.h Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
watchthreads2.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
watchthreads2.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
watchthreads-reorder.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
watchthreads-reorder.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
watchthreads.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
watchthreads.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
wp-replication.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
wp-replication.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00