aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/attr-invalid.c
diff options
context:
space:
mode:
authorDanny Smith <dannysmith@users.sourceforge.net>2006-08-20 08:46:13 +0000
committerDanny Smith <dannysmith@gcc.gnu.org>2006-08-20 08:46:13 +0000
commit09416794b764ccb7a7b52fa3ef04a97692a8fcb2 (patch)
tree26a4e207b3099822df6d3fef23730184c651c6b8 /gcc/testsuite/gcc.dg/attr-invalid.c
parent3e978d3094f29abe03d271d63cdc16930c5e51de (diff)
downloadgcc-09416794b764ccb7a7b52fa3ef04a97692a8fcb2.zip
gcc-09416794b764ccb7a7b52fa3ef04a97692a8fcb2.tar.gz
gcc-09416794b764ccb7a7b52fa3ef04a97692a8fcb2.tar.bz2
PR target/28648 c:
* tree.c (handle_dll_attribute): Return early if not a var or function decl. testsuite * gcc.dg/attr-invalid.c: Add tests for invalid dllimport. From-SVN: r116270
Diffstat (limited to 'gcc/testsuite/gcc.dg/attr-invalid.c')
-rw-r--r--gcc/testsuite/gcc.dg/attr-invalid.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/attr-invalid.c b/gcc/testsuite/gcc.dg/attr-invalid.c
index c6c437d..7d1c151 100644
--- a/gcc/testsuite/gcc.dg/attr-invalid.c
+++ b/gcc/testsuite/gcc.dg/attr-invalid.c
@@ -77,3 +77,24 @@ int ATSYM(fn_knrarg) (arg)
{ 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 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" "" } */