int abc;
};
+/* Work around PR gcc/101452. */
+static_member static_member::Empty;
+
struct empty_member
{
struct { } empty;
return -1
}
+set flags [list debug c++]
+if { [test_compiler_info gcc-*] && [gcc_major_version] >= 10 } {
+ # Work around PR gcc/101452.
+ lappend flags additional_flags=-fno-eliminate-unused-debug-types
+}
+
if {[prepare_for_testing "failed to prepare" $testfile \
- [list $srcfile $srcfile2] {debug c++}]} {
+ [list $srcfile $srcfile2] $flags]} {
return -1
}
return -1
}
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
+set flags [list debug c++]
+if { [test_compiler_info gcc-*] && [gcc_major_version] >= 10 } {
+ # Work around PR gcc/101452.
+ lappend flags additional_flags=-fno-eliminate-unused-debug-types
+}
+
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} {
return -1
}
standard_testfile .cc
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
+set flags [list debug c++]
+if { [test_compiler_info gcc-*] && [gcc_major_version] >= 10 } {
+ # Work around PR gcc/101452.
+ lappend flags additional_flags=-fno-eliminate-unused-debug-types
+}
+
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} {
return -1
}
return -1
}
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
+set flags [list debug c++]
+if { [test_compiler_info gcc-*] && [gcc_major_version] >= 10 } {
+ # Work around PR gcc/101452.
+ lappend flags additional_flags=-DGCC_BUG
+}
+
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} {
return -1
}
return [string match $compiler $compiler_info]
}
+# Return the gcc major version, or -1.
+# For gcc 4.8.5, the major version is 4.8.
+# For gcc 7.5.0, the major version 7.
+
+proc gcc_major_version { } {
+ global compiler_info
+ global decimal
+ if { ![test_compiler_info "gcc-*"] } {
+ return -1
+ }
+ set res [regexp gcc-($decimal)-($decimal)- $compiler_info \
+ dummy_var major minor]
+ if { $res != 1 } {
+ return -1
+ }
+ if { $major >= 5} {
+ return $major
+ }
+ return $major.$minor
+}
+
proc current_target_name { } {
global target_info
if [info exists target_info(target,name)] {