+2020-01-29 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
+
+ * gdb.cp/pass-by-ref-2.exp: Mark some tests as XFAIL based on the
+ GCC/Clang version.
+ * gdb.cp/pass-by-ref.exp: Ditto.
+
2020-01-29 Tom de Vries <tdevries@suse.de>
* gdb.threads/watchpoint-fork-child.c: Guard prints with #if DEBUG.
return -1
}
+# GCC version <= 6 and Clang do not emit DW_AT_defaulted and DW_AT_deleted.
+set is_gcc_6_or_older [test_compiler_info {gcc-[0-6]-*}]
+set is_clang [test_compiler_info {clang-*}]
+
set bp_location [gdb_get_line_number "stop here"]
gdb_breakpoint $bp_location
gdb_continue_to_breakpoint "end of main" ".*return .*;"
gdb_test "print cbvInlined (inlined)" \
"expression cannot be evaluated .* \\(maybe inlined\\?\\)"
+if {$is_gcc_6_or_older || $is_clang} {setup_xfail "*-*-*"}
gdb_test "print cbvDtorDel (*dtorDel)" \
".* cannot be evaluated .* 'DtorDel' is not destructible" \
"type not destructible"
".* cannot be evaluated .* 'TwoMCtor' is not copy constructible" \
"copy ctor is implicitly deleted"
+if {$is_gcc_6_or_older || $is_clang} {setup_xfail "*-*-*"}
gdb_test "print cbvTwoMCtorAndCCtor (twoMctorAndCctor)" "12" \
"call cbvTwoMCtorAndCCtor"
gdb_test "print twoMctorAndCctor.x" "2" \
global ADDED
global TRACE
+ # GCC version <= 6 and Clang do not emit DW_AT_defaulted and DW_AT_deleted.
+ set is_gcc_6_or_older [test_compiler_info {gcc-[0-6]-*}]
+ set is_clang [test_compiler_info {clang-*}]
+ # But Clang version >= 7 emits DW_AT_calling_convention for types.
+ set is_clang_6_or_older [test_compiler_info {clang-[0-6]-*}]
+
with_test_prefix $name {
if {[is_copy_constructible $states]} {
set expected [expr {$ORIGINAL + $ADDED}]
if {$dtor == "explicit"} {
gdb_test "print tracer = 0" " = 0" "reset the tracer"
}
+
+ if {$cctor == "defaultedIn" || $dtor == "defaultedIn"} {
+ if {$is_gcc_6_or_older || $is_clang_6_or_older} {
+ setup_xfail "*-*-*"
+ } elseif {$is_clang} {
+ # If this is a pass-by-value case, Clang >= 7's
+ # DW_AT_calling_convention leads to the right decision.
+ # Otherwise, it is expected to fail.
+ if {"defaultedOut" in $states || "explicit" in $states} {
+ setup_xfail "*-*-*"
+ }
+ }
+ }
gdb_test "print ${cbvfun}<$name> (${name}_var)" " = $expected" \
"call '$cbvfun'"
gdb_test "print ${name}_var.${data_field}\[0\]" " = $ORIGINAL" \
"cbv argument should not change (item $last_index)"
}
if {$dtor == "explicit"} {
+ if {$cctor == "defaultedIn"
+ && ($is_gcc_6_or_older || $is_clang)} {
+ setup_xfail "*-*-*"
+ }
gdb_test "print tracer" " = $TRACE" \
"destructor should be called"
}
} else {
+ if {$cctor == "deleted" && ($is_gcc_6_or_older || $is_clang)} {
+ setup_xfail "*-*-*"
+ }
gdb_test "print ${cbvfun}<$name> (${name}_var)" \
".* cannot be evaluated .* '${name}' is not copy constructible" \
"calling '$cbvfun' should be refused"