gdb_test "print vla_union_object_size == sizeof(vla_union_object)" \
" = 1" "size of vla_union_object"
-# Fails due to incorrect debugging information generated by GCC.
-setup_xfail "*-*-*"
-gdb_test \
- "print inner_vla_struct_object_size == sizeof(inner_vla_struct_object)" \
- " = 1" "size of inner_vla_struct_object"
+set a -1
+gdb_test_multiple "print inner_vla_struct_object_size" "" {
+ -re -wrap " = ($decimal)" {
+ set a $expect_out(1,string)
+ }
+}
+set b -1
+gdb_test_multiple "print sizeof(inner_vla_struct_object)" "" {
+ -re -wrap " = ($decimal)" {
+ set b $expect_out(1,string)
+ }
+}
+if { [test_compiler_info "gcc-*"] && [gcc_major_version] <= 11 } {
+ # Fails due to incorrect debugging information generated by GCC.
+ setup_xfail "*-*-*"
+}
+gdb_assert {$a == $b} "size of inner_vla_struct_object"