aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr38271.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/torture/pr38271.c')
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr38271.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr38271.c b/gcc/testsuite/gcc.dg/torture/pr38271.c
new file mode 100644
index 00000000000..2c64a9b34a6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr38271.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized" } */
+
+struct xxx {
+ short a;
+ short b;
+ void *c;
+};
+
+void bar(struct xxx);
+
+void foo(struct xxx *p, int i)
+{
+ struct xxx s0 = *p;
+ struct xxx s = s0;
+ if (s.a) i++;
+ bar(s);
+}