From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- gcc/testsuite/gcc.dg/attr-invalid.c | 100 ++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/attr-invalid.c (limited to 'gcc/testsuite/gcc.dg/attr-invalid.c') diff --git a/gcc/testsuite/gcc.dg/attr-invalid.c b/gcc/testsuite/gcc.dg/attr-invalid.c new file mode 100644 index 000000000..6568c1ab2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/attr-invalid.c @@ -0,0 +1,100 @@ +/* { dg-do compile } */ +/* { dg-options "" } */ + +#define CONCAT_(A,B) A ## B +#define CONCAT(A,B) CONCAT_(A,B) + +#define ATTR __attribute__((AT)) +#define ATSYM(suf) CONCAT (AT, CONCAT_ (_, suf)) + +#define AT noinline + +typedef int ATSYM(type) ATTR; /* { dg-warning "attribute ignored" "" } */ + +typedef int (*ATSYM(fntype))(void) ATTR; /* { dg-warning "attribute ignored" "" } */ + +struct ATSYM(struct) { + char dummy ATTR; /* { dg-warning "attribute ignored" "" } */ +} ATTR; /* { dg-warning "does not apply to types" "" } */ + +int ATSYM(var) ATTR; /* { dg-warning "attribute ignored" "" } */ + +int ATSYM(fn_knrarg) (arg) + int arg ATTR; /* { dg-warning "attribute ignored" "" } */ +{ return 0; } + +int ATSYM(fn_isoarg) (int arg ATTR) { return 0; } /* { dg-warning "attribute ignored" "" } */ + +int ATSYM(fn_vars) (void) { + static int svar ATTR; /* { dg-warning "attribute ignored" "" } */ + auto int lvar ATTR; /* { dg-warning "attribute ignored" "" } */ + return 0; +} + + +#undef AT +#define AT used + +typedef int ATSYM(type) ATTR; /* { dg-warning "attribute ignored" "" } */ + +typedef int (*ATSYM(fntype))(void) ATTR; /* { dg-warning "attribute ignored" "" } */ + +struct ATSYM(struct) { + char dummy ATTR; /* { dg-warning "attribute ignored" "" } */ +} ATTR; /* { dg-warning "does not apply to types" "" } */ + +int ATSYM(var) ATTR; + +int ATSYM(fn_knrarg) (arg) + int arg ATTR; /* { dg-warning "attribute ignored" "" } */ +{ return 0; } + +int ATSYM(fn_isoarg) (int arg ATTR) { return 0; } /* { dg-warning "attribute ignored" "" } */ + +int ATSYM(fn_vars) (void) { + static int svar ATTR; + auto int lvar ATTR; /* { dg-warning "attribute ignored" "" } */ + return 0; +} + + +/* PR 28287 */ +/* These are invalid on all targets. Applying to PARM_ or FIELD_DECL + also caused a tree checking ice on targets that support weak, */ +#undef AT +#define AT weak + +typedef int ATSYM(type) ATTR; /* { dg-warning "attribute ignored" "" } */ + +typedef int (*ATSYM(fntype))(void) ATTR; /* { dg-warning "attribute ignored" "" } */ + +struct ATSYM(struct) { + char dummy ATTR; /* { dg-warning "attribute ignored" "" } */ +}; + +int ATSYM(fn_knrarg) (arg) + int arg ATTR; /* { dg-warning "attribute ignored" "" } */ +{ return 0; } + +int ATSYM(fn_isoarg) (int arg ATTR) { return 0; } /* { dg-warning "attribute ignored" "" } */ + + +/* PR target/28648 */ +/* These are invalid on all targets. Applying to PARM_ or FIELD_DECL + also caused a tree checking ice on targets that support dllimport. */ +#undef AT +#define AT dllimport + +typedef int ATSYM(type) ATTR; /* { dg-warning "attribute |directive ignored" "" } */ + +typedef int (*ATSYM(fntype))(void) ATTR; /* { dg-warning "attribute |directive ignored" "" } */ + +struct ATSYM(struct) { + char dummy ATTR; /* { dg-warning "attribute |directive ignored" "" } */ +}; + +int ATSYM(fn_knrarg) (arg) + int arg ATTR; /* { dg-warning "attribute |directive ignored" "" } */ +{ return 0; } + +int ATSYM(fn_isoarg) (int arg ATTR) { return 0; } /* { dg-warning "attribute |directive ignored" "" } */ -- cgit v1.2.3