* [PATCH] gcc/testsuite/gcc.dg/typeof-2.c
@ 2014-12-15 7:49 Sebastian Huber
2015-01-05 21:18 ` Jeff Law
0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Huber @ 2014-12-15 7:49 UTC (permalink / raw)
To: gcc-patches; +Cc: Sebastian Huber
gcc/testsuite/ChangeLog
2014-12-15 Sebastian Huber <sebastian.huber@embedded-brains.de>
* gcc.dg/typeof-2.c: Add checks for non-atomic types.
---
gcc/testsuite/gcc.dg/typeof-2.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/gcc/testsuite/gcc.dg/typeof-2.c b/gcc/testsuite/gcc.dg/typeof-2.c
index e916900..21ef5b0 100644
--- a/gcc/testsuite/gcc.dg/typeof-2.c
+++ b/gcc/testsuite/gcc.dg/typeof-2.c
@@ -2,6 +2,8 @@
/* { dg-do compile } */
/* { dg-options "-std=c11" } */
+/* Check that the qualifiers are discarded for atomic types. */
+
extern int i;
extern int * p;
@@ -26,3 +28,32 @@ void f(void)
__auto_type ari = ri;
int **pari = &ari;
}
+
+/* Check that the qualifiers are preserved for non-atomic types. */
+
+extern int const j;
+
+extern int volatile k;
+
+extern int * restrict q;
+
+extern int const nci;
+extern __typeof (nci) j;
+
+extern int volatile nvi;
+extern __typeof (nvi) k;
+
+extern int * restrict nri;
+extern __typeof (nri) q;
+
+void g(void)
+{
+ __auto_type aci = nci;
+ int const *paci = &aci;
+
+ __auto_type avi = nvi;
+ int volatile *pavi = &avi;
+
+ __auto_type ari = nri;
+ int * restrict *pari = &ari;
+}
--
1.8.4.5
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] gcc/testsuite/gcc.dg/typeof-2.c
2014-12-15 7:49 [PATCH] gcc/testsuite/gcc.dg/typeof-2.c Sebastian Huber
@ 2015-01-05 21:18 ` Jeff Law
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2015-01-05 21:18 UTC (permalink / raw)
To: Sebastian Huber, gcc-patches
On 12/15/14 00:26, Sebastian Huber wrote:
> gcc/testsuite/ChangeLog
> 2014-12-15 Sebastian Huber <sebastian.huber@embedded-brains.de>
>
> * gcc.dg/typeof-2.c: Add checks for non-atomic types.
OK for the trunk. Please install.
Thanks,
Jeff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-01-05 21:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-15 7:49 [PATCH] gcc/testsuite/gcc.dg/typeof-2.c Sebastian Huber
2015-01-05 21:18 ` Jeff Law
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).