[testsuite] Add effective target large_initializer
authorTom de Vries <tdevries@suse.de>
Tue, 11 Aug 2020 16:20:17 +0000 (18:20 +0200)
committerTom de Vries <tdevries@suse.de>
Wed, 12 Aug 2020 12:04:41 +0000 (14:04 +0200)
commitfb9b3c0ff7d347934b364e3ab06d4cf56726df33
treeec1acaec76a2b08cbdc686880ceeb5e73d44ea45
parentb9c7fe59f9f66ecc091e215c826ecd1a04d032dc
[testsuite] Add effective target large_initializer

When compiling builtin-object-size-21.c for nvptx, cc1 times out while
emitting the initializer for global variable xm3_3.

With x86_64, we are able to emit the initializer with a few lines of assembly:
...
xm3_3:
        .byte   0
        .zero   9223372036854775803
        .byte   1
        .byte   2
        .byte   3
...
but with nvptx, we don't have some something similar available, and thus
generate:
...
  .visible .global .align 1 .u32 xm3_3[2305843009213693952] =
  { 0, 0, 0, ...
...

Introduce an effective target large_initializer, returning false for nvptx,
and require it for test-cases with large initializers.

Tested on nvptx with make check-gcc.

gcc/testsuite/ChangeLog:

PR testsuite/96566
* lib/target-supports.exp (check_effective_target_large_initializer):
New proc.
* gcc.dg/builtin-object-size-21.c: Require large_initializer.
* gcc.dg/strlenopt-55.c: Same.
gcc/testsuite/gcc.dg/builtin-object-size-21.c
gcc/testsuite/gcc.dg/strlenopt-55.c
gcc/testsuite/lib/target-supports.exp