2014-04-15 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / mips / octeon-bbit-3.c
blob7b73f43a1f45d55d6d908ebc861ae6f589e6d05d
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 "-march=octeon -meb" } */
15 /* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
17 /* { dg-final { scan-assembler-times "\tbbit\[01\]\t|\tbgez\t|\tbltz\t" 2 } } */
18 /* { dg-final { scan-assembler-not "ext\t" } } */
20 void abort (void);
21 void abort1 (void);
22 void exit (int);
24 typedef unsigned long long ulong64;
26 typedef struct bitfield_s {
27 ulong64 a:1;
28 ulong64 b:29;
29 ulong64 c:1;
30 ulong64 d:15;
31 ulong64 f:18;
32 } bitfield_t;
34 bitfield_t bar;
36 NOMIPS16 void
37 f ()
39 foo(&bar);
40 if (bar.a != 0x1)
41 abort ();
42 else if (!bar.c)
43 abort1 ();
44 else
45 exit (0);