A brief survey of priority_queue usage in the tree turned this up
[oota-llvm.git] / test / FrontendC / 2008-03-24-BitField-And-Alloca.c
1 // RUN: %llvmgcc -S --emit-llvm %s -o - | not grep "\{ i8, .7 x i8. \}"
2 // RUN: %llvmgcc -O2 -S %s -o - | not grep alloca
3 enum {
4  PP_C,
5  PP_D,
6  PP_R,
7  PP_2D,
8  PP_1D,
9  PP_SR,
10  PP_S2D,
11  PP_S1D,
12  PP_SC
13 };
14
15 enum {
16  G_VP,
17  G_FP,
18  G_VS,
19  G_GS,
20  G_FS
21 };
22
23 enum {
24  G_NONE,
25  G_B,
26  G_R
27 };
28
29 typedef union _Key {
30  struct {
31   unsigned int count : 2;
32   unsigned int Aconst : 1;
33   unsigned int Bconst : 1;
34   unsigned int Cconst : 1;
35   unsigned int Xused : 1;
36   unsigned int Yused : 1;
37   unsigned int Zused : 1;
38   unsigned int Wused : 1;
39   unsigned int ttype : 3;
40   unsigned int scalar : 1;
41   unsigned int AType : 4;
42   unsigned int BType : 4;
43   unsigned int CType : 4;
44   unsigned int RType : 4;
45   unsigned int Size : 2;
46   unsigned int prec : 1;
47
48   unsigned int ASize : 2;
49   unsigned int BSize : 2;
50   unsigned int CSize : 2;
51   unsigned int tTex : 4;
52   unsigned int proj : 1;
53   unsigned int lod : 2;
54   unsigned int dvts : 1;
55   unsigned int uipad : 18;
56  } key_io;
57  struct {
58   unsigned int key0;
59   unsigned int key1;
60  } key;
61  unsigned long long lkey;
62 } Key;
63
64 static inline __attribute__ ((always_inline)) void foo(const Key iospec, int* ret)
65 {
66   *ret=0;
67  if(((iospec.key_io.lod == G_B) &&
68   (iospec.key_io.ttype != G_VS) &&
69   (iospec.key_io.ttype != G_GS) &&
70   (iospec.key_io.ttype != G_FS)) ||
71
72   (((iospec.key_io.tTex == PP_C) ||
73     (iospec.key_io.tTex == PP_SC)) &&
74    ((iospec.key_io.tTex == PP_SR) ||
75     (iospec.key_io.tTex == PP_S2D) ||
76     (iospec.key_io.tTex == PP_S1D) ||
77     (iospec.key_io.tTex == PP_SC))))
78   *ret=1;
79 }
80
81
82 extern int bar(unsigned long long key_token2)
83 {
84  int ret;
85  __attribute__ ((unused)) Key iospec = (Key) key_token2;
86  foo(iospec, &ret);
87  return ret;
88 }