@@ -2,6 +2,7 @@ extern crate inkwell;
2
2
3
3
use std:: ffi:: CString ;
4
4
5
+ use self :: inkwell:: AddressSpace ;
5
6
use self :: inkwell:: context:: Context ;
6
7
use self :: inkwell:: types:: { FloatType , IntType , StructType , VoidType } ;
7
8
@@ -156,26 +157,26 @@ fn test_sized_types() {
156
157
assert ! ( !fn_type3. is_sized( ) ) ;
157
158
assert ! ( !fn_type4. is_sized( ) ) ;
158
159
159
- assert ! ( void_type. ptr_type( 0 ) . is_sized( ) ) ;
160
- assert ! ( bool_type. ptr_type( 0 ) . is_sized( ) ) ;
161
- assert ! ( i8_type. ptr_type( 0 ) . is_sized( ) ) ;
162
- assert ! ( i16_type. ptr_type( 0 ) . is_sized( ) ) ;
163
- assert ! ( i32_type. ptr_type( 0 ) . is_sized( ) ) ;
164
- assert ! ( i64_type. ptr_type( 0 ) . is_sized( ) ) ;
165
- assert ! ( i128_type. ptr_type( 0 ) . is_sized( ) ) ;
166
- assert ! ( f16_type. ptr_type( 0 ) . is_sized( ) ) ;
167
- assert ! ( f32_type. ptr_type( 0 ) . is_sized( ) ) ;
168
- assert ! ( f64_type. ptr_type( 0 ) . is_sized( ) ) ;
169
- assert ! ( f128_type. ptr_type( 0 ) . is_sized( ) ) ;
170
- assert ! ( ppc_f128_type. ptr_type( 0 ) . is_sized( ) ) ;
171
- assert ! ( struct_type. ptr_type( 0 ) . is_sized( ) ) ;
172
- assert ! ( struct_type2. ptr_type( 0 ) . is_sized( ) ) ;
173
- assert ! ( struct_type3. ptr_type( 0 ) . is_sized( ) ) ;
174
- assert ! ( struct_type4. ptr_type( 0 ) . is_sized( ) ) ;
175
- assert ! ( opaque_struct_type. ptr_type( 0 ) . is_sized( ) ) ;
160
+ assert ! ( void_type. ptr_type( AddressSpace :: Generic ) . is_sized( ) ) ;
161
+ assert ! ( bool_type. ptr_type( AddressSpace :: Generic ) . is_sized( ) ) ;
162
+ assert ! ( i8_type. ptr_type( AddressSpace :: Generic ) . is_sized( ) ) ;
163
+ assert ! ( i16_type. ptr_type( AddressSpace :: Generic ) . is_sized( ) ) ;
164
+ assert ! ( i32_type. ptr_type( AddressSpace :: Generic ) . is_sized( ) ) ;
165
+ assert ! ( i64_type. ptr_type( AddressSpace :: Generic ) . is_sized( ) ) ;
166
+ assert ! ( i128_type. ptr_type( AddressSpace :: Generic ) . is_sized( ) ) ;
167
+ assert ! ( f16_type. ptr_type( AddressSpace :: Generic ) . is_sized( ) ) ;
168
+ assert ! ( f32_type. ptr_type( AddressSpace :: Generic ) . is_sized( ) ) ;
169
+ assert ! ( f64_type. ptr_type( AddressSpace :: Generic ) . is_sized( ) ) ;
170
+ assert ! ( f128_type. ptr_type( AddressSpace :: Generic ) . is_sized( ) ) ;
171
+ assert ! ( ppc_f128_type. ptr_type( AddressSpace :: Generic ) . is_sized( ) ) ;
172
+ assert ! ( struct_type. ptr_type( AddressSpace :: Generic ) . is_sized( ) ) ;
173
+ assert ! ( struct_type2. ptr_type( AddressSpace :: Generic ) . is_sized( ) ) ;
174
+ assert ! ( struct_type3. ptr_type( AddressSpace :: Generic ) . is_sized( ) ) ;
175
+ assert ! ( struct_type4. ptr_type( AddressSpace :: Generic ) . is_sized( ) ) ;
176
+ assert ! ( opaque_struct_type. ptr_type( AddressSpace :: Generic ) . is_sized( ) ) ;
176
177
177
178
// REVIEW: You can't have array of void right?
178
- assert ! ( void_type. ptr_type( 0 ) . array_type( 42 ) . is_sized( ) ) ;
179
+ assert ! ( void_type. ptr_type( AddressSpace :: Generic ) . array_type( 42 ) . is_sized( ) ) ;
179
180
assert ! ( bool_type. array_type( 42 ) . is_sized( ) ) ;
180
181
assert ! ( i8_type. array_type( 42 ) . is_sized( ) ) ;
181
182
assert ! ( i16_type. array_type( 42 ) . is_sized( ) ) ;
@@ -194,7 +195,7 @@ fn test_sized_types() {
194
195
assert ! ( !opaque_struct_type. array_type( 0 ) . is_sized( ) ) ;
195
196
196
197
// REVIEW: You can't have vec of void right?
197
- assert ! ( void_type. ptr_type( 0 ) . vec_type( 42 ) . is_sized( ) ) ;
198
+ assert ! ( void_type. ptr_type( AddressSpace :: Generic ) . vec_type( 42 ) . is_sized( ) ) ;
198
199
assert ! ( bool_type. vec_type( 42 ) . is_sized( ) ) ;
199
200
assert ! ( i8_type. vec_type( 42 ) . is_sized( ) ) ;
200
201
assert ! ( i16_type. vec_type( 42 ) . is_sized( ) ) ;
@@ -228,7 +229,7 @@ fn test_const_null() {
228
229
let f64_type = context. f64_type ( ) ;
229
230
let f128_type = context. f128_type ( ) ;
230
231
let struct_type = context. struct_type ( & [ & i8_type, & f128_type] , false ) ;
231
- let ptr_type = f64_type. ptr_type ( 0 ) ;
232
+ let ptr_type = f64_type. ptr_type ( AddressSpace :: Generic ) ;
232
233
let vec_type = f64_type. vec_type ( 42 ) ;
233
234
let array_type = f64_type. array_type ( 42 ) ;
234
235
0 commit comments