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]
/* 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;
/* 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;
/* 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__))
/* 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__))
/* 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__))
/* 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;
/* 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*);
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*);
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"
/* 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"
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;
/* 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*);
+/* { dg-require-effective-target alloca } */
+
#include <alloca.h>
void *test (void)
+/* { dg-require-effective-target alloca } */
+
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
+/* { dg-require-effective-target label_values } */
+
/* Labels as values. */
#include "analyzer-decls.h"
+/* { dg-require-effective-target alloca } */
+
#include <alloca.h>
#include <stdlib.h>
/* { dg-additional-options "-fanalyzer-transitivity" } */
+/* { dg-require-effective-target alloca } */
#include <stddef.h>
#include <alloca.h>
/* { dg-do compile } */
+/* { dg-require-effective-target label_values } */
void
ch (int x1)
+/* { dg-require-effective-target indirect_jumps } */
#include "../pr26983.c"
/* { 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>
/* { 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"
/* { 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"
/* { 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>
+/* { dg-require-effective-target indirect_jumps } */
+
#include "test-setjmp.h"
#include <stddef.h>
#include <stdlib.h>
+/* { dg-require-effective-target indirect_jumps } */
+
#include "test-setjmp.h"
#include <stddef.h>
#include <stdlib.h>
/* { 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>
/* { 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>
/* { 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>
/* { dg-additional-options "-O1 -g" } */
+/* { dg-require-effective-target indirect_jumps } */
#include <setjmp.h>
/* { dg-do compile } */
/* { dg-options "-fexceptions -fgimple -fdump-tree-eh-eh" } */
+/* { dg-require-effective-target nonlocal_goto } */
void __GIMPLE foo()
{
/* 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)
{
/* 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);
/* { dg-do compile } */
/* { dg-options "-O3" } */
+/* { dg-require-effective-target label_values } */
extern int a[16];
void f (int *ip, int x)
/* 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);
/* 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;
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)
/* 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;
/* 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;
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;