2009-07-17 Richard Guenther <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / mips / octeon-bbit-3.c
blobbcc37d29e34ba71dc9f408adef2f2d700f34c3f8
1 /* { dg-do compile } */
3 /* Force big-endian because for little-endian, combine generates this:
5 (if_then_else (ne (zero_extract:DI (subreg:DI (truncate:SI (reg:DI 196)) 0)
6 (const_int 1)
7 (const_int 0))
8 (const_int 0))
9 (label_ref 20)
10 (pc)))
12 which does not get recognized as a valid bbit pattern. The
13 middle-end should be able to simplify this further. */
14 /* { dg-options "-O2 -march=octeon -meb" } */
16 /* { dg-final { scan-assembler-times "\tbbit\[01\]\t|\tbgez\t" 2 } } */
17 /* { dg-final { scan-assembler-not "ext\t" } } */
19 void abort (void);
20 void exit (int);
22 typedef unsigned long long ulong64;
24 typedef struct bitfield_s {
25 ulong64 a:1;
26 ulong64 b:29;
27 ulong64 c:1;
28 ulong64 d:15;
29 ulong64 f:18;
30 } bitfield_t;
32 bitfield_t bar;
34 NOMIPS16 void
35 f ()
37 foo(&bar);
38 if (bar.a != 0x1)
39 abort ();
40 else if (!bar.c)
41 abort ();
42 else
43 exit (0);