Debian Codegraph @

gcc/testsuite/gdc.dg/torture/gdc17.d

raw
1 // https://bugzilla.gdcproject.org/show_bug.cgi?id=17
2 // { dg-do run }
3 // { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
4
5 /**
6 * Parameters are not copied into a frame to be accessed from
7 * the method's __require function.
8 */
9 void contractTest(string path)
10 {
11 assert(path[0] == 't');
12 assert(path.length == 9);
13 assert(path[8] == 'i');
14 }
15
16 interface ModuleSaver
17 {
18 void save(string str)
19 in
20 {
21 contractTest(str);
22 }
23 }
24
25 class ModuleWriter : ModuleSaver
26 {
27 void save (string str)
28 in {}
29 do
30 {
31 }
32 }
33
34 void main()
35 {
36 (new ModuleWriter()).save ("test.0.mci");
37 }