annotate run/t/typeinfo_03_B.d @ 1520:b5c0842014ef

adapted for DMD-1.013
author thomask
date Fri, 27 Apr 2007 17:23:42 +0000
parents 6666662e4363
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1449
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
1 // $HeadURL$
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
2 // $Date$
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
3 // $Author$
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
4
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
5 // @author@ Madeleine Freudenberg <madou@madou.org>
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
6 // @date@ 2007-04-01
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1089
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
8 // @desc@ [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
9
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
10 module dstress.run.t.typeinfo_03_B;
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
11
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
12 int main(){
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
13 TypeInfo_Pointer t = new TypeInfo_Pointer();
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
14 t.m_next = typeid(int);
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
15
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
16 int* a = new int;
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
17 int* b = new int;
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
18 *a = -10;
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
19 *b = int.max;
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
20
1520
b5c0842014ef adapted for DMD-1.013
thomask
parents: 1449
diff changeset
21 if(t.compare(a, b) < 0){
1449
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
22 assert(0);
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
23 }
1520
b5c0842014ef adapted for DMD-1.013
thomask
parents: 1449
diff changeset
24 if(0 < t.compare(b, a)){
1449
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
25 assert(0);
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
26 }
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
27
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
28 return 0;
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
29 }
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
30