[testsuite] Add missing require-effective-target directives in gcc.dg
authorTom de Vries <tdevries@suse.de>
Fri, 7 Aug 2020 06:59:04 +0000 (08:59 +0200)
committerTom de Vries <tdevries@suse.de>
Tue, 11 Aug 2020 16:22:20 +0000 (18:22 +0200)
Add some missing require-effect-targets directives (alloca, indirect_jumps,
label_values and nonlocal_goto).

Tested on nvptx.

gcc/testsuite/ChangeLog:

* gcc.dg/Warray-bounds-46.c: Add missing require-effective-target
directive.
* gcc.dg/Warray-bounds-48.c: Same.
* gcc.dg/Warray-bounds-50.c: Same.
* gcc.dg/Wreturn-local-addr-2.c: Same.
* gcc.dg/Wreturn-local-addr-3.c: Same.
* gcc.dg/Wreturn-local-addr-4.c: Same.
* gcc.dg/Wreturn-local-addr-6.c: Same.
* gcc.dg/Wstack-usage.c: Same.
* gcc.dg/Wstringop-overflow-15.c: Same.
* gcc.dg/Wstringop-overflow-23.c: Same.
* gcc.dg/Wstringop-overflow-25.c: Same.
* gcc.dg/Wstringop-overflow-27.c: Same.
* gcc.dg/Wstringop-overflow-39.c: Same.
* gcc.dg/analyzer/alloca-leak.c: Same.
* gcc.dg/analyzer/data-model-1.c: Same.
* gcc.dg/analyzer/data-model-16.c: Same.
* gcc.dg/analyzer/malloc-1.c: Same.
* gcc.dg/analyzer/malloc-paths-8.c: Same.
* gcc.dg/analyzer/pr93546.c: Same.
* gcc.dg/analyzer/setjmp-1.c: Same.
* gcc.dg/analyzer/setjmp-2.c: Same.
* gcc.dg/analyzer/setjmp-3.c: Same.
* gcc.dg/analyzer/setjmp-4.c: Same.
* gcc.dg/analyzer/setjmp-5.c: Same.
* gcc.dg/analyzer/setjmp-6.c: Same.
* gcc.dg/analyzer/setjmp-7.c: Same.
* gcc.dg/analyzer/setjmp-7a.c: Same.
* gcc.dg/analyzer/setjmp-8.c: Same.
* gcc.dg/analyzer/setjmp-9.c: Same.
* gcc.dg/analyzer/setjmp-pr93378.c: Same.
* gcc.dg/gimplefe-44.c: Same.
* gcc.dg/pr84131.c: Same.
* gcc.dg/pr93986.c: Same.
* gcc.dg/pr95133.c: Same.
* gcc.dg/pr95857.c: Same.
* gcc.dg/strlenopt-83.c: Same.
* gcc.dg/strlenopt-84.c: Same.
* gcc.dg/strlenopt-91.c: Same.
* gcc.dg/uninit-32.c: Same.
* gcc.dg/uninit-36.c: Same.

40 files changed:
gcc/testsuite/gcc.dg/Warray-bounds-46.c
gcc/testsuite/gcc.dg/Warray-bounds-48.c
gcc/testsuite/gcc.dg/Warray-bounds-50.c
gcc/testsuite/gcc.dg/Wreturn-local-addr-2.c
gcc/testsuite/gcc.dg/Wreturn-local-addr-3.c
gcc/testsuite/gcc.dg/Wreturn-local-addr-4.c
gcc/testsuite/gcc.dg/Wreturn-local-addr-6.c
gcc/testsuite/gcc.dg/Wstack-usage.c
gcc/testsuite/gcc.dg/Wstringop-overflow-15.c
gcc/testsuite/gcc.dg/Wstringop-overflow-23.c
gcc/testsuite/gcc.dg/Wstringop-overflow-25.c
gcc/testsuite/gcc.dg/Wstringop-overflow-27.c
gcc/testsuite/gcc.dg/Wstringop-overflow-39.c
gcc/testsuite/gcc.dg/analyzer/alloca-leak.c
gcc/testsuite/gcc.dg/analyzer/data-model-1.c
gcc/testsuite/gcc.dg/analyzer/data-model-16.c
gcc/testsuite/gcc.dg/analyzer/malloc-1.c
gcc/testsuite/gcc.dg/analyzer/malloc-paths-8.c
gcc/testsuite/gcc.dg/analyzer/pr93546.c
gcc/testsuite/gcc.dg/analyzer/setjmp-1.c
gcc/testsuite/gcc.dg/analyzer/setjmp-2.c
gcc/testsuite/gcc.dg/analyzer/setjmp-3.c
gcc/testsuite/gcc.dg/analyzer/setjmp-4.c
gcc/testsuite/gcc.dg/analyzer/setjmp-5.c
gcc/testsuite/gcc.dg/analyzer/setjmp-6.c
gcc/testsuite/gcc.dg/analyzer/setjmp-7.c
gcc/testsuite/gcc.dg/analyzer/setjmp-7a.c
gcc/testsuite/gcc.dg/analyzer/setjmp-8.c
gcc/testsuite/gcc.dg/analyzer/setjmp-9.c
gcc/testsuite/gcc.dg/analyzer/setjmp-pr93378.c
gcc/testsuite/gcc.dg/gimplefe-44.c
gcc/testsuite/gcc.dg/pr84131.c
gcc/testsuite/gcc.dg/pr93986.c
gcc/testsuite/gcc.dg/pr95133.c
gcc/testsuite/gcc.dg/pr95857.c
gcc/testsuite/gcc.dg/strlenopt-83.c
gcc/testsuite/gcc.dg/strlenopt-84.c
gcc/testsuite/gcc.dg/strlenopt-91.c
gcc/testsuite/gcc.dg/uninit-32.c
gcc/testsuite/gcc.dg/uninit-36.c

index 3f1c6c7..4effe5c 100644 (file)
@@ -3,7 +3,8 @@
    Test to verify that past-the-end accesses by string functions to member
    arrays by-reference objects are diagnosed.
    { dg-do compile }
-   { dg-options "-O2 -Wall -Wno-unused-local-typedefs -Wno-stringop-overflow -ftrack-macro-expansion=0" }  */
+   { dg-options "-O2 -Wall -Wno-unused-local-typedefs -Wno-stringop-overflow -ftrack-macro-expansion=0" }
+   { dg-require-effective-target alloca } */
 
 #define SA(expr) typedef int StaticAssert [2 * !!(expr) - 1]
 
index d6a327e..13373d1 100644 (file)
@@ -1,7 +1,8 @@
 /* PR middle-end/91647 - missing -Warray-bounds accessing a zero-length array
    of a declared object
    { dg-do "compile" }
-   { dg-options "-O2 -Wall" } */
+   { dg-options "-O2 -Wall" }
+   { dg-require-effective-target alloca } */
 
 typedef __INT16_TYPE__ int16_t;
 typedef __INT32_TYPE__ int32_t;
index d6edfac..05c89b2 100644 (file)
@@ -1,6 +1,7 @@
 /* PR middle-end/92349 - ICE in -Warray-bounds on a VLA member
    { dg-do compile }
-   { dg-options "-O2 -Wall" } */
+   { dg-options "-O2 -Wall" }
+   { dg-require-effective-target alloca } */
 
 typedef __SIZE_TYPE__ size_t;
 
index 0e3435c..9273690 100644 (file)
@@ -1,6 +1,7 @@
 /* PR c/71924 - missing -Wreturn-local-addr returning alloca result
    { dg-do compile }
-   { dg-options "-O2 -Wall" } */
+   { dg-options "-O2 -Wall" }
+   { dg-require-effective-target alloca } */
 
 #define ATTR(...) __attribute__ ((__VA_ARGS__))
 
index 6dad7af..e922888 100644 (file)
@@ -1,6 +1,7 @@
 /* PR c/71924 - missing -Wreturn-local-addr returning alloca result
    { dg-do compile }
-   { dg-options "-O2 -Wall" } */
+   { dg-options "-O2 -Wall" }
+   { dg-require-effective-target alloca } */
 
 #define ATTR(...) __attribute__ ((__VA_ARGS__))
 
index 0a451ef..4a3b07b 100644 (file)
@@ -1,6 +1,7 @@
 /* PR c/71924 - missing -Wreturn-local-addr returning alloca result
    { dg-do compile }
-   { dg-options "-O2 -Wall" } */
+   { dg-options "-O2 -Wall" }
+   { dg-require-effective-target alloca } */
 
 #define ATTR(...) __attribute__ ((__VA_ARGS__))
 
index 70138b3..844660f 100644 (file)
@@ -1,6 +1,7 @@
 /* PR c/71924 - missing -Wreturn-local-addr returning alloca result
    { dg-do compile }
-   { dg-options "-O2 -Wall" } */
+   { dg-options "-O2 -Wall" }
+   { dg-require-effective-target alloca } */
 
 typedef __SIZE_TYPE__ size_t;
 
index 4738b69..11e3a27 100644 (file)
@@ -1,6 +1,7 @@
 /* PR 90983/manual documents `-Wno-stack-usage` flag, but it is unrecognized
    { dg-do compile }
-   { dg-options "-Wall -Wstack-usage=123 -Wno-stack-usage" } */
+   { dg-options "-Wall -Wstack-usage=123 -Wno-stack-usage" }
+   { dg-require-effective-target alloca } */
 
 void f (void*);
 
index 12f8f9d..1907bac 100644 (file)
@@ -4,7 +4,8 @@
    for either kind of VLAs (member and non-member).
    Diagnosing the accesses is the subject of pr82608.
    { dg-do compile }
-   { dg-options "-O2 -Wall -Wno-array-bounds" } */
+   { dg-options "-O2 -Wall -Wno-array-bounds" }
+   { dg-require-effective-target alloca } */
 
 void sink (void*);
 
index 6d9fcb9..69c71cc 100644 (file)
@@ -4,7 +4,8 @@
    warnings are issued for calls to user-defined functions with attribute
    access and with non-constant out-of-bounds arguments.
    { dg-do compile }
-   { dg-options "-O2 -Wall" } */
+   { dg-options "-O2 -Wall" }
+   { dg-require-effective-target alloca } */
 
 #include "range.h"
 
index 109a1dd..bc60958 100644 (file)
@@ -1,6 +1,7 @@
 /* PR middle-end/91582 - missing heap overflow detection for strcpy
    { dg-do compile }
-   { dg-options "-O2 -Wall -Wno-array-bounds -ftrack-macro-expansion=0" } */
+   { dg-options "-O2 -Wall -Wno-array-bounds -ftrack-macro-expansion=0" }
+   { dg-require-effective-target alloca } */
 
 #include "range.h"
 
index 8e2cfe3..37c1ca2 100644 (file)
@@ -2,7 +2,8 @@
    PR middle-end/85484 - missing -Wstringop-overflow for strcpy with
    a string of non-const length
    { dg-do compile }
-   { dg-options "-O2 -Wall -Wno-array-bounds" } */
+   { dg-options "-O2 -Wall -Wno-array-bounds" }
+   { dg-require-effective-target alloca } */
 
 typedef __SIZE_TYPE__ size_t;
 
index f83646a..295a38d 100644 (file)
@@ -1,7 +1,8 @@
 /* PR middle-end/95667 - unintended warning for memset writing across multiple
    members
    { dg-do compile }
-   { dg-options "-O2 -Wall" } */
+   { dg-options "-O2 -Wall" }
+   { dg-require-effective-target alloca } */
 
 extern void sink (void*);
 
index 6d9fe34..9331993 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target alloca } */
+
 #include <alloca.h>
 
 void *test (void)
index 1db9913..0a906e5 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target alloca } */
+
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
index a8acfbe..616d353 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target label_values } */
+
 /* Labels as values.  */
 
 #include "analyzer-decls.h"
index 3024e54..4d9afa4 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target alloca } */
+
 #include <alloca.h>
 #include <stdlib.h>
 
index 10b97a0..35c9385 100644 (file)
@@ -1,4 +1,5 @@
 /* { dg-additional-options "-fanalyzer-transitivity" } */
+/* { dg-require-effective-target alloca } */
 
 #include <stddef.h>
 #include <alloca.h>
index 432a643..66f6805 100644 (file)
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-require-effective-target label_values } */
 
 void
 ch (int x1)
index c9827fb..72da6c4 100644 (file)
@@ -1 +1,2 @@
+/* { dg-require-effective-target indirect_jumps } */
 #include "../pr26983.c"
index beaf436..f5d9c53 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-additional-options "-fdiagnostics-show-line-numbers -fdiagnostics-path-format=inline-events -fdiagnostics-show-caret" } */
 /* { dg-enable-nn-line-numbers "" } */
+/* { dg-require-effective-target indirect_jumps } */
 
 #include "test-setjmp.h"
 #include <stddef.h>
index 5c1d406..3e4f870 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-additional-options "-fdiagnostics-show-line-numbers -fdiagnostics-path-format=inline-events -fdiagnostics-show-caret" } */
 /* { dg-enable-nn-line-numbers "" } */
+/* { dg-require-effective-target indirect_jumps } */
 
 #include <stddef.h>
 #include "test-setjmp.h"
index f216a45..b6f7d0e 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-additional-options "-fdiagnostics-show-line-numbers -fdiagnostics-path-format=inline-events -fdiagnostics-show-caret" } */
 /* { dg-enable-nn-line-numbers "" } */
+/* { dg-require-effective-target indirect_jumps } */
 
 #include "test-setjmp.h"
 #include "analyzer-decls.h"
index 3ee0298..bf5b9bf 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-additional-options "-fdiagnostics-show-line-numbers -fdiagnostics-path-format=inline-events -fdiagnostics-show-caret" } */
 /* { dg-enable-nn-line-numbers "" } */
+/* { dg-require-effective-target indirect_jumps } */
 
 #include "test-setjmp.h"
 #include <stddef.h>
index 0e0f12f..3aa6b23 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_jumps } */
+
 #include "test-setjmp.h"
 #include <stddef.h>
 #include <stdlib.h>
index 6cf9824..6a519b7 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_jumps } */
+
 #include "test-setjmp.h"
 #include <stddef.h>
 #include <stdlib.h>
index 87d35bc..220f95e 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-additional-options "-fdiagnostics-show-line-numbers -fdiagnostics-path-format=inline-events -fdiagnostics-show-caret" } */
 /* { dg-enable-nn-line-numbers "" } */
+/* { dg-require-effective-target indirect_jumps } */
 
 #include "test-setjmp.h"
 #include <stdlib.h>
index abbee2d..79614d1 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-additional-options "-fdiagnostics-show-line-numbers -fdiagnostics-path-format=inline-events -fdiagnostics-show-caret" } */
 /* { dg-enable-nn-line-numbers "" } */
+/* { dg-require-effective-target indirect_jumps } */
 
 #include "test-setjmp.h"
 #include <stddef.h>
index cf75d3a..c2b00e3 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-additional-options "-fdiagnostics-show-line-numbers -fdiagnostics-path-format=inline-events -fdiagnostics-show-caret" } */
 /* { dg-enable-nn-line-numbers "" } */
+/* { dg-require-effective-target indirect_jumps } */
 
 #include "test-setjmp.h"
 #include <stddef.h>
index 73b94d4..6e2468e 100644 (file)
@@ -1,4 +1,5 @@
 /* { dg-additional-options "-O1 -g" } */
+/* { dg-require-effective-target indirect_jumps } */
 
 #include <setjmp.h>
 
index a9a92b1..4580a1d 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-fexceptions -fgimple -fdump-tree-eh-eh" } */
+/* { dg-require-effective-target nonlocal_goto } */
 
 void __GIMPLE foo()
 {
index 0ba9651..ced2e5d 100644 (file)
@@ -1,7 +1,8 @@
 /* PR 94131 - ICE on printf with a VLA string and -fno-tree-ccp
    -fno-tree-forwprop
    { dg-do compile }
-   { dg-options "-O1 -fno-tree-ccp -fno-tree-forwprop" } */
+   { dg-options "-O1 -fno-tree-ccp -fno-tree-forwprop" }
+   { dg-require-effective-target alloca } */
 
 void rv1 (int n)
 {
index bdbc192..0d533f4 100644 (file)
@@ -1,6 +1,7 @@
 /* PR tree-optimization/93986 - ICE in decompose, at wide-int.h:984
    { dg-do compile }
-   { dg-options "-O1 -foptimize-strlen -ftree-slp-vectorize" } */
+   { dg-options "-O1 -foptimize-strlen -ftree-slp-vectorize" }
+   { dg-require-effective-target alloca } */
 
 int dd (void);
 
index 523deca..5e23359 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O3" } */
+/* { dg-require-effective-target label_values } */
 
 extern int a[16];
 void f (int *ip, int x)
index 41506ea..afd6f46 100644 (file)
@@ -1,6 +1,7 @@
 /* PR tree-optimization/95857 */
 /* { dg-do compile } */
 /* { dg-options "-O2" } */
+/* { dg-require-effective-target label_values } */
 
 struct E { int e; };
 int bar (void), baz (void);
index 5baafea..baa80cf 100644 (file)
@@ -1,7 +1,8 @@
 /* PR tree-optimization/83821 - local aggregate initialization defeats
    strlen optimization
    { dg-do compile }
-   { dg-options "-O2 -Wall -fdump-tree-optimized" } */
+   { dg-options "-O2 -Wall -fdump-tree-optimized" }
+   { dg-require-effective-target alloca } */
 
 #include "strlenopt.h"
 char *p_p2, *p_p5, *p_p9, *p_p14;
index d6102b6..0c9da3c 100644 (file)
@@ -3,7 +3,8 @@
    Verify that stores that overwrite an interior nul are correctly
    reflected in strlen results.
    { dg-do run }
-   { dg-options "-O2 -Wall" } */
+   { dg-options "-O2 -Wall" }
+   { dg-require-effective-target alloca } */
 
 #define false (0 == 1)
 #define true (0 == 0)
index 2381d03..a305561 100644 (file)
@@ -1,7 +1,8 @@
 /* PR tree-optimization/92412 - excessive errno aliasing assumption defeats
    optimization
    { dg-do compile }
-   { dg-options "-O2 -Wall -fdump-tree-optimized" } */
+   { dg-options "-O2 -Wall -fdump-tree-optimized" }
+   { dg-require-effective-target alloca } */
 
 typedef __SIZE_TYPE__ size_t;
 
index cdc0512..cf9efa0 100644 (file)
@@ -1,7 +1,8 @@
 /* PR middle-end/10138 - warn for uninitialized arrays passed as const*
    arguments
    { dg-do compile }
-   { dg-options "-O -Wall" } */
+   { dg-options "-O -Wall" }
+   { dg-require-effective-target alloca } */
 
 typedef __SIZE_TYPE__ size_t;
 
index 9524e7a..f6307ce 100644 (file)
@@ -3,7 +3,8 @@
    Verify that passing pointers to uninitialized objects to const
    arguments to built-ins is diagnosed where expected.
    { dg-do compile }
-   { dg-options "-O -Wall" } */
+   { dg-options "-O -Wall" }
+   { dg-require-effective-target alloca } */
 
 typedef __SIZE_TYPE__ size_t;