* gcc.dg/
20001023-1.c, gcc.dg/
20001108-1.c, gcc.dg/
20001117-1.c,
gcc.dg/
20010202-1.c, gcc.dg/
20011008-2.c, gcc.dg/
20011214-1.c,
gcc.dg/
20020201-1.c, gcc.dg/
20020312-2.c, gcc.dg/
20020426-2.c,
gcc.dg/
20030331-2.c, gcc.dg/
20030612-1.c, gcc.dg/
20030926-1.c,
gcc.dg/
20031216-1.c, gcc.dg/
20031218-3.c, gcc.dg/
20040305-2.c,
gcc.dg/980226-1.c, gcc.dg/Wreturn-type2.c,
gcc.dg/Wunreachable-6.c, gcc.dg/Wunreachable-7.c,
gcc.dg/align-1.c, gcc.dg/builtin-prefetch-1.c,
gcc.dg/builtins-17.c, gcc.dg/builtins-19.c, gcc.dg/builtins-2.c,
gcc.dg/builtins-20.c, gcc.dg/builtins-21.c, gcc.dg/builtins-7.c,
gcc.dg/builtins-8.c, gcc.dg/cpp/
19930510-1.c,
gcc.dg/cpp/charconst-3.c, gcc.dg/cpp/charconst-4.c,
gcc.dg/cpp/mi6.c, gcc.dg/cpp/tr-paste.c, gcc.dg/cpp/trad/mi6.c,
gcc.dg/cpp/trad/paste.c, gcc.dg/cpp/trad/strify.c,
gcc.dg/fastmath-1.c, gcc.dg/fshort-wchar.c, gcc.dg/i386-387-7.c,
gcc.dg/i386-387-8.c, gcc.dg/i386-asm-1.c, gcc.dg/i386-cadd.c,
gcc.dg/i386-fpcvt-3.c, gcc.dg/i386-loop-3.c,
gcc.dg/i386-memset-1.c, gcc.dg/loop-2.c, gcc.dg/nest.c,
gcc.dg/noncompile/971104-1.c, gcc.dg/noncompile/990416-1.c,
gcc.dg/noncompile/scope.c, gcc.dg/pack-test-4.c,
gcc.dg/pack-test-5.c, gcc.dg/pch/inline-4.c, gcc.dg/postincr-1.c,
gcc.dg/pr10392-1.c, gcc.dg/pragma-align.c,
gcc.dg/profile-generate-1.c, gcc.dg/sibcall-1.c,
gcc.dg/sibcall-2.c, gcc.dg/sibcall-3.c, gcc.dg/sibcall-4.c,
gcc.dg/sibcall-5.c, gcc.dg/sibcall-6.c, gcc.dg/switch-warn-1.c,
gcc.dg/switch-warn-2.c, gcc.dg/torture/builtin-attr-1.c,
gcc.dg/torture/builtin-math-1.c, gcc.dg/torture/builtin-noret-2.c,
gcc.dg/trampoline-1.c, gcc.dg/tree-ssa/
20030703-1.c,
gcc.dg/tree-ssa/
20030703-2.c, gcc.dg/tree-ssa/
20030708-1.c,
gcc.dg/tree-ssa/
20030709-3.c, gcc.dg/tree-ssa/
20030710-1.c,
gcc.dg/tree-ssa/
20030711-1.c, gcc.dg/tree-ssa/
20030729-1.c,
gcc.dg/tree-ssa/
20030730-1.c, gcc.dg/tree-ssa/
20030730-2.c,
gcc.dg/tree-ssa/
20030731-1.c, gcc.dg/tree-ssa/
20030807-11.c,
gcc.dg/tree-ssa/
20030807-2.c, gcc.dg/tree-ssa/
20030807-5.c,
gcc.dg/tree-ssa/
20030807-7.c, gcc.dg/tree-ssa/
20030808-1.c,
gcc.dg/tree-ssa/
20030814-1.c, gcc.dg/tree-ssa/
20030814-2.c,
gcc.dg/tree-ssa/
20030814-3.c, gcc.dg/tree-ssa/
20030814-4.c,
gcc.dg/tree-ssa/
20030814-5.c, gcc.dg/tree-ssa/
20030814-6.c,
gcc.dg/tree-ssa/
20030814-7.c, gcc.dg/tree-ssa/
20030815-1.c,
gcc.dg/tree-ssa/
20030907-1.c, gcc.dg/tree-ssa/
20030917-3.c,
gcc.dg/tree-ssa/
20030922-1.c, gcc.dg/tree-ssa/
20031113-1.c,
gcc.dg/tree-ssa/
20040121-1.c, gcc.dg/tree-ssa/
20040319-1.c,
gcc.dg/tree-ssa/
20040324-1.c, gcc.dg/tree-ssa/
20040326-1.c,
gcc.dg/tree-ssa/
20040326-2.c, gcc.dg/tree-ssa/
20040517-1.c,
gcc.dg/tree-ssa/ssa-ccp-10.c, gcc.dg/tree-ssa/ssa-pre-1.c,
gcc.dg/tree-ssa/tailcall-1.c, gcc.dg/tree-ssa/tailrecursion-5.c,
gcc.dg/ultrasp3.c, gcc.dg/winline-7.c, gcc.misc-tests/bprob-1.c,
gcc.misc-tests/bprob-2.c, gcc.misc-tests/gcov-3.c,
gcc.misc-tests/gcov-4.c, gcc.misc-tests/gcov-4b.c,
gcc.misc-tests/gcov-6.c, gcc.misc-tests/gcov-7.c,
gcc.misc-tests/i386-pf-3dnow-1.c,
gcc.misc-tests/i386-pf-athlon-1.c,
gcc.misc-tests/i386-pf-none-1.c, gcc.misc-tests/i386-pf-sse-1.c,
objc.dg/nested-func-1.m, objc.dg/special/unclaimed-category-1.m:
Declare built-in functions used.
* gcc.dg/torture/builtin-attr-1.c (nexttoward): Use FPTEST2ARG2.
From-SVN: r85465
+2004-08-03 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * gcc.dg/20001023-1.c, gcc.dg/20001108-1.c, gcc.dg/20001117-1.c,
+ gcc.dg/20010202-1.c, gcc.dg/20011008-2.c, gcc.dg/20011214-1.c,
+ gcc.dg/20020201-1.c, gcc.dg/20020312-2.c, gcc.dg/20020426-2.c,
+ gcc.dg/20030331-2.c, gcc.dg/20030612-1.c, gcc.dg/20030926-1.c,
+ gcc.dg/20031216-1.c, gcc.dg/20031218-3.c, gcc.dg/20040305-2.c,
+ gcc.dg/980226-1.c, gcc.dg/Wreturn-type2.c,
+ gcc.dg/Wunreachable-6.c, gcc.dg/Wunreachable-7.c,
+ gcc.dg/align-1.c, gcc.dg/builtin-prefetch-1.c,
+ gcc.dg/builtins-17.c, gcc.dg/builtins-19.c, gcc.dg/builtins-2.c,
+ gcc.dg/builtins-20.c, gcc.dg/builtins-21.c, gcc.dg/builtins-7.c,
+ gcc.dg/builtins-8.c, gcc.dg/cpp/19930510-1.c,
+ gcc.dg/cpp/charconst-3.c, gcc.dg/cpp/charconst-4.c,
+ gcc.dg/cpp/mi6.c, gcc.dg/cpp/tr-paste.c, gcc.dg/cpp/trad/mi6.c,
+ gcc.dg/cpp/trad/paste.c, gcc.dg/cpp/trad/strify.c,
+ gcc.dg/fastmath-1.c, gcc.dg/fshort-wchar.c, gcc.dg/i386-387-7.c,
+ gcc.dg/i386-387-8.c, gcc.dg/i386-asm-1.c, gcc.dg/i386-cadd.c,
+ gcc.dg/i386-fpcvt-3.c, gcc.dg/i386-loop-3.c,
+ gcc.dg/i386-memset-1.c, gcc.dg/loop-2.c, gcc.dg/nest.c,
+ gcc.dg/noncompile/971104-1.c, gcc.dg/noncompile/990416-1.c,
+ gcc.dg/noncompile/scope.c, gcc.dg/pack-test-4.c,
+ gcc.dg/pack-test-5.c, gcc.dg/pch/inline-4.c, gcc.dg/postincr-1.c,
+ gcc.dg/pr10392-1.c, gcc.dg/pragma-align.c,
+ gcc.dg/profile-generate-1.c, gcc.dg/sibcall-1.c,
+ gcc.dg/sibcall-2.c, gcc.dg/sibcall-3.c, gcc.dg/sibcall-4.c,
+ gcc.dg/sibcall-5.c, gcc.dg/sibcall-6.c, gcc.dg/switch-warn-1.c,
+ gcc.dg/switch-warn-2.c, gcc.dg/torture/builtin-attr-1.c,
+ gcc.dg/torture/builtin-math-1.c, gcc.dg/torture/builtin-noret-2.c,
+ gcc.dg/trampoline-1.c, gcc.dg/tree-ssa/20030703-1.c,
+ gcc.dg/tree-ssa/20030703-2.c, gcc.dg/tree-ssa/20030708-1.c,
+ gcc.dg/tree-ssa/20030709-3.c, gcc.dg/tree-ssa/20030710-1.c,
+ gcc.dg/tree-ssa/20030711-1.c, gcc.dg/tree-ssa/20030729-1.c,
+ gcc.dg/tree-ssa/20030730-1.c, gcc.dg/tree-ssa/20030730-2.c,
+ gcc.dg/tree-ssa/20030731-1.c, gcc.dg/tree-ssa/20030807-11.c,
+ gcc.dg/tree-ssa/20030807-2.c, gcc.dg/tree-ssa/20030807-5.c,
+ gcc.dg/tree-ssa/20030807-7.c, gcc.dg/tree-ssa/20030808-1.c,
+ gcc.dg/tree-ssa/20030814-1.c, gcc.dg/tree-ssa/20030814-2.c,
+ gcc.dg/tree-ssa/20030814-3.c, gcc.dg/tree-ssa/20030814-4.c,
+ gcc.dg/tree-ssa/20030814-5.c, gcc.dg/tree-ssa/20030814-6.c,
+ gcc.dg/tree-ssa/20030814-7.c, gcc.dg/tree-ssa/20030815-1.c,
+ gcc.dg/tree-ssa/20030907-1.c, gcc.dg/tree-ssa/20030917-3.c,
+ gcc.dg/tree-ssa/20030922-1.c, gcc.dg/tree-ssa/20031113-1.c,
+ gcc.dg/tree-ssa/20040121-1.c, gcc.dg/tree-ssa/20040319-1.c,
+ gcc.dg/tree-ssa/20040324-1.c, gcc.dg/tree-ssa/20040326-1.c,
+ gcc.dg/tree-ssa/20040326-2.c, gcc.dg/tree-ssa/20040517-1.c,
+ gcc.dg/tree-ssa/ssa-ccp-10.c, gcc.dg/tree-ssa/ssa-pre-1.c,
+ gcc.dg/tree-ssa/tailcall-1.c, gcc.dg/tree-ssa/tailrecursion-5.c,
+ gcc.dg/ultrasp3.c, gcc.dg/winline-7.c, gcc.misc-tests/bprob-1.c,
+ gcc.misc-tests/bprob-2.c, gcc.misc-tests/gcov-3.c,
+ gcc.misc-tests/gcov-4.c, gcc.misc-tests/gcov-4b.c,
+ gcc.misc-tests/gcov-6.c, gcc.misc-tests/gcov-7.c,
+ gcc.misc-tests/i386-pf-3dnow-1.c,
+ gcc.misc-tests/i386-pf-athlon-1.c,
+ gcc.misc-tests/i386-pf-none-1.c, gcc.misc-tests/i386-pf-sse-1.c,
+ objc.dg/nested-func-1.m, objc.dg/special/unclaimed-category-1.m:
+ Declare built-in functions used.
+ * gcc.dg/torture/builtin-attr-1.c (nexttoward): Use FPTEST2ARG2.
+
2004-08-02 Mark Mitchell <mark@codesourcery.com>
PR c++/16707
/* { dg-do run } */
/* { dg-options "-O2 -fomit-frame-pointer" } */
+extern void abort (void);
+extern void exit (int);
+
unsigned char a[256], b[256], c[256], d[256];
void foo(unsigned char *x, int y, unsigned char *z)
/* { dg-do run } */
/* { dg-options "-O2 -fomit-frame-pointer" } */
+extern void abort (void);
+extern void exit (int);
+
void die (long) __attribute__ ((noreturn));
void die (long e)
/* { dg-do run } */
/* { dg-options "-O2 -finstrument-functions" } */
+extern void abort (void);
+extern void exit (int);
+
double
foo (double a, double b)
{
/* { dg-do compile { target i?86-*-* sparc*-*-* } } */
/* { dg-options "-O2" } */
+extern void abort (void);
+extern void exit (int);
+
typedef enum { false, true } __attribute__ ((packed)) boolean;
typedef struct {
enum {
/* { dg-do run } */
/* { dg-options "-O0" } */
+extern void abort (void);
+extern void exit (int);
+
struct { union {int x; int y;}; int q; } b;
union { struct {int x;}; int q; } e;
/* { dg-do run } */
+extern void abort (void);
+extern void exit (int);
+
#define small __attribute__((mode(QI))) int
int main()
{
/* { dg-options "-fprofile-arcs" } */
/* { dg-do run { target native } } */
+extern void abort (void);
+extern void exit (int);
+
int rand (void);
void srand (unsigned int seed);
/* { dg-do run } */
/* { dg-options "-O -fno-pic" } */
+extern void abort (void);
+
#if defined(__alpha__)
/* PIC register is $29, but is used even without -fpic. */
#elif defined(__arc__)
/* { dg-options "-O2" } */
/* { dg-options "-O2 -frename-registers -fomit-frame-pointer -fPIC -mtune=i686" { target i?86-*-* } } */
+extern void exit (int);
+
typedef struct
{
union
// { dg-options "" }
+extern int printf (const char *, ...);
+
int foo() {
int yd;
float in[1][yd];
/* { dg-do run } */
/* { dg-options "-O2" } */
+extern void abort (void);
+
int A, B;
void foo()
/* { dg-options "-O2 -minline-all-stringops" } */
/* { dg-options "-O2 -minline-all-stringops -march=pentium4" { target i?86-*-* } } */
+extern void *memcpy (void *, const void *, __SIZE_TYPE__);
+extern __SIZE_TYPE__ strlen (const char *);
+
void
foo (char *p)
{
/* { dg-options "-O2" } */
/* { dg-options "-O2 -fPIC" { target s390*-*-* } } */
+extern void abort (void);
+
int count = 0;
char *str;
/* { dg-do compile } */
/* { dg-options "-O2 -g" } */
+extern __SIZE_TYPE__ strlen (const char *);
+
int x (char *s)
{
int y () { return (strlen (s)); }
/* PR target/14262 */
/* { dg-do run } */
+extern void abort (void);
+
typedef char ACS;
typedef char LSM;
typedef char PANEL;
/* { dg-do compile { target i?86-*-* } } */
/* { dg-options -O2 } */
+extern int printf (const char *, ...);
extern double bar (double);
int
missing return. */
/* { dg-do compile } */
+extern void abort (void);
+
f() {} /* { dg-bogus "" "no return warning" } */
int g() { abort (); } /* { dg-bogus "" "no return warning" } */
int main() {} /* { dg-bogus "" "no return warning" } */
/* { dg-do compile } */
/* { dg-options "-Wunreachable-code" } */
+extern int printf (const char *, ...);
+extern void exit (int);
+
int main(int argc, char *argv[])
{
if (argc != 1)
/* { dg-do compile } */
/* { dg-options "-O2 -Wunreachable-code" } */
+extern int printf (const char *, ...);
+extern void exit (int);
+
int main(int argc, char *argv[])
{
if (argc != 1)
{ dg-options "" }
*/
+extern void abort (void);
+
struct A
{
char c;
/* { dg-do run } */
+extern void exit (int);
+
enum locality { none, low, moderate, high, bogus };
enum rw { read, write };
extern void link_error(void);
extern double exp(double);
-
+extern double atan(double);
int main()
{
double cabs (__complex__ double);
float cabsf (__complex__ float);
long double cabsl (__complex__ long double);
+double fabs (double);
+float fabsf (float);
+long double fabsl (long double);
void link_error (void);
/* { dg-do compile } */
/* { dg-options "-O2 -ffast-math" } */
+extern double atan (double);
+extern float atanf (float);
+extern long double atanl (long double);
+extern double exp (double);
+extern float expf (float);
+extern long double expl (long double);
+extern double fabs (double);
+extern float fabsf (float);
+extern long double fabsl (long double);
+extern double log (double);
+extern float logf (float);
+extern long double logl (long double);
+extern double pow (double, double);
+extern float powf (float, float);
+extern long double powl (long double, long double);
+extern double sqrt (double);
+extern float sqrtf (float);
+extern long double sqrtl (long double);
+extern double tan (double);
+extern float tanf (float);
+extern long double tanl (long double);
+
double test1(double x)
{
return log(exp(x));
#include "builtins-config.h"
+extern double cos (double);
+extern double sin (double);
+extern double tan (double);
+extern float cosf (float);
+extern float sinf (float);
+extern float tanf (float);
+extern long double cosl (long double);
+extern long double sinl (long double);
+extern long double tanl (long double);
+
extern void link_error(void);
void test1(double x)
/* { dg-do compile } */
/* { dg-options "-O2 -ffast-math" } */
+extern double fabs (double);
+extern float fabsf (float);
+extern long double fabsl (long double);
+extern double sqrt (double);
+extern float sqrtf (float);
+extern long double sqrtl (long double);
+extern double exp (double);
+extern float expf (float);
+extern long double expl (long double);
+
double test1(double x)
{
return fabs(x*x);
/* { dg-do link } */
/* { dg-options "-O2 -ffast-math" } */
+extern double pow (double, double);
+extern float powf (float, float);
+extern long double powl (long double, long double);
+extern double tan (double);
+extern float tanf (float);
+extern long double tanl (long double);
+extern double atan (double);
+extern float atanf (float);
+extern long double atanl (long double);
+
extern void link_error(void);
void test(double x)
/* { dg-options "-O2 -ffast-math" } */
extern void abort(void);
+extern double pow(double, double);
+extern double sqrt(double);
void test(double x)
{
/* { dg-do compile } */
+extern void exit (int);
+
#define ugly 3
#ugly "foobar" 3 /* { dg-error "invalid" "invalid directive" } */
int main() { exit (0); }
#include <limits.h>
+extern void abort (void);
+
int main ()
{
/* These tests require at least 2-byte ints. 8-) */
#include <limits.h>
+extern void abort (void);
+
#if INT_MAX == 32767
# define LONG_CHARCONST '!\234a'
# define SHORT_CHARCONST '\234a'
/* { dg-do compile } */
/* { dg-options "" } */
+extern void abort (void);
+
/* Each include file should not be subject to MI optimisation, since
macro definitions can change. Each header increments the variable
VAR if it is defined.
/* { dg-do compile } */
/* { dg-options "-traditional-cpp" } */
+extern int printf (const char *, ...);
+
#define A(name) X/**/name
#define B(name) \
/* { dg-do compile } */
/* { dg-options "" } */
+extern void abort (void);
+
/* Each include file should not be subject to MI optimisation, since
macro definitions can change. Each header increments the variable
VAR if it is defined.
/* { dg-do compile } */
+extern int printf (const char *, ...);
+
#define A(name) X/**/name
#define B(name) \
#define foo(a, b) c="a"; d="b";
extern void abort ();
+extern void exit (int);
int main ()
{
/* { dg-do run } */
/* { dg-options "-O2 -ffast-math" } */
+extern void abort (void);
+
int foo ( float* dists, int k)
{
if ( ( dists [ 0 ] > 0 ) == ( dists [ 1 ] > 0 ) )
Test that __WCHAR_MAX__ is correct with -fshort-wchar. */
+extern void abort (void);
+
int main ()
{
__WCHAR_TYPE__ w = ~(__WCHAR_TYPE__) 0;
/* { dg-options "-O -ffast-math -march=i686" } */
/* { dg-final { scan-assembler "fsincos" } } */
+extern double sin (double);
+extern double cos (double);
+
double f1(double x)
{
return sin(x) + cos (x);
/* { dg-final { scan-assembler "fptan" } } */
/* { dg-final { scan-assembler-not "fld1" } } */
+extern double tan (double);
+
double f1(double x)
{
return 1.0 / tan(x);
/* { dg-do run { target i?86-*-* } } */
/* { dg-options "-O2" } */
+extern void abort (void);
static int bar(int x) __asm__("bar") __attribute__((regparm(1)));
static int __attribute__((regparm(1), noinline, used))
bar(int x)
/* { dg-options "-O2 -march=k8" } */
/* { dg-final { scan-assembler "sbb" } } */
+extern void abort (void);
+
/* Conditional increment is best done using sbb $-1, val. */
int t[]={0,0,0,0,1,1,1,1,1,1};
q()
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-O2 -msse2 -march=k8" } */
/* { dg-final { scan-assembler-not "cvtss2sd" } } */
+extern double fabs (double);
float a,b;
main()
{
/* { dg-do run { target i?86-*-* } } */
/* { dg-options "-mtune=k6 -O3 -ffast-math -funroll-loops" } */
+extern void *memset (void *, int, __SIZE_TYPE__);
+extern void abort (void);
+
typedef struct
{
unsigned char colormod;
/* { dg-do run { target "i?86-*-*" } } */
/* { dg-options "-O2 -minline-all-stringops" } */
+extern void *memset (void *, int, __SIZE_TYPE__);
+extern void abort (void);
+extern void exit (int);
+
#ifndef MAX_OFFSET
#define MAX_OFFSET (sizeof (long long))
#endif
0 iterations of the loop rather than the correct 1. */
/* { dg-do run } */
+extern void abort (void);
+extern void exit (int);
+
__inline__ int tag() { return 0; }
void f ();
/* { dg-error "profiler" "No profiler support" { target xstormy16-*-* } 0 } */
/* { dg-error "-pg not supported" "Profiler support missing" { target *-*-sco3.2v5* } 0 } */
+extern void abort (void);
+
long foo (long x)
{
long i, sum = 0;
+extern int printf(const char *, ...);
typedef unsigned short ushort;
struct sembuf {
ushort sem_num;
+extern void *memcpy (void *, const void *, __SIZE_TYPE__);
typedef int word_type;
static void
+extern void abort (void);
+extern void exit (int);
static int v = 3;
f ()
{ dg-options "" }
{ dg-do run } */
+extern void abort (void);
+
typedef unsigned char uint8_t;
typedef struct {
of a field. */
/* { dg-do run } */
+extern void abort (void);
+
struct A {
double d;
} __attribute__ ((aligned));
#include "inline-4.h"
+extern int printf (const char *, ...);
int main(void) {
printf (getstring());
return 0;
/* Simple test for proper postincrement semantics. */
/* { dg-do run } */
+extern void abort (void);
+
int i;
int c;
int *f ()
/* { dg-do run } */
/* { dg-options "-O2" } */
/* { dg-options "-O2 -m4" { target sh4-*-* } } */
+extern void abort (void);
const char *dont_optimize_function_away;
const char *use(const char *str)
/* { dg-do run { target i?86-*-linux* i?86-*-*bsd* i?86-*-sco3.2v5* *-*-solaris2.* } } */
+extern void abort (void);
+
struct {
char one;
long two;
/* Bug 16325. */
/* { dg-options "-O -fprofile-generate" } */
+extern void abort (void);
+
int *p1;
int *p2;
int *p3;
marker. Self-recursion tail calls are optimized for all targets,
regardless of presence of sibcall patterns. */
+extern void abort (void);
+extern void exit (int);
+
extern void recurser_void (int);
extern void track (int);
marker. Self-recursion tail calls are optimized for all targets,
regardless of presence of sibcall patterns. */
+extern void abort (void);
+extern void exit (int);
+
extern void recurser_void (void);
extern void track (void);
(except targets where the test does not work due to the return address
not saved on the regular stack). */
+extern void abort (void);
+extern void exit (int);
+
static void recurser_void1 (int);
static void recurser_void2 (int);
extern void track (int);
(except targets where the test does not work due to the return address
not saved on the regular stack). */
+extern void abort (void);
+extern void exit (int);
+
static void recurser_void1 (void);
static void recurser_void2 (void);
extern void track (void);
/* { dg-do run { target i?86-*-* } } */
/* { dg-options "-O2" } */
+extern void abort (void);
+
int (*f)(int, int) __attribute__((regparm(2)));
int (*g)(int, int, int) __attribute__((regparm(3)));
/* { dg-do run { target i?86-*-* s390*-*-* x86_64-*-*} } */
/* { dg-options "-O2 -foptimize-sibling-calls" } */
+extern void abort (void);
+extern void exit (int);
+
int foo (int);
int bar (int);
/* { dg-do run } */
/* { dg-options "-O0" } */
+extern void abort (void);
+extern void exit (int);
+
/* Check that out-of-bounds case warnings work in the case that the
testing expression is promoted. */
int
/* { dg-do run } */
/* { dg-options "-O0" } */
+extern void abort (void);
+extern void exit (int);
+
int
foo (unsigned int i)
{
{ if (__builtin_##FN(x,y) != __builtin_##FN(x,y)) link_failure_builtin_##FN(); }
/* Also test the regular (non-__builtin_) function. */
-#define TEST1(FN, TYPE) \
+#define TEST1(FN, TYPE, RTYPE) \
BUILTIN_TEST1(FN, TYPE) \
extern void link_failure_##FN(void); \
+extern RTYPE FN(TYPE); \
void test_##FN(TYPE x) { if (FN(x) != FN(x)) link_failure_##FN(); }
/* Test the __builtin_ functions taking void arguments (with the "f"
/* These macros additionally test the non-__builtin_ functions. */
/* Test the functions taking one FP argument (with the "f" and "l"
- variants). */
+ variants) and returning that type. */
#define FPTEST1(FN) \
BUILTIN_FPTEST1(FN) \
extern void link_failure_##FN(void); \
extern void link_failure_##FN##f(void); \
extern void link_failure_##FN##l(void); \
+extern double FN(double); \
+extern float FN##f(float); \
+extern long double FN##l(long double); \
+void test_##FN(double d) \
+{ if (FN(d) != FN(d)) link_failure_##FN(); } \
+void test_##FN##f(float f) \
+{ if (FN##f(f) != FN##f(f)) link_failure_##FN##f(); } \
+void test_##FN##l(long double ld) \
+{ if (FN##l(ld) != FN##l(ld)) link_failure_##FN##l(); }
+
+/* Test the functions taking one FP argument (with the "f" and "l"
+ variants) and returning TYPE. */
+#define FPTEST1T(FN, TYPE) \
+BUILTIN_FPTEST1(FN) \
+extern void link_failure_##FN(void); \
+extern void link_failure_##FN##f(void); \
+extern void link_failure_##FN##l(void); \
+extern TYPE FN(double); \
+extern TYPE FN##f(float); \
+extern TYPE FN##l(long double); \
void test_##FN(double d) \
{ if (FN(d) != FN(d)) link_failure_##FN(); } \
void test_##FN##f(float f) \
extern void link_failure_##FN(void); \
extern void link_failure_##FN##f(void); \
extern void link_failure_##FN##l(void); \
+extern double FN(double, double); \
+extern float FN##f(float, float); \
+extern long double FN##l(long double, long double); \
void test_##FN(double d1, double d2) \
{ if (FN(d1,d2) != FN(d1,d2)) link_failure_##FN(); } \
void test_##FN##f(float f1, float f2) \
extern void link_failure_##FN(void); \
extern void link_failure_##FN##f(void); \
extern void link_failure_##FN##l(void); \
+extern double FN(TYPE, double); \
+extern float FN##f(TYPE, float); \
+extern long double FN##l(TYPE, long double); \
void test_##FN(TYPE x, double d) \
{ if (FN(x,d) != FN(x,d)) link_failure_##FN(); } \
void test_##FN##f(TYPE x, float f) \
extern void link_failure_##FN(void); \
extern void link_failure_##FN##f(void); \
extern void link_failure_##FN##l(void); \
+extern double FN(double, TYPE); \
+extern float FN##f(float, TYPE); \
+extern long double FN##l(long double, TYPE); \
void test_##FN(double d, TYPE x) \
{ if (FN(d,x) != FN(d,x)) link_failure_##FN(); } \
void test_##FN##f(float f, TYPE x) \
extern void link_failure_##FN(void); \
extern void link_failure_##FN##f(void); \
extern void link_failure_##FN##l(void); \
+extern double FN(double, double, double); \
+extern float FN##f(float, float, float); \
+extern long double FN##l(long double, long double, long double); \
void test_##FN(double d1, double d2, double d3) \
{ if (FN(d1,d2,d3) != FN(d1,d2,d3)) link_failure_##FN(); } \
void test_##FN##f(float f1, float f2, float f3) \
{ if (FN##l(ld1,ld2,ld3) != FN##l(ld1,ld2,ld3)) link_failure_##FN##l(); }
/* Test the functions taking one complex argument (with the "f" and
- "l" variants). */
+ "l" variants) and returning that type. */
#define CPTEST1(FN) \
BUILTIN_CPTEST1(FN) \
extern void link_failure_##FN(void); \
extern void link_failure_##FN##f(void); \
extern void link_failure_##FN##l(void); \
+extern _Complex double FN(_Complex double); \
+extern _Complex float FN##f(_Complex float); \
+extern _Complex long double FN##l(_Complex long double); \
+void test_##FN(_Complex double d) \
+{ if (FN(d) != FN(d)) link_failure_##FN(); } \
+void test_##FN##f(_Complex float f) \
+{ if (FN##f(f) != FN##f(f)) link_failure_##FN##f(); } \
+void test_##FN##l(_Complex long double ld) \
+{ if (FN##l(ld) != FN##l(ld)) link_failure_##FN##l(); }
+
+/* Test the functions taking one complex argument (with the "f" and
+ "l" variants) and returning the real type. */
+#define CPTEST1R(FN) \
+BUILTIN_CPTEST1(FN) \
+extern void link_failure_##FN(void); \
+extern void link_failure_##FN##f(void); \
+extern void link_failure_##FN##l(void); \
+extern double FN(_Complex double); \
+extern float FN##f(_Complex float); \
+extern long double FN##l(_Complex long double); \
void test_##FN(_Complex double d) \
{ if (FN(d) != FN(d)) link_failure_##FN(); } \
void test_##FN##f(_Complex float f) \
extern void link_failure_##FN(void); \
extern void link_failure_##FN##f(void); \
extern void link_failure_##FN##l(void); \
+extern _Complex double FN(_Complex double, _Complex double); \
+extern _Complex float FN##f(_Complex float, _Complex float); \
+extern _Complex long double FN##l(_Complex long double, _Complex long double); \
void test_##FN(_Complex double d1, _Complex double d2) \
{ if (FN(d1,d2) != FN(d1,d2)) link_failure_##FN(); } \
void test_##FN##f(_Complex float f1, _Complex float f2) \
FPTEST1 (gamma)
BUILTIN_FPTEST0 (huge_val)
FPTEST2 (hypot)
-FPTEST1 (ilogb)
+FPTEST1T (ilogb, int)
BUILTIN_FPTEST0 (inf)
FPTEST1 (j0)
FPTEST1 (j1)
FPTEST2ARG1 (jn, int)
FPTEST2ARG2 (ldexp, int)
FPTEST1 (lgamma)
-FPTEST1 (llrint)
-FPTEST1 (llround)
+FPTEST1T (llrint, long long)
+FPTEST1T (llround, long long)
FPTEST1 (log)
FPTEST1 (log10)
FPTEST1 (log1p)
FPTEST1 (log2)
FPTEST1 (logb)
-FPTEST1 (lrint)
-FPTEST1 (lround)
+FPTEST1T (lrint, long)
+FPTEST1T (lround, long)
BUILTIN_FPTEST1ARG (nan, char *)
BUILTIN_FPTEST1ARG (nans, char *)
FPTEST1 (nearbyint)
FPTEST2 (nextafter)
-FPTEST2 (nexttoward)
+FPTEST2ARG2 (nexttoward, long double)
FPTEST2 (pow)
FPTEST1 (pow10)
FPTEST2 (remainder)
/*CPTEST1 (cabs) See http://gcc.gnu.org/ml/gcc-patches/2003-09/msg00040.html */
CPTEST1 (cacos)
CPTEST1 (cacosh)
-CPTEST1 (carg)
+CPTEST1R (carg)
CPTEST1 (casin)
CPTEST1 (casinh)
CPTEST1 (catan)
CPTEST1 (ccos)
CPTEST1 (ccosh)
CPTEST1 (cexp)
-CPTEST1 (cimag)
+CPTEST1R (cimag)
/*CPTEST1 (clog)*/
CPTEST1 (conj)
CPTEST2 (cpow)
CPTEST1 (cproj)
-CPTEST1 (creal)
+CPTEST1R (creal)
CPTEST1 (csin)
CPTEST1 (csinh)
CPTEST1 (csqrt)
CPTEST1 (ctan)
CPTEST1 (ctanh)
+/* These next definitions are kludges. When GCC has a <stdint.h> it
+ should be used.
+*/
+#if __INT_MAX__ == __LONG_LONG_MAX__
+typedef int intmax_t;
+#elif __LONG_MAX__ == __LONG_LONG_MAX__
+typedef long intmax_t;
+#else
+typedef long long intmax_t;
+#endif
+
/* Various other const builtins. */
-TEST1 (abs, int)
+TEST1 (abs, int, int)
BUILTIN_TEST1 (clz, int)
BUILTIN_TEST1 (clzl, long)
BUILTIN_TEST1 (clzll, long long)
BUILTIN_TEST1 (ctz, int)
BUILTIN_TEST1 (ctzl, long)
BUILTIN_TEST1 (ctzll, long long)
-TEST1 (ffs, int)
-TEST1 (ffsl, long)
-TEST1 (ffsll, long long)
-TEST1 (imaxabs, int)
-TEST1 (labs, long)
-TEST1 (llabs, long long)
+TEST1 (ffs, int, int)
+TEST1 (ffsl, long, int)
+TEST1 (ffsll, long long, int)
+TEST1 (imaxabs, intmax_t, intmax_t)
+TEST1 (labs, long, long)
+TEST1 (llabs, long long, long long)
BUILTIN_TEST1 (parity, int)
BUILTIN_TEST1 (parityl, long)
BUILTIN_TEST1 (parityll, long long)
/* { dg-do link } */
+extern double atan (double);
+extern float atanf (float);
+extern long double atanl (long double);
+extern double cbrt (double);
+extern float cbrtf (float);
+extern long double cbrtl (long double);
+extern double cos (double);
+extern float cosf (float);
+extern long double cosl (long double);
+extern double exp (double);
+extern float expf (float);
+extern long double expl (long double);
+extern double log (double);
+extern float logf (float);
+extern long double logl (long double);
+extern double pow (double, double);
+extern float powf (float, float);
+extern long double powl (long double, long double);
+extern double sin (double);
+extern float sinf (float);
+extern long double sinl (long double);
+extern double sqrt (double);
+extern float sqrtf (float);
+extern long double sqrtl (long double);
+extern double tan (double);
+extern float tanf (float);
+extern long double tanl (long double);
+
/* All references to link_error should go away at compile-time. */
extern void link_error(void);
main (void)
{
volatile int i = 0;
+ extern void exit (int);
if (i)
tabort ();
if (i)
void
_exit (int i)
{
+ extern void abort (void);
abort ();
}
void
_Exit (int i)
{
+ extern void abort (void);
abort ();
}
trampoline couldn't be made executable. */
extern void abort(void);
+extern double fabs(double);
void foo (void)
{
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-dom3" } */
-
+extern void abort (void);
extern int blah[];
foo(int index)
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-dom3" } */
-
+
+extern void abort (void);
+
union tree_node;
typedef union tree_node *tree;
extern const char tree_code_type[];
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-dom3" } */
+extern void abort (void);
struct rtx_def;
typedef struct rtx_def *rtx;
enum rtx_code
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-dom3" } */
+extern void abort (void);
union tree_node;
typedef union tree_node *tree;
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-dom3" } */
+extern void abort (void);
union tree_node;
typedef union tree_node *tree;
struct tree_vec
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-dom3" } */
+extern void abort (void);
union tree_node;
typedef union tree_node *tree;
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-dom3" } */
+extern void abort (void);
union tree_node;
typedef union tree_node *tree;
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-dom3" } */
+extern void exit (int);
extern void *ggc_alloc (__SIZE_TYPE__);
typedef struct dw_attr_struct *dw_attr_ref;
typedef struct dw_attr_struct
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-dom3" } */
+extern void exit (int);
extern void *ggc_alloc (__SIZE_TYPE__);
typedef struct dw_attr_struct *dw_attr_ref;
typedef struct dw_attr_struct
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-dom3" } */
+extern void abort (void);
struct rtx_def;
typedef struct rtx_def *rtx;
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-dom3" } */
+extern void abort (void);
struct rtx_def;
typedef struct rtx_def *rtx;
struct rtx_def
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-dom3" } */
+extern void abort (void);
oof ()
{
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-dom3" } */
-
+
+extern void abort (void);
struct rtx_def;
typedef struct rtx_def *rtx;
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-dom3" } */
-
+extern void abort (void);
union tree_node;
typedef union tree_node *tree;
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-cddce" } */
+extern void abort (void);
struct rtx_def;
typedef struct rtx_def *rtx;
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-dom3" } */
+extern void abort (void);
com(int *blah)
{
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-dom3" } */
+extern void abort (void);
void
foo (int value)
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-dom3" } */
+extern void abort (void);
void
foo (int value)
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-dom3 -fdump-tree-optimized" } */
+extern void abort (void);
union tree_node;
typedef union tree_node *tree;
extern const char tree_code_type[];
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-dom3 -fdump-tree-optimized" } */
+extern void abort (void);
union tree_node;
typedef union tree_node *tree;
extern const char tree_code_type[];
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-dom3" } */
+extern void abort (void);
union tree_node;
typedef union tree_node *tree;
enum tree_code
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-dom3" } */
+extern void abort (void);
struct rtx_def;
typedef struct rtx_def *rtx;
struct rtvec_def;
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-dom3" } */
+extern void abort (void);
typedef unsigned int size_t;
struct rtx_def;
typedef struct rtx_def *rtx;
/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-optimized" } */
+extern void abort (void);
+extern void exit (int);
+
int main()
{
int i;
/* { dg-do compile } */
/* { dg-options "-O1 -fno-tree-dominator-opts -fdump-tree-ccp" } */
-
+
+extern int printf (const char *, ...);
main ()
{
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-dom3" } */
+extern void abort (void);
union tree_node;
typedef union tree_node *tree;
/* { dg-do compile } */
/* { dg-options "-O1" } */
+extern __SIZE_TYPE__ strlen (const char *);
+
int i;
static void
not boolean */
/* { dg-options "-O3" } */
/* { dg-do run } */
+extern void abort (void);
char *foo(char *p, char *q) {
int x = (p !=0) + (q != 0);
if (x==2) return "a"; else return 0;
were not being processed by the type based alias analyzer,
resulting in optimizations removing a non-redundant load. */
+extern void abort (void);
+
struct bar { int count; int *arr;};
void foo (struct bar *b)
Therefore, DOM did not see that i was modified between the two ifs
and optimized away the second if. */
+extern void abort (void);
+extern void exit (int);
+
struct x
{
unsigned b:1;
a .GLOBAL_VAR to model the side effects of functions. Without it,
we were moving the call to Faref() inside the second call to
Faset(). */
+extern void abort (void);
+extern void exit (int);
+
main ()
{
int table, c, elt;
/* Gimplification problem exposed by zsh. All the side-effects in
function arguments and in the called expression should happen
before the actual function call. */
+extern void abort (void);
int A;
typedef void (*fnptr) (void);
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-ssa-vops" } */
+extern void abort (void);
int a;
extern void __attribute__ ((malloc)) *foo ();
fail to terminate when there is a nontrivial cycle in the corresponding
ssa graph. */
+extern __SIZE_TYPE__ strlen (const char *);
+
void foo(int i)
{
char *s = "abcde";
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+extern int printf (const char *, ...);
int main(int argc, char **argv)
{
int a;
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-tailc-details" } */
+extern void *alloca (__SIZE_TYPE__);
int q(int a);
int *v;
int
/* { dg-do run } */
/* { dg-options "-O1 -fdump-tree-optimized" } */
+extern void abort (void);
+extern void exit (int);
+
int sum (int n)
{
if (n == 0)
/* { dg-options "" } */
/* { dg-options "-mcpu=ultrasparc -mv8plus" { target sparc-*-* } } */
+extern void abort (void);
+extern void exit (int);
+
unsigned long long foo (unsigned long long x)
{
return 0x73500000735LL * x;
/* { dg-do compile } */
/* { dg-options "-Winline -O2" } */
+extern void *alloca (__SIZE_TYPE__);
+
void big (void);
inline void *q (void)
{ /* { dg-warning "(function not inlinable|alloca)" } */
This test is the same as gcov-4.c. The "count" comments are left in to
make comparisons easier; they are ignored for this test. */
+extern void abort (void);
+
int do_something (int i)
{
return i;
This is the same as test gcc.c-torture/execute/980526-1.c and
gcc.misc-tests/gcov-3.c */
+extern void abort (void);
+extern void exit (int);
+
int expect_do1 = 1, expect_do2 = 2;
static int doit(int x){
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
/* { dg-do run { target native } } */
+extern void abort (void);
+extern void exit (int);
+
int expect_do1 = 1, expect_do2 = 2;
static int doit(int x){
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
/* { dg-do run { target native } } */
+extern void abort (void);
+
int do_something (int i)
{
return i;
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
/* { dg-do run { target native } } */
+extern void abort (void);
+
int do_something (int i)
{
return i;
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
/* { dg-do run { target native } } */
+extern void exit (int);
+
int val;
void
#include <setjmp.h>
+extern void abort (void);
+extern void exit (int);
+
jmp_buf env;
int val;
int longjmp_taken;
/* { dg-do compile { target i?86-*-* } } */
+extern void exit (int);
+
char *msg = "howdy there";
void foo (char *p)
/* { dg-do compile { target i?86-*-* } } */
+extern void exit (int);
+
char *msg = "howdy there";
void foo (char *p)
/* { dg-do compile { target i?86-*-* } } */
+extern void exit (int);
+
char *msg = "howdy there";
void foo (char *p)
/* { dg-do compile { target i?86-*-* } } */
+extern void exit (int);
+
char *msg = "howdy there";
void foo (char *p)
/* { dg-options "-lobjc" } */
/* { dg-do run } */
#include <stdio.h>
+#include <stdlib.h>
#include <objc/objc.h>
#include <objc/Object.h>
#include <objc/objc-api.h>
#include <objc/Object.h>
+extern void abort (void);
+
/* Test loading unclaimed categories - categories of a class defined
separately from the class itself. */