+/* { dg-require-effective-target int32 } */
+
typedef char __attribute__((__vector_size__ (64))) U;
typedef int __attribute__((__vector_size__ (64))) V;
/* PR tree-optimization/98199 */
+/* { dg-require-effective-target int32plus } */
struct A { long a; short d; int c, f, e, g; };
struct B { int a, i; short j; struct A k; signed : 20; int e, g; } __attribute__((packed));
an object of incomplete type
{ dg-do compile }
{ dg-options "-O2 -Wall" } */
+/* { dg-skip-if "acessing data memory with program memory address" { "avr-*-*" } } */
struct S
{
// The first three elements fit in the tail padding.
a0.a2[0] = 0; a0.a2[1] = 1; a0.a2[2] = 2;
- a0.a2[3] = 3; // { dg-warning "array subscript 3 is above array bounds of 'short int\\\[]'" }
+ a0.a2[3] = 3; // { dg-warning "array subscript 3 is above array bounds of 'short int\\\[]'" "" { target { ! short_eq_int } } }
+ // { dg-warning "array subscript 3 is above array bounds of 'int\\\[]'" "" { target { short_eq_int } } .-1 }
}
{
a1.a2[0] = 0; a1.a2[1] = 1; a1.a2[2] = 2;
- a1.a2[3] = 3; // { dg-warning "array subscript 3 is above array bounds of 'short int\\\[]'" }
+ a1.a2[3] = 3; // { dg-warning "array subscript 3 is above array bounds of 'short int\\\[]'" "" { target { ! short_eq_int } } }
+ // { dg-warning "array subscript 3 is above array bounds of 'int\\\[]'" "" { target { short_eq_int } } .-1 }
}
{
a2.a2[0] = 0; a2.a2[1] = 1; a2.a2[2] = 2;
- a2.a2[3] = 3; // { dg-warning "array subscript 3 is above array bounds of 'short int\\\[]'" }
+ a2.a2[3] = 3; // { dg-warning "array subscript 3 is above array bounds of 'short int\\\[]'" "" { target { ! short_eq_int } } }
+ // { dg-warning "array subscript 3 is above array bounds of 'int\\\[]'" "" { target { short_eq_int } } .-1 }
}
{
a3.a2[0] = 0; a3.a2[1] = 1; a3.a2[2] = 2;
- a3.a2[3] = 3; // { dg-warning "array subscript 3 is above array bounds of 'short int\\\[]'" }
+ a3.a2[3] = 3; // { dg-warning "array subscript 3 is above array bounds of 'short int\\\[]'" "" { target { ! short_eq_int } } }
+ // { dg-warning "array subscript 3 is above array bounds of 'int\\\[]'" "" { target { short_eq_int } } .-1 }
}
{
a4.a2[0] = 0; a4.a2[1] = 1; a4.a2[2] = 2; a4.a2[3] = 3;
- a4.a2[4] = 4; // { dg-warning "array subscript 4 is above array bounds of 'short int\\\[]'" }
+ a4.a2[4] = 4; // { dg-warning "array subscript 4 is above array bounds of 'short int\\\[]'" "" { target { ! short_eq_int } } }
+ // { dg-warning "array subscript 4 is above array bounds of 'int\\\[]'" "" { target { short_eq_int } } .-1 }
}
{
a5.a2[0] = 0; a5.a2[1] = 1; a5.a2[2] = 2; a5.a2[3] = 3; a5.a2[4] = 4;
- a5.a2[5] = 5; // { dg-warning "array subscript 5 is above array bounds of 'short int\\\[]'" }
+ a5.a2[5] = 5; // { dg-warning "array subscript 5 is above array bounds of 'short int\\\[]'" "" { target { ! short_eq_int } } }
+ // { dg-warning "array subscript 5 is above array bounds of 'int\\\[]'" "" { target { short_eq_int } } .-1 }
}
a6.a2[0] = 0; a6.a2[1] = 1; a6.a2[2] = 2; a6.a2[3] = 3; a6.a2[4] = 4;
a6.a2[5] = 5;
- a6.a2[6] = 6; // { dg-warning "array subscript 6 is above array bounds of 'short int\\\[]'" }
+ a6.a2[6] = 6; // { dg-warning "array subscript 6 is above array bounds of 'short int\\\[]'" "" { target { ! short_eq_int } } }
+ // { dg-warning "array subscript 6 is above array bounds of 'int\\\[]'" "" { target { short_eq_int } } .-1 }
}
a7.a2[0] = 0; a7.a2[1] = 1; a7.a2[2] = 2; a7.a2[3] = 3; a7.a2[4] = 4;
a7.a2[5] = 5; a7.a2[5] = 5; a7.a2[6] = 6;
- a7.a2[7] = 7; // { dg-warning "array subscript 7 is above array bounds of 'short int\\\[]'" }
+ a7.a2[7] = 7; // { dg-warning "array subscript 7 is above array bounds of 'short int\\\[]'" "" { target { ! short_eq_int } } }
+ // { dg-warning "array subscript 7 is above array bounds of 'int\\\[]'" "" { target { short_eq_int } } .-1 }
}
a8.a2[0] = 0; a8.a2[1] = 1; a8.a2[2] = 2; a8.a2[3] = 3; a8.a2[4] = 4;
a8.a2[5] = 5; a8.a2[5] = 5; a8.a2[6] = 6; a8.a2[7] = 7;
- a8.a2[8] = 8; // { dg-warning "array subscript 8 is above array bounds of 'short int\\\[]'" }
+ a8.a2[8] = 8; // { dg-warning "array subscript 8 is above array bounds of 'short int\\\[]'" "" { target { ! short_eq_int } } }
+ // { dg-warning "array subscript 8 is above array bounds of 'int\\\[]'" "" { target { short_eq_int } } .-1 }
}
a8.a2[0] = 8; a8.a2[1] = 7; a8.a2[2] = 6; a8.a2[3] = 5; a8.a2[4] = 4;
a8.a2[5] = 3; a8.a2[5] = 2; a8.a2[6] = 1; a8.a2[7] = 0;
- a8.a2[9] = 8; // { dg-warning "array subscript 9 is above array bounds of 'short int\\\[]'" }
+ a8.a2[9] = 8; // { dg-warning "array subscript 9 is above array bounds of 'short int\\\[]'" "" { target { ! short_eq_int } } }
+ // { dg-warning "array subscript 9 is above array bounds of 'int\\\[]'" "" { target { short_eq_int } } .-1 }
}
T (-1, (int[]){ 1 }); // { dg-warning "array subscript -1 is outside array bounds of 'int\\\[1]'" }
T ( 0, (int[]){ 1 });
T (+1, (int[]){ 1 }); // { dg-warning "array subscript 1 is outside array bounds of 'int\\\[1]'" }
- T (INT_MIN, (int[]){ 1 }); // { dg-warning "array subscript -\[0-9\]+ is outside array bounds of 'int\\\[1]'" "lp64" { xfail ilp32 } }
- T (INT_MAX, (int[]){ 1 }); // { dg-warning "array subscript \[0-9\]+ is outside array bounds of 'int\\\[1]'" "not-ilp32" { target { ! ilp32 } } }
- // { dg-warning "array subscript -1 is outside array bounds of 'int\\\[1]'" "ilp32" { target ilp32 } .-1 }
+ T (INT_MIN, (int[]){ 1 }); // { dg-warning "array subscript -\[0-9\]+ is outside array bounds of 'int\\\[1]'" "lp64" { xfail { ilp32 || avr-*-* } } }
+ T (INT_MAX, (int[]){ 1 }); // { dg-warning "array subscript \[0-9\]+ is outside array bounds of 'int\\\[1]'" "not-ilp32" { target { ! { ilp32 || avr-*-* } } } }
+ // { dg-warning "array subscript -1 is outside array bounds of 'int\\\[1]'" "ilp32-or-avr" { target { ilp32 || avr-*-* } } .-1 }
T (SIZE_MAX, (int[]){ 1 }); // { dg-warning "array subscript -?\[0-9\]+ is outside array bounds of 'int\\\[1]'" }
}
+/* { dg-require-effective-target int32plus } */
/* { dg-additional-options "-fanalyzer-call-summaries --param analyzer-min-snodes-for-call-summary=0" } */
/* There need to be at least two calls to a function for the
+/* { dg-require-effective-target int32plus } */
+/* { dg-require-effective-target size24plus } */
+
/* Reduced from coreutils's cksum.c: cksum_slice8 */
typedef long unsigned int size_t;
/* Reduced from Doom's linuxdoom-1.10/s_sound.c, which is GPLv2 or later. */
/* { dg-additional-options "-fno-analyzer-call-summaries -Wno-analyzer-too-complex" } */
+/* { dg-require-effective-target size32plus } */
typedef struct _IO_FILE FILE;
extern FILE* stderr;
/* { dg-skip-if "" { powerpc*-*-aix* || newlib } } */
+/* { dg-skip-if "" { avr-*-* } } */
#include <sys/stat.h>
#include <fcntl.h>
script. */
/* { dg-skip-if "" { powerpc*-*-aix* } } */
+/* { dg-skip-if "" { "avr-*-*" } } */
/* { dg-additional-options "-fanalyzer-call-summaries" } */
/* { dg-additional-options "-Wno-analyzer-too-complex" } */
/* { dg-skip-if "" { powerpc*-*-aix* } } */
+/* { dg-skip-if "" { "avr-*-*" } } */
#include <errno.h>
#include "analyzer-decls.h"
/* { dg-additional-options "-Wno-free-nonheap-object" } */
+/* { dg-require-effective-target size32plus } */
/* Examples adapted from https://cwe.mitre.org/data/definitions/590.html
which states "Copyright © 2006–2022, The MITRE Corporation. CWE, CWSS, CWRAF, and the CWE logo are trademarks of The MITRE Corporation."
+/* { dg-require-effective-target ptr_eq_long } */
/* { dg-additional-options "-O2 -Wno-shift-count-overflow" } */
struct lisp;
+/* { dg-require-effective-target ptr_eq_long } */
/* { dg-additional-options "-O2 -Wno-shift-count-overflow" } */
struct lisp;
+/* { dg-require-effective-target int32plus } */
/* { dg-additional-options "-Wno-analyzer-too-complex -O2" } */
typedef long int ptrdiff_t;
/* Reduced from haproxy's src/ssl_sample.c */
+/* { dg-require-effective-target ptr_eq_long } */
/* { dg-additional-options "-O2" } */
union sample_value {
/* Reduced from haproxy's src/ssl_sample.c */
+/* { dg-require-effective-target ptr_eq_long } */
+
union sample_value {
long long int sint;
/* [...snip...] */
/* Example of pipe usage from glibc manual. */
+/* { dg-skip-if "" { "avr-*-*" } } */
+
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
/* { dg-do compile } */
/* { dg-options "-O0 -gbtf -dA" } */
+/* { dg-require-effective-target size32plus } */
/* Struct with 3 members and no bitfield (kind_flag not set). */
/* { dg-final { scan-assembler-times "\[\t \]0x4000003\[\t \]+\[^\n\]*btt_info" 1 } } */
/* PR tree-optimization/102232 */
/* { dg-do run } */
/* { dg-options "-O -fdump-tree-optimized" } */
+/* { dg-require-effective-target int32plus } */
int __attribute__ ((noipa)) foo (int a, int b)
{
/* Verify that multiplication and division has been removed. */
/* { dg-final { scan-tree-dump-not " \\* " "optimized" } } */
-/* { dg-final { scan-tree-dump-not " / " "optimized" } } */
\ No newline at end of file
+/* { dg-final { scan-tree-dump-not " / " "optimized" } } */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-bswap-details" } */
-typedef unsigned int uint32_t;
+typedef __UINT32_TYPE__ uint32_t;
typedef unsigned char uint8_t;
uint32_t load_le_32_or(const uint8_t *ptr)
/* { dg-do run } */
/* { dg-options "-O1" } */
+/* { dg-require-effective-target int32plus } */
struct S1 {
unsigned int _0;
/* { dg-do run } */
/* { dg-options "-O2" } */
unsigned char uc;
-unsigned short us;
+__UINT16_TYPE__ us;
void testuc() {
unsigned int g = 0;
}
void testus() {
- unsigned int g = 0;
- unsigned int *p1 = &g;
- unsigned short *p2 = &us;
+ __UINT32_TYPE__ g = 0;
+ __UINT32_TYPE__ *p1 = &g;
+ __UINT16_TYPE__ *p2 = &us;
do {
(*p1)++;
/* { dg-do run } */
/* { dg-options "-O2 -fwrapv" } */
signed char sc;
-signed short ss;
+__INT16_TYPE__ ss;
void testsc() {
unsigned int g = 0;
}
void testss() {
- unsigned int g = 0;
- unsigned int *p1 = &g;
- signed short *p2 = &ss;
+ __UINT32_TYPE__ g = 0;
+ __UINT32_TYPE__ *p1 = &g;
+ __INT16_TYPE__ *p2 = &ss;
do {
(*p1)++;
/* { dg-do compile } */
/* { dg-options "-O2" } */
+/* { dg-require-effective-target size32plus } */
typedef signed char int8_T;
typedef int int32_T;
/* { dg-do compile } */
/* { dg-options "-O1" } */
+/* { dg-require-effective-target int32plus } */
struct a {
int b;
/* PR tree-optimization/96779 */
/* { dg-do run } */
/* { dg-options "-O -fdump-tree-optimized -fwrapv" } */
+/* { dg-require-effective-target int32plus } */
#include <stdbool.h>
/* PR tree-optimization/96779 */
/* { dg-do run } */
/* { dg-options "-O -fdump-tree-optimized" } */
+/* { dg-require-effective-target int32plus } */
#include <stdbool.h>
/* { dg-do run } */
/* { dg-options "-O2 -fgimple" } */
+/* { dg-require-effective-target int32plus } */
__attribute__((noipa))
void __GIMPLE (ssa,startwith("evrp"))
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
+#if __SIZEOF_INT__ == 2
+#define int __INT32_TYPE__
+#endif
+
int foo(int x)
{
int p = x & 24;
int r = 1 << p;
- return r & (1<<17);
+ return r & ((int)1<<17);
}
/* { dg-final { scan-tree-dump "return 0;" "optimized" } } */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-sink-stats" } */
+/* { dg-require-effective-target int32plus } */
#include <stdint.h>