[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 3f1c6c715ea3e3b8caccc976f9cd48bed0fe9967..4effe5c2051b8fd70f092c780c6e46599587581a 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 d6a327e36894d0c8974fdd36c9eb9597bff41cbb..13373d1e99e0d45d1587b42bff11d6e198362ae5 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 d6edfac6ad7d6e417fd58e6e79c029440f138302..05c89b2d87fb6a40853da35e72aa0f85e3e10ff8 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 0e3435c825686cc1cca57898a448c81305e3d9d4..9273690fef320439fb13db71efc13abd1e7da45c 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 6dad7af97e649261742f2b06198a16c7632c8a9b..e922888a4bfb1bc5594d869883f47fed69857769 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 0a451efcaf03ea5510760588f7e16faac709af36..4a3b07ba02cd4b4f9e7888cc8d8dedd55a5bf1a5 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 70138b3eff8fb17d749ba31b74bce987cb93f577..844660ff0152b47a095fb4ab8d59ccb169e276ac 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 4738b69478b8a43ce679559f834d48cab0243913..11e3a27b66b130694439f3e4da438103bbe1a697 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 12f8f9d353b3b38d838be82cd16d22e59ae8443c..1907bac27221d9ada069cdfb581f3c14e6d9ea6b 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 6d9fcb9d52ebf8176c0ceb44a431d2dccb6c7d85..69c71cc4c3036155a7591efbdadcef4156a0f9c6 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 109a1dd91274f1da946ee374ed5416fe9acf0e1a..bc6095875753dd676eb00173af8d0451b663acd8 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 8e2cfe307250c79c9bf51aa4c516e0901ba6c064..37c1ca297131090d52836e78e98637b2c5830c3d 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 f83646a37217f2f4bc00593c4c6ca3e1e9003cfe..295a38de926bf74ede438250d928b7a81b079b0f 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 6d9fe3431ceaf400e3548471bba2c5492744fbc9..93319932d44aca54b514cef27a83310f4c878bdb 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target alloca } */
+
 #include <alloca.h>
 
 void *test (void)
index 1db99133d50e5110633b204a5fdad7b61591329f..0a906e5b62ec1b5a1736f06bcc31c8d01610a036 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target alloca } */
+
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
index a8acfbeeb77a7a24168232788966f810008a1495..616d3537054897670a751fbd2f373f5d080e79c2 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target label_values } */
+
 /* Labels as values.  */
 
 #include "analyzer-decls.h"
index 3024e54613763175658f03344a8da26d8933a1fb..4d9afa483c94636cf7a5c940a6522e14aec53a6f 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target alloca } */
+
 #include <alloca.h>
 #include <stdlib.h>
 
index 10b97a054026bd46c230360ac286fbffbcf6c161..35c9385b20611b9c6c00dcdcfdc7089e174d4828 100644 (file)
@@ -1,4 +1,5 @@
 /* { dg-additional-options "-fanalyzer-transitivity" } */
+/* { dg-require-effective-target alloca } */
 
 #include <stddef.h>
 #include <alloca.h>
index 432a6433be50586e1bd80700f37986624a3fb72d..66f6805b07a99ca25398450c6f78816351c8597d 100644 (file)
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-require-effective-target label_values } */
 
 void
 ch (int x1)
index c9827fbd2989fbe707ad3861e0ba2d1e14bc2b10..72da6c4a9803b6689eb6a8188545c664f8350b4d 100644 (file)
@@ -1 +1,2 @@
+/* { dg-require-effective-target indirect_jumps } */
 #include "../pr26983.c"
index beaf43684e0bf7e0767ca9142bcd7a30eb246574..f5d9c53e2393e78cf2e3316985a0fe203860142a 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 5c1d4060c3b532e172e6e541ee376012b171e67b..3e4f870e5e8f7c744f35863fdb2a5cbf169eaa66 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 f216a456b5933b47c1977237b01f9df896b87d9d..b6f7d0e777b8010bb49dd52f1e992966025b0156 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 3ee02980e572476b838d22fd6cb68a666d176f28..bf5b9bfda819e6e94aee86142e60f87f345c35ae 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 0e0f12f919c960cf66c64c890e09cd2d10a215fb..3aa6b23d6b36a26f354a608b100539dcba167c68 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_jumps } */
+
 #include "test-setjmp.h"
 #include <stddef.h>
 #include <stdlib.h>
index 6cf98247bb65ee02bb97c3d838d438eb3c8008d2..6a519b7e138021397ec11ea6560b261bb4b3ea18 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_jumps } */
+
 #include "test-setjmp.h"
 #include <stddef.h>
 #include <stdlib.h>
index 87d35bc88f3c246ce08c39e51d2cd2afeb754cd5..220f95e0d05dfb63887e05d732058c97b29a1eb5 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 abbee2d91081eaaace752b3a4651a182742ef659..79614d123bd9c5a5b407a099a901709645c11105 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 cf75d3ad896c267d0de6ed196b6e4ff48200febc..c2b00e3b95c5bb1a70f73a11776da2d22cb94add 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 73b94d4d36b2f1e0086a0627d95a933604eef026..6e2468e701a28b332db32bbce147bd18c32a6666 100644 (file)
@@ -1,4 +1,5 @@
 /* { dg-additional-options "-O1 -g" } */
+/* { dg-require-effective-target indirect_jumps } */
 
 #include <setjmp.h>
 
index a9a92b1701ec92ca703e10f72304dea2f1194d60..4580a1d0b85c2e6900e96d8f223dfbbfcbc1aadf 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 0ba96516fe31b6be330f6009b3da1fec5436dec8..ced2e5d93295da19cc027aadc0656138ee6db042 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 bdbc192a01da314510226a3b62d669c4009a3e06..0d533f4dbc2fabbbe44e3c504d58102998a875ea 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 523decaf90e3f89024fa0cd5127ac4a586a51745..5e233595edbcfbdba2a784c1cbf6e65db3e17fd6 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 41506ea68933713eeb33290081aab0f3c634ef26..afd6f46ea385316e131be2efac93b899eed9703a 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 5baafea5c320271c2942048d52c07decaad5e1d7..baa80cf96439cb04f2f42df26479ef12bb5f8cfa 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 d6102b6e6f572c45965dfdf44ec2fdf80f8a1206..0c9da3c1b59e3da73d10d37c4fabb32f22e3f330 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 2381d03e44a24038a80910482547cb9f571c7666..a30556128edb7b696b1d9f04b4c652fa72b519a6 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 cdc05128dfdc9dc961d1b04662362614bd516694..cf9efa0f06446185926aa7a9767c8dbc9cd6446e 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 9524e7ad1b98432f92b12bd8cd03c7891917dfee..f6307ce591372d9464303141c514ce270996c7d9 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;