summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/structopt-3.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/structopt-3.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/structopt-3.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/structopt-3.c b/gcc/testsuite/gcc.dg/tree-ssa/structopt-3.c
new file mode 100644
index 000000000..a7fcb5bf8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/structopt-3.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+struct foo
+{
+ int a;
+ int b;
+} temp;
+/* We should be able to optimize this to return 11. */
+int main(void)
+{
+ temp.a = 5;
+ temp.b = 6;
+ return temp.a + temp.b;
+}
+/* { dg-final { scan-tree-dump-times "return 11" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */