Remove VMOVQQQQ pseudo instruction.
[oota-llvm.git] / test / FrontendObjC / 2009-04-28-bitfield-vs-vbc.m
1 // RUN: %llvmgcc -S -x objective-c -m32 %s -o %t
2 // This used to crash, 6831493.
3 #include <stdlib.h>
4
5 struct s0 {
6   double x;
7 };
8
9 @interface I2 {
10   struct s0 _iv1;
11 }
12 @end
13
14 @interface I3 : I2 {
15   unsigned int _iv2 :1;
16   unsigned : 0;
17   unsigned int _iv3 : 3;
18 }
19 @end
20
21 @interface I4 : I3 {
22   char _iv4;
23 }
24 @end
25
26 @interface I5 : I4 {
27   char _iv5;
28   int _iv6;
29   int _iv7;
30 }
31
32 @property int P1;
33 @end
34
35 @implementation I2
36 @end
37
38 @implementation I3
39 @end
40
41 @implementation I4 
42 @end
43
44 @interface I5 ()
45 @property int P2;
46 @end
47
48 #if 0
49 int g2 = sizeof(I2);
50 int g3 = sizeof(I3);
51 int g4 = sizeof(I4);
52 int g5_0 = sizeof(I5);
53 #endif
54
55 @implementation I5
56 #ifdef __x86_64
57 @synthesize P1 = _MadeUpName;
58 @synthesize P2 = _AnotherMadeUpName;
59 #else
60 @synthesize P1 = _iv6;
61 @synthesize P2 = _iv7;
62 #endif
63 @end
64
65 #if 0
66 int g5_1 = sizeof(I5);
67 #endif
68
69 @interface T0_I0 {
70   double iv_A_0;
71   char iv_A_1;
72 }
73 @end
74
75 @interface T0_I1 : T0_I0 {
76   char iv_B_0;
77 }
78 @end
79
80 @interface T0_I2 : T0_I1 {
81   char iv_C_0;
82 }
83 @end
84
85 #if 0
86 int g6 = sizeof(T0_I0);
87 int g7 = sizeof(T0_I1);
88 int g8 = sizeof(T0_I2);
89 #endif
90   
91 @implementation T0_I0 @end
92 @implementation T0_I1 @end  
93 @implementation T0_I2 @end
94
95 void f0(I2*i2,I3*i3,I4*i4,I5*i5,T0_I0*t0_i0,T0_I1*t0_i1,T0_I2*t0_i2) {
96 }
97
98 // Thomas Wang's ui32 hash.
99 unsigned hash_ui32_to_ui32(unsigned a) {
100   a = (a ^ 61) ^ (a >> 16);
101   a = a + (a << 3);
102   a = a ^ (a >> 4);
103   a = a * 0x27d4eb2d;
104   a = a ^ (a >> 15);
105   return a;
106 }
107
108 unsigned char hash_ui32_to_ui8(unsigned ui) {
109   ui = hash_ui32_to_ui32(ui);
110   ui ^= ui>>8;
111   ui ^= ui>>8;
112   ui ^= ui>>8;
113   return (unsigned char) ui;
114 }
115
116 void *init() {
117   unsigned i, N = 1024;
118   unsigned char *p = malloc(N);
119   for (i=0; i != N; ++i)
120     p[i] = hash_ui32_to_ui8(i);
121   return p;
122 }
123
124 int main(){
125   void *p = init();
126   f0(p,p,p,p,p,p,p);
127 }