1 /* { dg-do compile } */
2 /* { dg-options "-fno-tree-sra" } */
5 unsigned int bit_order
: 1;
6 unsigned int scl_io
: 1;
7 unsigned int scl_inv
: 1;
8 unsigned int sda0_io
: 1;
9 unsigned int sda0_idle
: 1;
10 unsigned int sda1_io
: 1;
11 unsigned int sda1_idle
: 1;
12 unsigned int sda2_io
: 1;
13 unsigned int sda2_idle
: 1;
14 unsigned int sda3_io
: 1;
15 unsigned int sda3_idle
: 1;
16 unsigned int sda_sel
: 2;
17 unsigned int sen_idle
: 1;
18 unsigned int sen_inv
: 1;
19 unsigned int sen_sel
: 2;
20 unsigned int dummy1
: 14;
21 } reg_gio_rw_i2c1_cfg
;
24 unsigned int data0
: 8;
25 unsigned int data1
: 8;
26 unsigned int data2
: 8;
27 unsigned int data3
: 8;
28 } reg_gio_rw_i2c1_data
;
31 unsigned int trf_bits
: 6;
32 unsigned int switch_dir
: 6;
33 unsigned int extra_start
: 3;
34 unsigned int early_end
: 1;
35 unsigned int start_stop
: 1;
36 unsigned int ack_dir0
: 1;
37 unsigned int ack_dir1
: 1;
38 unsigned int ack_dir2
: 1;
39 unsigned int ack_dir3
: 1;
40 unsigned int ack_dir4
: 1;
41 unsigned int ack_dir5
: 1;
42 unsigned int ack_bit
: 1;
43 unsigned int start_bit
: 1;
44 unsigned int freq
: 2;
45 unsigned int dummy1
: 5;
46 } reg_gio_rw_i2c1_ctrl
;
48 extern reg_gio_rw_i2c1_cfg reg_gio
;
49 extern reg_gio_rw_i2c1_data reg_data
;
51 extern reg_gio_rw_i2c1_ctrl reg_ctrl
;
53 extern void foobar(void);
55 extern void frob(unsigned int);
57 extern void baz(void);
59 unsigned int f(int *devspec
, unsigned int addr
)
61 reg_gio_rw_i2c1_ctrl ctrl
= {0};
62 reg_gio_rw_i2c1_data data
= {0};
69 reg_gio_rw_i2c1_cfg cfg
= {0};
96 ctrl
.switch_dir
= 8*3;
100 data
.data0
= devspec
[1] & 192;
102 data
.data2
= devspec
[1] | 0x01;