aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr46866.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr46866.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr46866.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr46866.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr46866.c
new file mode 100644
index 000000000..494114857
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr46866.c
@@ -0,0 +1,19 @@
+extern void *malloc(__SIZE_TYPE__);
+typedef struct T T;
+struct T {
+ void (*destroy)(void *);
+};
+void destroy(union { void *this; } __attribute__((transparent_union)));
+static const typeof(destroy) *_destroy = (const typeof(destroy)*)destroy;
+void destroy(void *this);
+static T *create_empty(void)
+{
+ T *this = malloc(sizeof(*this));
+ *this = (typeof(*this)){ _destroy };
+ return this;
+}
+void openssl_crl_load(void)
+{
+ T *this = create_empty();
+ destroy(this);
+}