52 lines
1.6 KiB
Text
52 lines
1.6 KiB
Text
|
# Copyright 2022 Free Software Foundation, Inc.
|
||
|
|
||
|
# This program is free software; you can redistribute it and/or modify
|
||
|
# it under the terms of the GNU General Public License as published by
|
||
|
# the Free Software Foundation; either version 3 of the License, or
|
||
|
# (at your option) any later version.
|
||
|
#
|
||
|
# This program is distributed in the hope that it will be useful,
|
||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
# GNU General Public License for more details.
|
||
|
#
|
||
|
# You should have received a copy of the GNU General Public License
|
||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
|
|
||
|
# This file is part of the gdb testsuite.
|
||
|
|
||
|
# Tests which verify (or not) that GDB can access shared and private
|
||
|
# clauses of OpenMP task construct.
|
||
|
|
||
|
standard_testfile
|
||
|
|
||
|
set have_nested_function_support 0
|
||
|
set opts {openmp debug}
|
||
|
|
||
|
if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} {
|
||
|
return -1
|
||
|
}
|
||
|
|
||
|
if {[info procs gdb_openmp_setup] != ""} {
|
||
|
if {[gdb_openmp_setup $binfile] != ""} {
|
||
|
untested "could not set up OpenMP environment"
|
||
|
return -1
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if {![runto_main]} {
|
||
|
return -1
|
||
|
}
|
||
|
|
||
|
gdb_breakpoint [gdb_get_line_number "omp task shared"]
|
||
|
gdb_test "continue" ".*Breakpoint 2.*" "continue 1"
|
||
|
gdb_test "print share1" "= 9"
|
||
|
gdb_test "print share2" "= 11"
|
||
|
gdb_test "print share3" "= 13"
|
||
|
gdb_test "disable 2" ".*"
|
||
|
gdb_breakpoint [gdb_get_line_number "share1 = priv1"]
|
||
|
gdb_test "continue" ".*Breakpoint 3.*" "continue 2"
|
||
|
gdb_test "print priv1" "= 10"
|
||
|
gdb_test "print priv2" "= 12"
|
||
|
gdb_test "print fpriv" "= 14"
|