Mercurial > projects > ldc
annotate tests/mini/intrinsics.d @ 1634:9cc791423e20
Fix typo for iretq
author | Kelly Wilson <wilsonk cpsc.ucalgary.ca> |
---|---|
date | Thu, 25 Feb 2010 17:12:54 -0700 |
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 } |