standard_testfile .cc casts03.cc
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
+set opts {}
+lappend opts debug
+lappend opts c++
+lappend opts additional_flags=-std=c++11
+
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} {
return -1
}
# This file is part of the gdb testsuite.
require allow_cplus_tests
+require {have_compile_flag -std=c++17}
standard_testfile .cc
standard_testfile .cc
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
+set opts {}
+lappend opts debug
+lappend opts additional_flags=-std=c++11
+
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} {
return -1
}
gdb_test "print arg1" " = 8"
gdb_test "print arg2" " = 4"
-gdb_test "ptype arg1" "type = enum enum1 : unsigned int \\{\\}"
-gdb_test "ptype arg2" "type = enum class enum2 : unsigned char \\{\\}"
+
+# Xfail for missing DW_AT_type in DW_TAG_enumeration_type, gcc PR debug/16063.
+set have_xfail [expr [test_compiler_info gcc-*] && [gcc_major_version] < 5]
+
+gdb_test_multiple "ptype arg1" "" {
+ -re -wrap "type = enum enum1 : unsigned int \\{\\}" {
+ pass $gdb_test_name
+ }
+ -re -wrap "type = enum enum1 \\{\\}" {
+ if { $have_xfail } {
+ setup_xfail *-*-* gcc/16063
+ }
+ fail $gdb_test_name
+ }
+}
+
+gdb_test_multiple "ptype arg2" "" {
+ -re -wrap "type = enum class enum2 : unsigned char \\{\\}" {
+ pass $gdb_test_name
+ }
+ -re -wrap "type = enum class enum2 \\{\\}" {
+ if { $have_xfail } {
+ setup_xfail *-*-* gcc/16063
+ }
+ fail $gdb_test_name
+ }
+}
standard_testfile .cc
-if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
- {debug c++ additional_flags=-Wno-unused-comparison}] } {
+set opts {}
+lappend opts debug
+lappend opts c++
+lappend opts additional_flags=-Wno-unused-comparison
+lappend opts additional_flags=-std=c++11
+
+if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] } {
return -1
}
standard_testfile .cc
-if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
+set opts {}
+lappend opts debug
+lappend opts additional_flags=-std=c++11
+
+if { [prepare_for_testing "failed to prepare" $testfile $srcfile $opts] } {
return -1
}
standard_testfile .cc
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
+set opts {}
+lappend opts debug
+lappend opts c++
+lappend opts additional_flags=-std=c++11
+
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} {
return -1
}
standard_testfile .cc
set flags [list debug c++]
+lappend flags additional_flags=-std=c++11
+
if { [test_compiler_info gcc-*] && [gcc_major_version] >= 10 } {
# Work around PR gcc/101452.
lappend flags additional_flags=-DGCC_BUG
standard_testfile .cc
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
+set opts {}
+lappend opts debug
+lappend opts c++
+lappend opts additional_flags=-std=c++11
+
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} {
return -1
}