aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pointer-counted-by-4-union.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/pointer-counted-by-4-union.c')
-rw-r--r--gcc/testsuite/gcc.dg/pointer-counted-by-4-union.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pointer-counted-by-4-union.c b/gcc/testsuite/gcc.dg/pointer-counted-by-4-union.c
new file mode 100644
index 0000000..e786d99
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pointer-counted-by-4-union.c
@@ -0,0 +1,10 @@
+/* Test the attribute counted_by for pointer field and its usage in
+ * __builtin_dynamic_object_size. */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+union A {
+ int a;
+ float b;
+};
+#define PTR_TYPE union A
+#include "pointer-counted-by-4.c"