aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/attr-invalid.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2001-10-18 18:29:25 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2001-10-18 18:29:25 +0000
commitc8202d4cbe4ca1b22420d8f457581f3762276b0a (patch)
tree673e59e65cf4e63246e3df599bc7224a96704a11 /gcc/testsuite/gcc.dg/attr-invalid.c
parent9162542e3d0cd270ab972615f66d7da16662466d (diff)
downloadgcc-c8202d4cbe4ca1b22420d8f457581f3762276b0a.zip
gcc-c8202d4cbe4ca1b22420d8f457581f3762276b0a.tar.gz
gcc-c8202d4cbe4ca1b22420d8f457581f3762276b0a.tar.bz2
attr-noinline.c, [...]: New tests.
* gcc.dg/attr-noinline.c, gcc.dg/attr-used.c: New tests. * gcc.dg/attr-invalid.c: Likewise. From-SVN: r46335
Diffstat (limited to 'gcc/testsuite/gcc.dg/attr-invalid.c')
-rw-r--r--gcc/testsuite/gcc.dg/attr-invalid.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/attr-invalid.c b/gcc/testsuite/gcc.dg/attr-invalid.c
new file mode 100644
index 0000000..768921d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/attr-invalid.c
@@ -0,0 +1,56 @@
+/* { 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" "" } */
+{}
+
+int ATSYM(fn_isoarg) (int arg ATTR) {} /* { 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" "" } */
+}
+
+
+#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; /* { dg-warning "attribute ignored" "" } */
+
+int ATSYM(fn_knrarg) (arg)
+ int arg ATTR; /* { dg-warning "attribute ignored" "" } */
+{}
+
+int ATSYM(fn_isoarg) (int arg ATTR) {} /* { 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" "" } */
+}