Mercurial > projects > ldc
comparison tests/mini/packed1.d @ 445:cc40db549aea
Changed the handling of variadic intrinsics a bit.
Removed the -fp80 option and made real be 80bit floats on X86, this is what the D spec really says it should be and fixes a bunch of issues.
Changed the handling of parameter attributes to a bit more generalized approach.
Added sext/zext attributes for byte/short/ubyte/ushort parameters, fixes #60 .
Parameter attribs now properly set for intrinsic calls if necessary.
Made the tango.math.Math patch less intrusive.
Fixed/added some mini tests.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Fri, 01 Aug 2008 17:59:58 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
444:f2b5f86348ef | 445:cc40db549aea |
---|---|
1 module mini.packed1; | |
2 | |
3 extern(C) int printf(char*, ...); | |
4 | |
5 align(1) | |
6 struct PackedStruct | |
7 { | |
8 ubyte ub; | |
9 float f; | |
10 long l; | |
11 short s; | |
12 ubyte ub2; | |
13 short s2; | |
14 } | |
15 | |
16 void main() | |
17 { | |
18 PackedStruct[2] a = void; | |
19 void* begin = a.ptr; | |
20 void* end = &a[1]; | |
21 ptrdiff_t sz = end - begin; | |
22 printf("size = 18 = %u = %u\n", PackedStruct.sizeof, sz); | |
23 assert(sz == 18); | |
24 } |