Mercurial > projects > ldc
annotate test/intrinsics.d @ 295:895e1b50cf2a trunk
[svn r316] Fixed array slice assignments like: int[] arr = ...; arr[] = 42;
There was problems with most non basic types...
Added an option to premake so we can do: premake --target gnu --no-boehm
to disable the Boehm GC.
author | lindquist |
---|---|
date | Mon, 23 Jun 2008 14:48:42 +0200 |
parents | 44a95ac7368a |
children |
rev | line source |
---|---|
1 | 1 import llvm.intrinsic; |
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 { | |
9 float f; | |
10 printf("Enter float: "); | |
11 scanf("%f", &f); | |
12 float sf = llvm_sqrt(f); | |
13 printf("sqrt(%f) = %f\n", f, sf); | |
14 } | |
15 | |
16 { | |
17 double d; | |
18 printf("Enter double: "); | |
19 scanf("%lf", &d); | |
20 double sd = llvm_sqrt(d); | |
21 printf("sqrt(%lf) = %lf\n", d, sd); | |
22 } | |
23 | |
24 { | |
25 real d; | |
26 printf("Enter real: "); | |
27 scanf("%lf", &d); | |
28 real sd = llvm_sqrt(d); | |
29 printf("sqrt(%lf) = %lf\n", d, sd); | |
30 } | |
31 } |