summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/compile/20090328-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/compile/20090328-1.c')
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20090328-1.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/compile/20090328-1.c b/gcc/testsuite/gcc.c-torture/compile/20090328-1.c
new file mode 100644
index 000000000..10328ad41
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20090328-1.c
@@ -0,0 +1,17 @@
+union loc { unsigned reg; signed offset; };
+void __frame_state_for (volatile char *state_in, int x)
+{
+ /* We should move all the loads out of this loop. Right now, we only
+ move one. It takes two insertions because we insert a cast. */
+ union loc fs;
+ int reg;
+ for (;;) {
+ switch (x) {
+ case 0:
+ *state_in = fs.reg;
+ case 1:
+ *state_in = fs.offset;
+ }
+ }
+}
+