annotate tests/mini/intrinsics.d @ 1651:cb960b882ca3 default tip

bindings were moved to dsource.org/projects/bindings/
author Moritz Warning <moritzwarning@web.de>
date Thu, 20 May 2010 20:05:03 +0200
parents 146d8dfa0043
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
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
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
4 extern(C) int scanf(char*,...);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
5
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
6 void main()
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
7 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
8 float f;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
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
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
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
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
15 double d;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
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
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
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
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
28 }