Mercurial > projects > ldc
annotate tests/mini/intrinsics.d @ 1442:0a5f7890f327
Adjust some more code that was depending on the function and delegate calling
conventions being equal.
There's also an instance in `tango.text.convert.Layout` that should be adjusted:
{{{
Index: tango/text/convert/Layout.d
===================================================================
--- tango/text/convert/Layout.d (revision 4578)
+++ tango/text/convert/Layout.d (working copy)
-660,8 +660,12 @@
case TypeCode.STRUCT:
auto s = cast(TypeInfo_Struct) type;
- if (s.xtoString)
- return Utf.fromString8 (s.xtoString(p), result);
+ if (s.xtoString) {
+ char[] delegate() toString;
+ toString.ptr = p;
+ toString.funcptr = cast(char[] function()) s.xtoString;
+ return Utf.fromString8 (toString(), result);
+ }
goto default;
case TypeCode.INTERFACE:
}}}
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Sun, 31 May 2009 15:27:01 +0200 |
parents | 146d8dfa0043 |
children |
rev | line source |
---|---|
663
6aaa3d3c1183
First part of rename to LDC.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
1 import ldc.intrinsics; |
1 | 2 |
133
44a95ac7368a
[svn r137] Many fixes towards tango.io.Console working, but not quite there yet...
lindquist
parents:
1
diff
changeset
|
3 extern(C) int printf(char*,...); |
1 | 4 extern(C) int scanf(char*,...); |
5 | |
6 void main() | |
7 { | |
8 float f; | |
9 printf("Enter float: "); | |
443
44f08170f4ef
Removed tango from the repository and instead added a runtime dir with the files needed to patch and build tango from svn.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
341
diff
changeset
|
10 //scanf("%f", &f); |
44f08170f4ef
Removed tango from the repository and instead added a runtime dir with the files needed to patch and build tango from svn.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
341
diff
changeset
|
11 f = 1.22345; |
1082
146d8dfa0043
Update testcase broken by intrinsics changes.
Frits van Bommel <fvbommel wxs.nl>
parents:
741
diff
changeset
|
12 float sf = llvm_sqrt(f); |
1 | 13 printf("sqrt(%f) = %f\n", f, sf); |
443
44f08170f4ef
Removed tango from the repository and instead added a runtime dir with the files needed to patch and build tango from svn.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
341
diff
changeset
|
14 |
1 | 15 double d; |
16 printf("Enter double: "); | |
443
44f08170f4ef
Removed tango from the repository and instead added a runtime dir with the files needed to patch and build tango from svn.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
341
diff
changeset
|
17 //scanf("%lf", &d); |
44f08170f4ef
Removed tango from the repository and instead added a runtime dir with the files needed to patch and build tango from svn.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
341
diff
changeset
|
18 d = 2.2311167895435245; |
1082
146d8dfa0043
Update testcase broken by intrinsics changes.
Frits van Bommel <fvbommel wxs.nl>
parents:
741
diff
changeset
|
19 double sd = llvm_sqrt(d); |
1 | 20 printf("sqrt(%lf) = %lf\n", d, sd); |
443
44f08170f4ef
Removed tango from the repository and instead added a runtime dir with the files needed to patch and build tango from svn.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
341
diff
changeset
|
21 |
44f08170f4ef
Removed tango from the repository and instead added a runtime dir with the files needed to patch and build tango from svn.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
341
diff
changeset
|
22 real r; |
44f08170f4ef
Removed tango from the repository and instead added a runtime dir with the files needed to patch and build tango from svn.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
341
diff
changeset
|
23 printf("Enter real: "); |
723
55f6c2e454d7
Implemented correct parameter order according to x86-32 ABI documentation.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
663
diff
changeset
|
24 //scanf("%llf", &r); |
443
44f08170f4ef
Removed tango from the repository and instead added a runtime dir with the files needed to patch and build tango from svn.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
341
diff
changeset
|
25 r = 3.2311167891231231234754764576; |
1082
146d8dfa0043
Update testcase broken by intrinsics changes.
Frits van Bommel <fvbommel wxs.nl>
parents:
741
diff
changeset
|
26 real sr = llvm_sqrt(r); |
146d8dfa0043
Update testcase broken by intrinsics changes.
Frits van Bommel <fvbommel wxs.nl>
parents:
741
diff
changeset
|
27 printf("sqrt(%Lf) = %Lf\n", r, sr); |
1 | 28 } |