summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cleanup-6.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-04 17:06:00 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-04 17:06:00 +0000
commit7acb29a3d9e072c65c26e582d4f4204dcf232d4a (patch)
treed3d591092d6a64dfc049785317e9f17e96cf7276 /gcc/testsuite/gcc.dg/cleanup-6.c
parent3fd62642d6a042a192f405ab559a0fef3c49f588 (diff)
downloadgcc-7acb29a3d9e072c65c26e582d4f4204dcf232d4a.tar.gz
* c-common.c (handle_cleanup_attribute): New.
(c_common_attributes): Add it. * c-decl.c (finish_decl): Honor the cleanup attribute. * doc/extend.texi (Variable Attributes): Document it. * unwind-c.c: New file. * Makefile.in (LIB2ADDEH): Add it. * config/t-darwin, config/t-linux, config/t-linux-gnulibc1, config/ia64/t-ia64: Likewise. * gcc.dg/cleanup-1.c: New. * gcc.dg/cleanup-2.c: New. * gcc.dg/cleanup-3.c: New. * gcc.dg/cleanup-4.c: New. * gcc.dg/cleanup-5.c: New. * gcc.dg/cleanup-6.c: New. * gcc.dg/cleanup-7.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@67449 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/cleanup-6.c')
-rw-r--r--gcc/testsuite/gcc.dg/cleanup-6.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/cleanup-6.c b/gcc/testsuite/gcc.dg/cleanup-6.c
new file mode 100644
index 00000000000..4e3d53893af
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cleanup-6.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+/* Verify that a cleanup marked "inline" gets inlined. */
+
+static inline void xyzzy(void *p __attribute__((unused)))
+{
+}
+
+void doit(void)
+{
+ int x __attribute__((cleanup (xyzzy)));
+}
+
+/* { dg-final { scan-assembler-not "xyzzy" } } */