annotate undefined/const_24.d @ 1630:d0efa3ae5522 default tip

run/mini/naked_asm5: New x86_64 ABI passes the arguments in reverse order.
author David Nadlinger <code@klickverbot.at>
date Sat, 23 Apr 2011 22:57:32 +0200
parents a4e907daaf85
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
621
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
1 // $HeadURL$
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
2 // $Date$
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
3 // $Author$
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
4
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
5 // @author@ xs0 <xs0@xs0.com>
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
6 // @date@ 2005-08-11
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
7 // @uri@ news:ddfegl$2uof$1@digitaldaemon.com
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
8
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
9 //
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
10 // http://www.digitalmars.com/d/attribute.html
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
11 //
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
12 // (1)
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
13 // The const attribute declares constants that can be evaluated at
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
14 // compile time.
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
15 //
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
16 // (2)
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
17 // A const declaration without an initializer must be initialized in a
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
18 // constructor (for class fields) or in a static constructor (for static
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
19 // class members, or module variable declarations).
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
20 //
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
21
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
22 module dstress.undefined.const_24;
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
23
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
24 class Class{
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
25 const int i;
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
26
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
27 this(){
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
28 i=dynamicInt; // illegal(1) or legal(2) ?
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
29 }
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
30 }
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
31
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
32 int dynamicInt;
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
33
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
34 int main(char[][] args){
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
35 dynamicInt=args.length;
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
36
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
37 Class c = new Class();
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
38 assert(c.i==args.length);
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
39
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
40 return 0;
a4e907daaf85 const: compile or runtime?
thomask
parents:
diff changeset
41 }