annotate tests/mini/asm7.d @ 715:30b42a283c8e

Removed TypeOpaque from DMD. Changed runtime functions taking opaque[] to void[]. Implemented proper type painting, to avoid "resizing" array casts in runtime calls that previously took opaque[]. Implemented dynamic arrays as first class types, this implements proper ABI for these types on x86. Added dwarf region end after call to assert function, fixes some problems with llvm not allowing this to be missing. Reverted change to WithStatement from rev [704] it breaks MiniD, mini/with2.d needs to be fixed some other way... Fixed tango bug 1339 in runtime, problem with _adReverseChar on invalid UTF-8. Disabled .bc generation in the compiler runtime part, genobj.d triggers some llvm bug when using debug info. the .o seems to work fine.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Wed, 22 Oct 2008 14:55:33 +0200
parents 1bb99290e03a
children 4ac97ec7c18e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
305
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
1 module tangotests.asm7;
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
2
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
3 // test massive label collisions (runtime uses Loverflow too)
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
4
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
5 void main()
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
6 {
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
7 int a = add(1,2);
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
8 int s = sub(1,2);
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
9 assert(a == 3);
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
10 assert(s == -1);
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
11 }
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
12
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
13 int add(int a, int b)
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
14 {
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
15 int res;
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
16 asm
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
17 {
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
18 mov EAX, a;
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
19 add EAX, b;
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
20 jo Loverflow;
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
21 mov res, EAX;
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
22 }
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
23 return res;
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
24 Loverflow:
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
25 assert(0, "add overflow");
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
26 }
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
27
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
28 int sub(int a, int b)
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
29 {
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
30 int res;
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
31 asm
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
32 {
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
33 mov EAX, a;
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
34 sub EAX, b;
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
35 jo Loverflow;
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
36 mov res, EAX;
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
37 }
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
38 return res;
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
39 Loverflow:
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
40 assert(0, "sub overflow");
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
diff changeset
41 }