Skip to content

Commit b1cb7a5

Browse files
author
Dimitar Dimitrov
committed
testsuite: Skip tests incompatible with generic thunk support
Some backends do not define TARGET_ASM_OUTPUT_MI_THUNK. But the generic thunk support cannot emit code for calling variadic methods of multiple-inheritance classes. Example error for pru-unknown-elf: .../gcc/gcc/testsuite/g++.dg/ipa/pr83549.C:7:24: error: generic thunk code fails for method 'virtual void C::_ZThn4_N1C3fooEz(...)' which uses '...' Disable the affected tests for all targets which do not define TARGET_ASM_OUTPUT_MI_THUNK. Ensured that test results with and without this patch for x86_64-pc-linux-gnu are the same. gcc/ChangeLog: * doc/sourcebuild.texi: Document variadic_mi_thunk effective target check. gcc/testsuite/ChangeLog: * g++.dg/ipa/pr83549.C: Require effective target variadic_mi_thunk. * g++.dg/ipa/pr83667.C: Ditto. * g++.dg/torture/pr81812.C: Ditto. * g++.old-deja/g++.jason/thunk3.C: Ditto. * lib/target-supports.exp (check_effective_target_variadic_mi_thunk): New function. Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
1 parent 07b29ef commit b1cb7a5

File tree

6 files changed

+39
-1
lines changed

6 files changed

+39
-1
lines changed

gcc/doc/sourcebuild.texi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2957,6 +2957,9 @@ Target supports @code{sysconf}.
29572957
@item trampolines
29582958
Target supports trampolines.
29592959

2960+
@item variadic_mi_thunk
2961+
Target supports C++ virtual variadic function calls with multiple inheritance.
2962+
29602963
@item two_plus_gigs
29612964
Target supports linking programs with 2+GiB of data.
29622965

gcc/testsuite/g++.dg/ipa/pr83549.C

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// PR ipa/83549
22
// { dg-do compile }
3+
// { dg-require-effective-target variadic_mi_thunk }
34
// { dg-options "-O2" }
45

56
struct A { virtual ~A (); };

gcc/testsuite/g++.dg/ipa/pr83667.C

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// { dg-require-alias "" }
22
// { dg-options "-fdump-ipa-inline" }
33
// c++/83667 ICE dumping a static thunk when TARGET_USE_LOCAL_THUNK_ALIAS_P
4+
// { dg-require-effective-target variadic_mi_thunk }
45

56

67
struct a

gcc/testsuite/g++.dg/torture/pr81812.C

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// { dg-xfail-if "PR108277" { arm_thumb1 } }
2+
// { dg-require-effective-target variadic_mi_thunk }
23

34
struct Error {
45
virtual void error(... ) const;

gcc/testsuite/g++.old-deja/g++.jason/thunk3.C

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// { dg-do run }
2-
// { dg-skip-if "fails with generic thunk support" { rs6000-*-* powerpc-*-eabi v850-*-* sh-*-* h8*-*-* xtensa*-*-* m32r*-*-* lm32-*-* } }
2+
// { dg-skip-if "fails with generic thunk support" { rs6000-*-* powerpc-*-eabi sh-*-* xtensa*-*-* } }
3+
// { dg-require-effective-target variadic_mi_thunk }
34
// Test that variadic function calls using thunks work right.
45
// Note that this will break on any target that uses the generic thunk
56
// support, because it doesn't support variadic functions.

gcc/testsuite/lib/target-supports.exp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,37 @@ proc check_effective_target_trampolines { } {
659659
return 1
660660
}
661661

662+
# Return 1 if target supports calling virtual variadic methods
663+
# of multi-inheritance classes.
664+
665+
proc check_effective_target_variadic_mi_thunk { } {
666+
# These targets do not implement TARGET_ASM_OUTPUT_MI_THUNK.
667+
if { [istarget avr-*-*]
668+
|| [istarget bpf-*-*]
669+
|| [istarget fr30-*-*]
670+
|| [istarget ft32-*-*]
671+
|| [istarget amdgcn-*-*]
672+
|| [istarget h8300-*-*]
673+
|| [istarget iq2000-*-*]
674+
|| [istarget lm32-*-*]
675+
|| [istarget m32c-*-*]
676+
|| [istarget m32r-*-*]
677+
|| [istarget mcore-*-*]
678+
|| [istarget moxie-*-*]
679+
|| [istarget msp430-*-*]
680+
|| [istarget nvptx-*-*]
681+
|| [istarget pdp11-*-*]
682+
|| [istarget pru-*-*]
683+
|| [istarget rl78-*-*]
684+
|| [istarget rx-*-*]
685+
|| [istarget v850-*-*]
686+
|| [istarget visium-*-*] } {
687+
688+
return 0;
689+
}
690+
return 1
691+
}
692+
662693
# Return 1 if target has limited stack size.
663694

664695
proc check_effective_target_stack_size { } {

0 commit comments

Comments
 (0)