| 1 | (* What AsmName's code procedures name in another module: an exported |
| 2 | procedure and variable, and a procedure that isn't exported, which |
| 3 | test/err/AsmNameHidden may not name. *) |
| 4 | module AsmNamed; |
| 5 | import SYSTEM; |
| 6 | |
| 7 | var count*: I64; (* added to through its address, by lea *) |
| 8 | |
| 9 | (* x * 2, the target of a tail call *) |
| 10 | proc twice*(x: I64): I64; |
| 11 | begin |
| 12 | return x * 2; |
| 13 | end; |
| 14 | |
| 15 | (* count's address, as raz takes it *) |
| 16 | proc countAt*: ^I64; |
| 17 | begin |
| 18 | return SYSTEM.ADR(count); |
| 19 | end; |
| 20 | |
| 21 | (* not exported: another module's code may not name it *) |
| 22 | proc hidden(x: I64): I64; |
| 23 | begin |
| 24 | return x; |
| 25 | end; |
| 26 | |
| 27 | begin |
| 28 | count := hidden(100); |
| 29 | end AsmNamed. |