Mercurial > projects > ldc
annotate test/intrinsics.d @ 100:5071469303d4 trunk
[svn r104] TONS OF FIXES.
Split up declaration, constant initializer gen and definition for globals, structs, classes and functions.
Improved ClassInfo support (not complete), not in vtable yet.
Fixed a bunch of forward reference problems.
Much more. Major commit! :)
author | lindquist |
---|---|
date | Fri, 16 Nov 2007 08:21:47 +0100 |
parents | c53b6e3fe49a |
children | 44a95ac7368a |
rev | line source |
---|---|
1 | 1 import llvm.intrinsic; |
2 | |
3 extern(C) int scanf(char*,...); | |
4 | |
5 void main() | |
6 { | |
7 { | |
8 float f; | |
9 printf("Enter float: "); | |
10 scanf("%f", &f); | |
11 float sf = llvm_sqrt(f); | |
12 printf("sqrt(%f) = %f\n", f, sf); | |
13 } | |
14 | |
15 { | |
16 double d; | |
17 printf("Enter double: "); | |
18 scanf("%lf", &d); | |
19 double sd = llvm_sqrt(d); | |
20 printf("sqrt(%lf) = %lf\n", d, sd); | |
21 } | |
22 | |
23 { | |
24 real d; | |
25 printf("Enter real: "); | |
26 scanf("%lf", &d); | |
27 real sd = llvm_sqrt(d); | |
28 printf("sqrt(%lf) = %lf\n", d, sd); | |
29 } | |
30 } |