]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/runnable/test3.d
d: Import dmd b8384668f, druntime e6caaab9, phobos 5ab9ad256 (v2.098.0-beta.1)
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / runnable / test3.d
1 // PERMUTE_ARGS: -unittest -O -release -inline -fPIC -g
2 // EXTRA_SOURCES: imports/test3a.d imports/test3b.d
3
4 import imports.test3a;
5
6 extern(C) int printf(const char*, ...);
7
8 class Foo
9 {
10 string bar;
11
12 unittest
13 {
14 printf("in Foo.unittest()\n");
15 }
16 }
17
18
19 void test(int a)
20 {
21 }
22
23 void test(uint b)
24 {
25 }
26
27
28 int main(string[] args)
29 {
30 Foo a = new Foo;
31 string baz = "lolo";
32
33 test(3);
34 a.bar = "hello";
35 a.bar = baz ~ "betty";
36
37 printf("a.bar = '%.*s'\n", cast(int)a.bar.length, a.bar.ptr);
38 assert(a.bar == "lolobetty");
39 return 0;
40 }
41