summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/20051012-1.c
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2005-10-12 20:30:46 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2005-10-12 20:30:46 +0000
commit201bc2b0bf9da2c5de0660e0f03fdc975350e29f (patch)
tree7660ea507d7f2bb6251942eadcbc1293734cb064 /gcc/testsuite/gcc.c-torture/execute/20051012-1.c
parent3923b69f425942813467f05a97628cce628cb260 (diff)
downloadgcc-201bc2b0bf9da2c5de0660e0f03fdc975350e29f.tar.gz
* combine.c (make_extraction): Correct offset computation.
* gcc.c-torture/execute/20051012-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@105330 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/execute/20051012-1.c')
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20051012-1.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/20051012-1.c b/gcc/testsuite/gcc.c-torture/execute/20051012-1.c
new file mode 100644
index 00000000000..f12f42913cc
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20051012-1.c
@@ -0,0 +1,24 @@
+extern void abort (void);
+
+struct type
+{
+ int *a;
+
+ int b:16;
+ unsigned int p:9;
+} t;
+
+unsigned int
+foo ()
+{
+ return t.p;
+}
+
+int
+main (void)
+{
+ t.p = 8;
+ if (foo (t) != 8)
+ abort ();
+ return 0;
+}