Require target lra in gcc.dg/pr108095.c
[official-gcc.git] / gcc / testsuite / gdc.dg / pr89017.d
blobb796e6246e8e7ac040af1625fbab78eaf0baec12
1 // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89017
2 // { dg-do compile }
4 enum Type
6 Struct,
7 Class,
8 Pointer,
9 Array,
12 auto f89017(Type type)()
14 static if (type == Type.Class)
16 class C(S)
18 struct S
20 void fn(){}
24 else
26 struct C(S)
28 struct S
30 void fn(){}
35 static if (type == Type.Struct)
36 return C!Type();
37 static if (type == Type.Class || type == Type.Pointer)
38 return new C!Type();
39 static if (type == Type.Array)
40 return new C!Type[2];
43 void test89017()
45 f89017!(Type.Class);
46 f89017!(Type.Struct);
47 f89017!(Type.Pointer);
48 f89017!(Type.Array);