annotate test/e.d @ 275:665b81613475 trunk

[svn r296] Removed: the 'suite' dir, it never took off! Fixed: foreach statement, key-type checks were buggy. Fixed: setting LLVMDC versions on the command line is now an error. Fixed: array compare runtime had incorrect param attrs on call. Fixed: index expressions on dynamic array slices w/o storage was broken. Fixed: scope classes had incorrect finalization in some cases. Fixed: when outputting !ClassInfoS !OffsetTypeInfoS, static class members were trying to be included, crashing the compiler. Fixed: calling LLVMDC with -inline but not any -O option caused assertion failure. Changed: the runtime now uses a single interface to "get" to !TypeInfoS, part of eliminating duplicate !TypeInfo codegen.
author lindquist
date Thu, 19 Jun 2008 17:30:32 +0200
parents d9d5d59873d8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
1 module e;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
2
270
d9d5d59873d8 [svn r291] Fixed a bunch of the old Phobos tests to work with Tango.
lindquist
parents: 1
diff changeset
3 extern(C) int printf(char*, ...);
d9d5d59873d8 [svn r291] Fixed a bunch of the old Phobos tests to work with Tango.
lindquist
parents: 1
diff changeset
4
1
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
5 struct C
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
6 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
7 float x=0,y=0;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
8
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
9 float dot(ref C b)
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
10 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
11 return x*b.x + y*b.y;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
12 }
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
13 }
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
14
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
15 void main()
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
16 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
17 C a,b;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
18 a.x = 2;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
19 a.y = 6;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
20 b.x = 3;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
21 b.y = 5;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
22 float f = a.dot(b);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
23 printf("%f\n", f);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
24 assert(f == 36);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
25 }