aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/pr66768.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/pr66768.c')
-rw-r--r--gcc/testsuite/gcc.target/i386/pr66768.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/pr66768.c b/gcc/testsuite/gcc.target/i386/pr66768.c
new file mode 100644
index 0000000..9a8ad1f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr66768.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef __seg_gs struct foo_s {
+ int a[20];
+} foo_t;
+
+int sum(void)
+{
+ const foo_t *p = (const foo_t *)0x1234;
+ int i, total=0;
+ for (i=0; i<20; i++)
+ total += p->a[i];
+ return total;
+}
+
+/* { dg-final { scan-assembler "add*.\[ \t\]%gs:" } } */