summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/compilable
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2022-02-20 20:02:23 +0100
committerIain Buclaw <ibuclaw@gdcproject.org>2022-02-20 23:37:32 +0100
commit6384eff56dba1fac071c1b525f7e49cf03f2737f (patch)
tree7263a4a6ec603a81f6df660f4f6b19a4607513fc /gcc/testsuite/gdc.test/compilable
parente49508ac6b36adb8a2056c5a1fb6e0178de2439d (diff)
d: Merge upstream dmd cb49e99f8, druntime 55528bd1, phobos 1a3e80ec2.
D front-end changes: - Import dmd v2.099.0-beta.1. - It's now an error to use `alias this' for partial assignment. - The `delete' keyword has been removed from the language. - Using `this' and `super' as types has been removed from the language, the parser no longer specially handles this wrong code with an informative error. D Runtime changes: - Import druntime v2.099.0-beta.1. Phobos changes: - Import phobos v2.099.0-beta.1. gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd cb49e99f8. * dmd/VERSION: Update version to v2.099.0-beta.1. * decl.cc (layout_class_initializer): Update call to NewExp::create. * expr.cc (ExprVisitor::visit (DeleteExp *)): Remove handling of deleting arrays and pointers. (ExprVisitor::visit (DotVarExp *)): Convert complex types to the front-end library type representing them. (ExprVisitor::visit (StringExp *)): Use getCodeUnit instead of charAt to get the value of each index in a string expression. * runtime.def (DELMEMORY): Remove. (DELARRAYT): Remove. * types.cc (TypeVisitor::visit (TypeEnum *)): Handle anonymous enums. libphobos/ChangeLog: * libdruntime/MERGE: Merge upstream druntime 55528bd1. * src/MERGE: Merge upstream phobos 1a3e80ec2. * testsuite/libphobos.hash/test_hash.d: Update. * testsuite/libphobos.betterc/test19933.d: New test.
Diffstat (limited to 'gcc/testsuite/gdc.test/compilable')
-rw-r--r--gcc/testsuite/gdc.test/compilable/99bottles.d212
-rw-r--r--gcc/testsuite/gdc.test/compilable/b18242.d6
-rw-r--r--gcc/testsuite/gdc.test/compilable/b19294.d10
-rw-r--r--gcc/testsuite/gdc.test/compilable/b20938.d6
-rw-r--r--gcc/testsuite/gdc.test/compilable/b21285.d10
-rw-r--r--gcc/testsuite/gdc.test/compilable/commontype.d9
-rw-r--r--gcc/testsuite/gdc.test/compilable/ddoc10.d2
-rw-r--r--gcc/testsuite/gdc.test/compilable/ddoc11.d2
-rw-r--r--gcc/testsuite/gdc.test/compilable/ddoc14.d2
-rw-r--r--gcc/testsuite/gdc.test/compilable/ddoc3.d2
-rw-r--r--gcc/testsuite/gdc.test/compilable/ddoc5.d4
-rw-r--r--gcc/testsuite/gdc.test/compilable/ddoc5446.d22
-rw-r--r--gcc/testsuite/gdc.test/compilable/ddoc9155.d10
-rw-r--r--gcc/testsuite/gdc.test/compilable/debugInference.d6
-rw-r--r--gcc/testsuite/gdc.test/compilable/defa.d2
-rw-r--r--gcc/testsuite/gdc.test/compilable/dlangui_crash.d34
-rw-r--r--gcc/testsuite/gdc.test/compilable/enumbasearithmetic.d20
-rw-r--r--gcc/testsuite/gdc.test/compilable/header18364.d2
-rw-r--r--gcc/testsuite/gdc.test/compilable/imports/b33a.d4
-rw-r--r--gcc/testsuite/gdc.test/compilable/imports/imp22734.c3
-rw-r--r--gcc/testsuite/gdc.test/compilable/imports/test22714a.d3
-rw-r--r--gcc/testsuite/gdc.test/compilable/imports/test22714b.d12
-rw-r--r--gcc/testsuite/gdc.test/compilable/issue16472.d42
-rw-r--r--gcc/testsuite/gdc.test/compilable/issue21340.d4
-rw-r--r--gcc/testsuite/gdc.test/compilable/issue21813b.d2
-rw-r--r--gcc/testsuite/gdc.test/compilable/minimal.d2
-rw-r--r--gcc/testsuite/gdc.test/compilable/test10993.d2
-rw-r--r--gcc/testsuite/gdc.test/compilable/test16107.d6
-rw-r--r--gcc/testsuite/gdc.test/compilable/test17545.d2
-rw-r--r--gcc/testsuite/gdc.test/compilable/test17906.d7
-rw-r--r--gcc/testsuite/gdc.test/compilable/test18030.d2
-rw-r--r--gcc/testsuite/gdc.test/compilable/test19014.d2
-rw-r--r--gcc/testsuite/gdc.test/compilable/test19315.d2
-rw-r--r--gcc/testsuite/gdc.test/compilable/test19557.d2
-rw-r--r--gcc/testsuite/gdc.test/compilable/test19609.d4
-rw-r--r--gcc/testsuite/gdc.test/compilable/test21177.d76
-rw-r--r--gcc/testsuite/gdc.test/compilable/test21196.d71
-rw-r--r--gcc/testsuite/gdc.test/compilable/test22224.d2
-rw-r--r--gcc/testsuite/gdc.test/compilable/test22632.d4
-rw-r--r--gcc/testsuite/gdc.test/compilable/test22714.d3
-rw-r--r--gcc/testsuite/gdc.test/compilable/test22734.d6
-rw-r--r--gcc/testsuite/gdc.test/compilable/test4375.d6
-rw-r--r--gcc/testsuite/gdc.test/compilable/test7172.d2
-rw-r--r--gcc/testsuite/gdc.test/compilable/test8296.d4
-rw-r--r--gcc/testsuite/gdc.test/compilable/test8513.d8
-rw-r--r--gcc/testsuite/gdc.test/compilable/testpostblit.d2
-rw-r--r--gcc/testsuite/gdc.test/compilable/testsctreturn.d16
-rw-r--r--gcc/testsuite/gdc.test/compilable/typeid_name.d2
-rw-r--r--gcc/testsuite/gdc.test/compilable/vgc1.d17
49 files changed, 476 insertions, 205 deletions
diff --git a/gcc/testsuite/gdc.test/compilable/99bottles.d b/gcc/testsuite/gdc.test/compilable/99bottles.d
index 5341a49f766..ac416eb0fcb 100644
--- a/gcc/testsuite/gdc.test/compilable/99bottles.d
+++ b/gcc/testsuite/gdc.test/compilable/99bottles.d
@@ -3,7 +3,7 @@
// http://www.99-bottles-of-beer.net/language-d-1212.html
// Generates the "99 bottles of beer" song at compile time,
-// using the template metaprograming facilities of D.
+// using the template metaprograming facilities of D.
// No executable is generated. No libraries are used.
// Illustrates template default values, template string value parameters,
// compile-time concatenation of constant strings, static if.
@@ -24,13 +24,13 @@ template itoa(ulong n)
template showHowMany(int n, string where, bool needcapital = false)
{
- static if ( n > 1 )
+ static if ( n > 1 )
const string showHowMany = itoa!(n) ~ " bottles of beer" ~ where ~ "\n";
else static if ( n == 1 )
const string showHowMany = "1 bottle of beer" ~ where ~ "\n";
else static if ( needcapital )
const string showHowMany = "No more bottles of beer" ~ where ~ "\n";
- else
+ else
const string showHowMany = "no more bottles of beer" ~ where ~ "\n";
}
@@ -39,514 +39,514 @@ template beer(int maxbeers, int n = maxbeers)
static if ( n > 0 )
const string beer = showHowMany!(n, " on the wall,", true)
~ showHowMany!(n, ".")
- ~ "Take one down and pass it around, " ~ "\n"
- ~ showHowMany!( n - 1 , " on the wall.")
+ ~ "Take one down and pass it around," ~ "\n"
+ ~ showHowMany!( n - 1 , " on the wall.")
~ "\n" ~ beer!(maxbeers, n - 1); // recurse for subsequent verses.
else
const string beer = showHowMany!(n, " on the wall,", true)
~ showHowMany!(n, ".")
- ~ "Go to the store and buy some more, " ~ "\n"
+ ~ "Go to the store and buy some more," ~ "\n"
~ showHowMany!( maxbeers, " on the wall.");
}
enum expected = `99 bottles of beer on the wall,
99 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
98 bottles of beer on the wall.
98 bottles of beer on the wall,
98 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
97 bottles of beer on the wall.
97 bottles of beer on the wall,
97 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
96 bottles of beer on the wall.
96 bottles of beer on the wall,
96 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
95 bottles of beer on the wall.
95 bottles of beer on the wall,
95 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
94 bottles of beer on the wall.
94 bottles of beer on the wall,
94 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
93 bottles of beer on the wall.
93 bottles of beer on the wall,
93 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
92 bottles of beer on the wall.
92 bottles of beer on the wall,
92 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
91 bottles of beer on the wall.
91 bottles of beer on the wall,
91 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
90 bottles of beer on the wall.
90 bottles of beer on the wall,
90 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
89 bottles of beer on the wall.
89 bottles of beer on the wall,
89 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
88 bottles of beer on the wall.
88 bottles of beer on the wall,
88 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
87 bottles of beer on the wall.
87 bottles of beer on the wall,
87 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
86 bottles of beer on the wall.
86 bottles of beer on the wall,
86 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
85 bottles of beer on the wall.
85 bottles of beer on the wall,
85 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
84 bottles of beer on the wall.
84 bottles of beer on the wall,
84 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
83 bottles of beer on the wall.
83 bottles of beer on the wall,
83 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
82 bottles of beer on the wall.
82 bottles of beer on the wall,
82 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
81 bottles of beer on the wall.
81 bottles of beer on the wall,
81 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
80 bottles of beer on the wall.
80 bottles of beer on the wall,
80 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
79 bottles of beer on the wall.
79 bottles of beer on the wall,
79 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
78 bottles of beer on the wall.
78 bottles of beer on the wall,
78 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
77 bottles of beer on the wall.
77 bottles of beer on the wall,
77 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
76 bottles of beer on the wall.
76 bottles of beer on the wall,
76 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
75 bottles of beer on the wall.
75 bottles of beer on the wall,
75 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
74 bottles of beer on the wall.
74 bottles of beer on the wall,
74 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
73 bottles of beer on the wall.
73 bottles of beer on the wall,
73 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
72 bottles of beer on the wall.
72 bottles of beer on the wall,
72 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
71 bottles of beer on the wall.
71 bottles of beer on the wall,
71 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
70 bottles of beer on the wall.
70 bottles of beer on the wall,
70 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
69 bottles of beer on the wall.
69 bottles of beer on the wall,
69 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
68 bottles of beer on the wall.
68 bottles of beer on the wall,
68 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
67 bottles of beer on the wall.
67 bottles of beer on the wall,
67 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
66 bottles of beer on the wall.
66 bottles of beer on the wall,
66 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
65 bottles of beer on the wall.
65 bottles of beer on the wall,
65 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
64 bottles of beer on the wall.
64 bottles of beer on the wall,
64 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
63 bottles of beer on the wall.
63 bottles of beer on the wall,
63 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
62 bottles of beer on the wall.
62 bottles of beer on the wall,
62 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
61 bottles of beer on the wall.
61 bottles of beer on the wall,
61 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
60 bottles of beer on the wall.
60 bottles of beer on the wall,
60 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
59 bottles of beer on the wall.
59 bottles of beer on the wall,
59 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
58 bottles of beer on the wall.
58 bottles of beer on the wall,
58 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
57 bottles of beer on the wall.
57 bottles of beer on the wall,
57 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
56 bottles of beer on the wall.
56 bottles of beer on the wall,
56 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
55 bottles of beer on the wall.
55 bottles of beer on the wall,
55 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
54 bottles of beer on the wall.
54 bottles of beer on the wall,
54 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
53 bottles of beer on the wall.
53 bottles of beer on the wall,
53 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
52 bottles of beer on the wall.
52 bottles of beer on the wall,
52 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
51 bottles of beer on the wall.
51 bottles of beer on the wall,
51 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
50 bottles of beer on the wall.
50 bottles of beer on the wall,
50 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
49 bottles of beer on the wall.
49 bottles of beer on the wall,
49 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
48 bottles of beer on the wall.
48 bottles of beer on the wall,
48 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
47 bottles of beer on the wall.
47 bottles of beer on the wall,
47 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
46 bottles of beer on the wall.
46 bottles of beer on the wall,
46 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
45 bottles of beer on the wall.
45 bottles of beer on the wall,
45 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
44 bottles of beer on the wall.
44 bottles of beer on the wall,
44 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
43 bottles of beer on the wall.
43 bottles of beer on the wall,
43 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
42 bottles of beer on the wall.
42 bottles of beer on the wall,
42 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
41 bottles of beer on the wall.
41 bottles of beer on the wall,
41 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
40 bottles of beer on the wall.
40 bottles of beer on the wall,
40 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
39 bottles of beer on the wall.
39 bottles of beer on the wall,
39 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
38 bottles of beer on the wall.
38 bottles of beer on the wall,
38 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
37 bottles of beer on the wall.
37 bottles of beer on the wall,
37 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
36 bottles of beer on the wall.
36 bottles of beer on the wall,
36 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
35 bottles of beer on the wall.
35 bottles of beer on the wall,
35 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
34 bottles of beer on the wall.
34 bottles of beer on the wall,
34 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
33 bottles of beer on the wall.
33 bottles of beer on the wall,
33 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
32 bottles of beer on the wall.
32 bottles of beer on the wall,
32 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
31 bottles of beer on the wall.
31 bottles of beer on the wall,
31 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
30 bottles of beer on the wall.
30 bottles of beer on the wall,
30 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
29 bottles of beer on the wall.
29 bottles of beer on the wall,
29 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
28 bottles of beer on the wall.
28 bottles of beer on the wall,
28 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
27 bottles of beer on the wall.
27 bottles of beer on the wall,
27 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
26 bottles of beer on the wall.
26 bottles of beer on the wall,
26 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
25 bottles of beer on the wall.
25 bottles of beer on the wall,
25 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
24 bottles of beer on the wall.
24 bottles of beer on the wall,
24 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
23 bottles of beer on the wall.
23 bottles of beer on the wall,
23 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
22 bottles of beer on the wall.
22 bottles of beer on the wall,
22 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
21 bottles of beer on the wall.
21 bottles of beer on the wall,
21 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
20 bottles of beer on the wall.
20 bottles of beer on the wall,
20 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
19 bottles of beer on the wall.
19 bottles of beer on the wall,
19 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
18 bottles of beer on the wall.
18 bottles of beer on the wall,
18 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
17 bottles of beer on the wall.
17 bottles of beer on the wall,
17 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
16 bottles of beer on the wall.
16 bottles of beer on the wall,
16 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
15 bottles of beer on the wall.
15 bottles of beer on the wall,
15 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
14 bottles of beer on the wall.
14 bottles of beer on the wall,
14 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
13 bottles of beer on the wall.
13 bottles of beer on the wall,
13 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
12 bottles of beer on the wall.
12 bottles of beer on the wall,
12 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
11 bottles of beer on the wall.
11 bottles of beer on the wall,
11 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
10 bottles of beer on the wall.
10 bottles of beer on the wall,
10 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
9 bottles of beer on the wall.
9 bottles of beer on the wall,
9 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
8 bottles of beer on the wall.
8 bottles of beer on the wall,
8 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
7 bottles of beer on the wall.
7 bottles of beer on the wall,
7 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
6 bottles of beer on the wall.
6 bottles of beer on the wall,
6 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
5 bottles of beer on the wall.
5 bottles of beer on the wall,
5 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
4 bottles of beer on the wall.
4 bottles of beer on the wall,
4 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
3 bottles of beer on the wall.
3 bottles of beer on the wall,
3 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
2 bottles of beer on the wall.
2 bottles of beer on the wall,
2 bottles of beer.
-Take one down and pass it around,
+Take one down and pass it around,
1 bottle of beer on the wall.
1 bottle of beer on the wall,
1 bottle of beer.
-Take one down and pass it around,
+Take one down and pass it around,
no more bottles of beer on the wall.
No more bottles of beer on the wall,
no more bottles of beer.
-Go to the store and buy some more,
+Go to the store and buy some more,
99 bottles of beer on the wall.
`;
diff --git a/gcc/testsuite/gdc.test/compilable/b18242.d b/gcc/testsuite/gdc.test/compilable/b18242.d
index 5dcaeca73b4..3bc699aa7da 100644
--- a/gcc/testsuite/gdc.test/compilable/b18242.d
+++ b/gcc/testsuite/gdc.test/compilable/b18242.d
@@ -5,14 +5,14 @@ module object;
class Object { }
class TypeInfo { }
-class TypeInfo_Class : TypeInfo
-{
+class TypeInfo_Class : TypeInfo
+{
version(D_LP64) { ubyte[136] _x; } else { ubyte[68] _x; }
}
class Throwable { }
-int _d_run_main()
+int _d_run_main()
{
try { } catch(Throwable e) { return 1; }
return 0;
diff --git a/gcc/testsuite/gdc.test/compilable/b19294.d b/gcc/testsuite/gdc.test/compilable/b19294.d
index 063a9df152a..ed1a71747e4 100644
--- a/gcc/testsuite/gdc.test/compilable/b19294.d
+++ b/gcc/testsuite/gdc.test/compilable/b19294.d
@@ -51,19 +51,19 @@ void test()
MT s = MyStruct!int(1);
MT[] arr = [s, 2 * s, 3 * s, 4 * s, 5 * s, 6 * s];
MT[] result = new MT[arr.length];
-
+
result[] = arr[] + s;
result[] = s + arr[];
-
+
result[] = arr[] - s;
result[] = s - arr[];
-
+
result[] = arr[] * s;
result[] = s * arr[];
-
+
result[] = arr[] / s;
result[] = s / arr[];
-
+
result[] = arr[] ^^ s;
result[] = s ^^ arr[];
}
diff --git a/gcc/testsuite/gdc.test/compilable/b20938.d b/gcc/testsuite/gdc.test/compilable/b20938.d
index efcf4aab06f..ba3565ae8f9 100644
--- a/gcc/testsuite/gdc.test/compilable/b20938.d
+++ b/gcc/testsuite/gdc.test/compilable/b20938.d
@@ -12,11 +12,11 @@ void fun() {
immutable S _is;
Object o;
immutable Object io;
-
+
auto a = [pi, ipi];
- auto b = [ai, iai];
+ auto b = [ai, iai];
auto c = [s, _is];
auto d = [o, io];
-
+
auto e = [A.a, B.b];
}
diff --git a/gcc/testsuite/gdc.test/compilable/b21285.d b/gcc/testsuite/gdc.test/compilable/b21285.d
index 11eea74b669..482faa77f0d 100644
--- a/gcc/testsuite/gdc.test/compilable/b21285.d
+++ b/gcc/testsuite/gdc.test/compilable/b21285.d
@@ -1,27 +1,27 @@
// REQUIRED_ARGS: -unittest
-// Issue 21285 - Delegate covariance broken between 2.092 and 2.094 (git master).
+// Issue 21285 - Delegate covariance broken between 2.092 and 2.094 (git master).
unittest
{
string path;
int bank;
static string path2;
static int bank2;
-
+
// delegates
auto a = [
(string arg) { path = arg; },
(string arg) { bank = 1; throw new Exception(""); }
];
-
+
// functions
auto ab = [
(string arg) { path2 = arg; },
(string arg) { bank2 = 1; throw new Exception(""); }
];
-
+
alias dg = void delegate(string) pure @safe;
alias fn = void function(string) @safe;
-
+
static assert(is(typeof(a[0]) == dg));
static assert(is(typeof(ab[0]) == fn));
}
diff --git a/gcc/testsuite/gdc.test/compilable/commontype.d b/gcc/testsuite/gdc.test/compilable/commontype.d
index 076e29baece..a740994d7b5 100644
--- a/gcc/testsuite/gdc.test/compilable/commontype.d
+++ b/gcc/testsuite/gdc.test/compilable/commontype.d
@@ -196,7 +196,8 @@ static assert(is( X!( C***, B*** ) == const(B**)* )); // `B***`
static assert(is( X!( C*, I* ) == I* ));
static assert(is( X!( I*, C* ) == I* ));
-static assert(Error!( C**, I** ));
+//static assert(Error!( C**, I** ));
+static assert(is( X!( C**, I** ) == const(I*)* ));
static assert(Error!( C*, D* )); // should work
@@ -303,13 +304,15 @@ static assert(is( X!(C[4], B[4]) ));
static assert(Error!( C[4], I[4] ));
static assert(Error!( C[4], D[4] ));
static assert(is( X!( C[4], const(B)[4] ) == const(B)[4] ));
-static assert(Error!( C[4], const(I)[4] ));
+//static assert(Error!( C[4], const(I)[4] ));
+static assert(is( X!( C[4], const(I)[4] ) == const(I)[] ));
static assert(Error!( C[4], const(D)[4] ));
static assert(Error!( C*[4], B*[4] ));
static assert(Error!( C*[4], I*[4] ));
static assert(Error!( C*[4], D*[4] ));
static assert(is( X!( C*[4], const(B*)[4] ) == const(B*)[] )); // !?
-static assert(Error!( C*[4], const(I*)[4] ));
+//static assert(Error!( C*[4], const(I*)[4] ));
+static assert(is( X!( C*[4], const(I*)[4] ) == const(I*)[] ));
static assert(Error!( C*[4], const(D*)[4] ));
static assert(Error!( C*[4], B**[4] ));
static assert(Error!( C*[4], const(B*)*[4] ));
diff --git a/gcc/testsuite/gdc.test/compilable/ddoc10.d b/gcc/testsuite/gdc.test/compilable/ddoc10.d
index 6a7a4812c60..2f614095a8e 100644
--- a/gcc/testsuite/gdc.test/compilable/ddoc10.d
+++ b/gcc/testsuite/gdc.test/compilable/ddoc10.d
@@ -171,7 +171,7 @@ struct T
/****
*/
this(A...)(A args) { }
-
+
///
this(int){}
}
diff --git a/gcc/testsuite/gdc.test/compilable/ddoc11.d b/gcc/testsuite/gdc.test/compilable/ddoc11.d
index 3fcf2ca00da..0082455d0ae 100644
--- a/gcc/testsuite/gdc.test/compilable/ddoc11.d
+++ b/gcc/testsuite/gdc.test/compilable/ddoc11.d
@@ -49,7 +49,7 @@ struct lldiv_t { long quot,rem; }
- void *calloc(size_t, size_t); ///
+ void *calloc(size_t, size_t); ///
void *malloc(size_t); /// dittx
/**
diff --git a/gcc/testsuite/gdc.test/compilable/ddoc14.d b/gcc/testsuite/gdc.test/compilable/ddoc14.d
index a8b6d4d9d4c..fae99d401f1 100644
--- a/gcc/testsuite/gdc.test/compilable/ddoc14.d
+++ b/gcc/testsuite/gdc.test/compilable/ddoc14.d
@@ -77,7 +77,7 @@ interface Interface {
V mColon(lazy P p) ; /// 10
}
+/
-
+
public P variable; /// 0
V mNone(lazy P p) {} /// 1
pure nothrow V mPrefix(lazy P p) {} /// 2
diff --git a/gcc/testsuite/gdc.test/compilable/ddoc3.d b/gcc/testsuite/gdc.test/compilable/ddoc3.d
index 1bcae411232..3b47497a1a7 100644
--- a/gcc/testsuite/gdc.test/compilable/ddoc3.d
+++ b/gcc/testsuite/gdc.test/compilable/ddoc3.d
@@ -42,7 +42,7 @@
* $(TROW 4, 5, 6)
* )
*
- * $(D_CODE
+ * $(D_CODE
$(B pragma)( $(I name) );
$(B pragma)( $(I name) , $(I option) [ $(I option) ] );
$(U $(LPAREN))
diff --git a/gcc/testsuite/gdc.test/compilable/ddoc5.d b/gcc/testsuite/gdc.test/compilable/ddoc5.d
index 4ddc123b064..5a964f3dc65 100644
--- a/gcc/testsuite/gdc.test/compilable/ddoc5.d
+++ b/gcc/testsuite/gdc.test/compilable/ddoc5.d
@@ -15,10 +15,10 @@ class TestMembers(TemplateArg)
public:
/**
- a static method
+ a static method
Params: idx = index
-
+
*/
static void PublicStaticMethod(int idx)
{
diff --git a/gcc/testsuite/gdc.test/compilable/ddoc5446.d b/gcc/testsuite/gdc.test/compilable/ddoc5446.d
index 0596088b2e6..29cb8c9cefd 100644
--- a/gcc/testsuite/gdc.test/compilable/ddoc5446.d
+++ b/gcc/testsuite/gdc.test/compilable/ddoc5446.d
@@ -30,41 +30,41 @@ struct Bar
{
/** */
alias A_Foo Bar_A_Foo;
-
+
/** */
alias A_Foo_Alias Bar_A_Foo_Alias;
-
+
/** */
alias A_Int Bar_A_Int;
-
+
/** */
alias This_Foo Bar_This_Foo;
-
+
/** */
alias This_Foo_Alias Bar_This_Foo_Alias;
-
+
/** */
alias This_Int Bar_This_Int;
-
+
/** */
alias Nested Nested_Alias;
-
+
/** */
alias .Nested Fake_Nested;
-
+
/** */
struct Nested
{
/** */
alias Bar Bar_Nested_Bar_Alias;
-
+
/** */
alias .Bar Bar_Alias;
-
+
/** */
struct Bar
{
-
+
}
}
}
diff --git a/gcc/testsuite/gdc.test/compilable/ddoc9155.d b/gcc/testsuite/gdc.test/compilable/ddoc9155.d
index 9f5a59a434c..e03d422041b 100644
--- a/gcc/testsuite/gdc.test/compilable/ddoc9155.d
+++ b/gcc/testsuite/gdc.test/compilable/ddoc9155.d
@@ -12,12 +12,12 @@ module ddoc9155;
+ ---
+ import std.stdio; //&
+ writeln("Hello world!");
- + if (test) {
+ + if (test) {
+ writefln("D programming language");
+ }
+
+ algorithm;
- +
+ +
+ xxx; //comment
+ yyy;
+ /* test
@@ -28,7 +28,7 @@ module ddoc9155;
+File f = File("./text.txt", "r");
+uint line = 0;
+ // The ElementType of data is not aggregation type
- +foreach (encoded; Base64.encoder(data))
+ +foreach (encoded; Base64.encoder(data))
+ ---
+/
@@ -45,12 +45,12 @@ module ddoc9155;
* ---
* import std.stdio; //&
* writeln("Hello world!");
- * if (test) {
+ * if (test) {
* writefln("D programming language");
* }
*
* algorithm;
- *
+ *
* xxx; //comment
* yyy;
* /+ test
diff --git a/gcc/testsuite/gdc.test/compilable/debugInference.d b/gcc/testsuite/gdc.test/compilable/debugInference.d
index 1d4f157d788..947d820fcac 100644
--- a/gcc/testsuite/gdc.test/compilable/debugInference.d
+++ b/gcc/testsuite/gdc.test/compilable/debugInference.d
@@ -1,9 +1,5 @@
/*
REQUIRED_ARGS: -debug
-TEST_OUTPUT:
----
-compilable/debugInference.d(35): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
----
https://issues.dlang.org/show_bug.cgi?id=20507
*/
@@ -32,7 +28,7 @@ void bar()()
auto f2Ptr = &f2;
S s;
- delete s;
+ destroy(s);
int* ptr = cast(int*) 0;
int[] slice = ptr[0 .. 4];
diff --git a/gcc/testsuite/gdc.test/compilable/defa.d b/gcc/testsuite/gdc.test/compilable/defa.d
index a9222074ce4..5b4e5897c1f 100644
--- a/gcc/testsuite/gdc.test/compilable/defa.d
+++ b/gcc/testsuite/gdc.test/compilable/defa.d
@@ -3,7 +3,7 @@
module defa;
private import imports.defaa;
-
+
public abstract class A
{
Display d;
diff --git a/gcc/testsuite/gdc.test/compilable/dlangui_crash.d b/gcc/testsuite/gdc.test/compilable/dlangui_crash.d
new file mode 100644
index 00000000000..36617f544c4
--- /dev/null
+++ b/gcc/testsuite/gdc.test/compilable/dlangui_crash.d
@@ -0,0 +1,34 @@
+// https://issues.dlang.org/show_bug.cgi?id=22365
+
+class DrawableCache
+{
+ Ref _nullDrawable;
+
+ this()
+ {
+ debug Log;
+ }
+}
+
+class DrawableCacheEmpty
+{
+ Ref _nullDrawable;
+
+ this() {}
+}
+
+struct Ref
+{
+
+ ~this()
+ {
+ }
+}
+
+void foo()
+{
+ try
+ debug Log;
+ catch (Exception)
+ assert(false);
+}
diff --git a/gcc/testsuite/gdc.test/compilable/enumbasearithmetic.d b/gcc/testsuite/gdc.test/compilable/enumbasearithmetic.d
new file mode 100644
index 00000000000..4dbc56da476
--- /dev/null
+++ b/gcc/testsuite/gdc.test/compilable/enumbasearithmetic.d
@@ -0,0 +1,20 @@
+//https://issues.dlang.org/show_bug.cgi?id=20777
+struct FooInt
+{
+ int i;
+ auto opBinary(string op : "+")(int j)
+ {
+ return typeof(this)(i + j);
+ }
+
+ static @property FooInt max()
+ {
+ return typeof(this)(int.max);
+ }
+}
+
+enum foolist
+{
+ hi = FooInt(0),
+ bye
+}
diff --git a/gcc/testsuite/gdc.test/compilable/header18364.d b/gcc/testsuite/gdc.test/compilable/header18364.d
index c7e1e67c7ae..080a0960a14 100644
--- a/gcc/testsuite/gdc.test/compilable/header18364.d
+++ b/gcc/testsuite/gdc.test/compilable/header18364.d
@@ -8,7 +8,7 @@ TEST_OUTPUT:
=== ${RESULTS_DIR}/compilable/header18364.di
// D import file generated from 'compilable/header18364.d'
module foo.bar.ba;
-nothrow pure @nogc @safe package(foo)
+nothrow pure @nogc @safe package(foo)
{
void foo();
nothrow pure @nogc @safe package(foo.bar) void foo2();
diff --git a/gcc/testsuite/gdc.test/compilable/imports/b33a.d b/gcc/testsuite/gdc.test/compilable/imports/b33a.d
index 5d52c66ceec..bd8fd0c2664 100644
--- a/gcc/testsuite/gdc.test/compilable/imports/b33a.d
+++ b/gcc/testsuite/gdc.test/compilable/imports/b33a.d
@@ -6,10 +6,10 @@ struct IsEqual( T )
{
return p1 == p2;
}
-}
+}
template find_( Elem, Pred = IsEqual!(Elem) )
-{
+{
size_t fn( char[] buf, Pred pred = Pred.init )
{
return 3;
diff --git a/gcc/testsuite/gdc.test/compilable/imports/imp22734.c b/gcc/testsuite/gdc.test/compilable/imports/imp22734.c
new file mode 100644
index 00000000000..9df542b5e0f
--- /dev/null
+++ b/gcc/testsuite/gdc.test/compilable/imports/imp22734.c
@@ -0,0 +1,3 @@
+typedef enum { C } E;
+
+int a = C;
diff --git a/gcc/testsuite/gdc.test/compilable/imports/test22714a.d b/gcc/testsuite/gdc.test/compilable/imports/test22714a.d
new file mode 100644
index 00000000000..7b77272a51b
--- /dev/null
+++ b/gcc/testsuite/gdc.test/compilable/imports/test22714a.d
@@ -0,0 +1,3 @@
+module imports.test22714a;
+import imports.test22714b;
+class Statement {}
diff --git a/gcc/testsuite/gdc.test/compilable/imports/test22714b.d b/gcc/testsuite/gdc.test/compilable/imports/test22714b.d
new file mode 100644
index 00000000000..68bd95b1674
--- /dev/null
+++ b/gcc/testsuite/gdc.test/compilable/imports/test22714b.d
@@ -0,0 +1,12 @@
+module imports.test22714b;
+import imports.test22714a;
+struct Array(T)
+{
+ T[] data;
+ T[1] smallarray;
+}
+struct Ensure
+{
+ Statement ensure;
+ Array!Ensure* arraySyntaxCopy;
+}
diff --git a/gcc/testsuite/gdc.test/compilable/issue16472.d b/gcc/testsuite/gdc.test/compilable/issue16472.d
new file mode 100644
index 00000000000..a4353cee936
--- /dev/null
+++ b/gcc/testsuite/gdc.test/compilable/issue16472.d
@@ -0,0 +1,42 @@
+// https://issues.dlang.org/show_bug.cgi?id=16472
+enum e() = 0;
+
+template t(alias v = e!()) {} //Error
+alias dummy = t!(e!());
+
+template E(F){
+ enum E {
+ K = F(1)
+ }
+}
+
+struct S(F = float, alias e_ = E!double.K) {}
+S!float x; // Error: E!double.K is used as a type
+
+alias T = E!double.K;
+struct S2(F = float, alias e_ = T) {}
+S2!float y; // alias makes it okay...
+
+struct S3(F = float, alias e_ = (E!double.K)) {}
+S3!float z; // just putting parens make it okay as well... wat!?
+
+// for coverage
+
+template G(T)
+{
+ struct G
+ {
+ alias I = int;
+ static int i;
+ }
+}
+
+struct H(F = float, alias e_ = G!double) {}
+H!float a;
+
+struct H1(F = float, alias e_ = G!double.I) {}
+H1!float b;
+
+// https://issues.dlang.org/show_bug.cgi?id=21795
+// struct H2(F = float, alias e_ = G!double.i) {}
+// H2!float c;
diff --git a/gcc/testsuite/gdc.test/compilable/issue21340.d b/gcc/testsuite/gdc.test/compilable/issue21340.d
index 22eda6e3e02..03d37bdc61a 100644
--- a/gcc/testsuite/gdc.test/compilable/issue21340.d
+++ b/gcc/testsuite/gdc.test/compilable/issue21340.d
@@ -5,7 +5,7 @@ version (CppRuntime_Sun) version = CppMangle_Itanium;
template ScopeClass(C)
if (is(C == class) && __traits(getLinkage, C) == "C++")
{
-
+
extern(C++, class)
extern(C++, __traits(getCppNamespaces,C))
extern(C++, (ns))
@@ -35,4 +35,4 @@ alias ns = AliasSeq!();
immutable ns2 = AliasSeq!();
extern(C++,(ns)) class Bar {}
extern(C++,) class Baz {}
-extern(C++, (ns2)) class Quux {}
+extern(C++, (ns2)) class Quux {}
diff --git a/gcc/testsuite/gdc.test/compilable/issue21813b.d b/gcc/testsuite/gdc.test/compilable/issue21813b.d
index ef226971d87..0af986b34a6 100644
--- a/gcc/testsuite/gdc.test/compilable/issue21813b.d
+++ b/gcc/testsuite/gdc.test/compilable/issue21813b.d
@@ -4,7 +4,7 @@ Target.OS defaultTargetOS()
return Target.OS.linux;
}
-struct Target
+struct Target
{
enum OS { linux }
OS os = defaultTargetOS();
diff --git a/gcc/testsuite/gdc.test/compilable/minimal.d b/gcc/testsuite/gdc.test/compilable/minimal.d
index 63983288f30..155f0edb618 100644
--- a/gcc/testsuite/gdc.test/compilable/minimal.d
+++ b/gcc/testsuite/gdc.test/compilable/minimal.d
@@ -10,7 +10,7 @@
struct S { }
-enum E
+enum E
{
e0 = 0,
e1 = 1
diff --git a/gcc/testsuite/gdc.test/compilable/test10993.d b/gcc/testsuite/gdc.test/compilable/test10993.d
index a69d0c616cf..9a99187aa06 100644
--- a/gcc/testsuite/gdc.test/compilable/test10993.d
+++ b/gcc/testsuite/gdc.test/compilable/test10993.d
@@ -19,7 +19,7 @@ auto fun()
{
auto x = foo!()(test!(a=>a)());
// pragma(msg, "fun: " ~ typeof(x).mangleof);
-
+
return x;
}
diff --git a/gcc/testsuite/gdc.test/compilable/test16107.d b/gcc/testsuite/gdc.test/compilable/test16107.d
index 2267be3339f..3de4dd13c4b 100644
--- a/gcc/testsuite/gdc.test/compilable/test16107.d
+++ b/gcc/testsuite/gdc.test/compilable/test16107.d
@@ -3,12 +3,12 @@
bool check()
{
bool result = false;
-
+
result |= false;
if (result) goto ret;
-
+
result |= false;
if (result) {}
-
+
ret: return true;
}
diff --git a/gcc/testsuite/gdc.test/compilable/test17545.d b/gcc/testsuite/gdc.test/compilable/test17545.d
index bb0c2ae9ace..6285418b806 100644
--- a/gcc/testsuite/gdc.test/compilable/test17545.d
+++ b/gcc/testsuite/gdc.test/compilable/test17545.d
@@ -12,5 +12,5 @@ struct Attrib {}
@Attrib enum TEST = 123;
-pragma(msg, __traits(getAttributes,
+pragma(msg, __traits(getAttributes,
__traits(getMember, example, "TEST")));
diff --git a/gcc/testsuite/gdc.test/compilable/test17906.d b/gcc/testsuite/gdc.test/compilable/test17906.d
deleted file mode 100644
index 9c4a547a3e7..00000000000
--- a/gcc/testsuite/gdc.test/compilable/test17906.d
+++ /dev/null
@@ -1,7 +0,0 @@
-// REQUIRED_ARGS: -de
-// https://issues.dlang.org/show_bug.cgi?id=18647
-deprecated void main ()
-{
- Object o = new Object;
- delete o;
-}
diff --git a/gcc/testsuite/gdc.test/compilable/test18030.d b/gcc/testsuite/gdc.test/compilable/test18030.d
index f742a401afb..37f8630d2b1 100644
--- a/gcc/testsuite/gdc.test/compilable/test18030.d
+++ b/gcc/testsuite/gdc.test/compilable/test18030.d
@@ -9,6 +9,6 @@ struct S(T)
class C
{
alias Al = S!C;
-
+
static void func(U)(U var) { }
}
diff --git a/gcc/testsuite/gdc.test/compilable/test19014.d b/gcc/testsuite/gdc.test/compilable/test19014.d
index 7bbbc941abe..1110b28faeb 100644
--- a/gcc/testsuite/gdc.test/compilable/test19014.d
+++ b/gcc/testsuite/gdc.test/compilable/test19014.d
@@ -8,5 +8,5 @@ void main()
{
static import core.stdc.math;
}
- static assert(!__traits(compiles, core.stdc.math.cos(0)));
+ static assert(!__traits(compiles, core.stdc.math.cos(0)));
}
diff --git a/gcc/testsuite/gdc.test/compilable/test19315.d b/gcc/testsuite/gdc.test/compilable/test19315.d
index 0c31ab84341..e95ecace07a 100644
--- a/gcc/testsuite/gdc.test/compilable/test19315.d
+++ b/gcc/testsuite/gdc.test/compilable/test19315.d
@@ -1,5 +1,5 @@
//https://issues.dlang.org/show_bug.cgi?id=19315
-void main()
+void main()
{
#line 100 "file.d"
enum code = q{
diff --git a/gcc/testsuite/gdc.test/compilable/test19557.d b/gcc/testsuite/gdc.test/compilable/test19557.d
index f107e228a48..b11ae1095cd 100644
--- a/gcc/testsuite/gdc.test/compilable/test19557.d
+++ b/gcc/testsuite/gdc.test/compilable/test19557.d
@@ -1,6 +1,6 @@
// https://issues.dlang.org/show_bug.cgi?id=19557
// Error: redundant linkage `extern (C++)`
-
+
extern(C++, "ns")
extern(C++, class)
struct test {}
diff --git a/gcc/testsuite/gdc.test/compilable/test19609.d b/gcc/testsuite/gdc.test/compilable/test19609.d
index 4367df153b7..df8f891ec8f 100644
--- a/gcc/testsuite/gdc.test/compilable/test19609.d
+++ b/gcc/testsuite/gdc.test/compilable/test19609.d
@@ -3,9 +3,9 @@
/*
TEST_OUTPUT:
---
-compilable/test19609.d(11): Deprecation: module `imports.test19609a` is deprecated -
+compilable/test19609.d(11): Deprecation: module `imports.test19609a` is deprecated
compilable/test19609.d(12): Deprecation: module `imports.test19609b` is deprecated - hello
-compilable/test19609.d(13): Deprecation: module `imports.test19609c` is deprecated -
+compilable/test19609.d(13): Deprecation: module `imports.test19609c` is deprecated
---
*/
import imports.test19609a;
diff --git a/gcc/testsuite/gdc.test/compilable/test21177.d b/gcc/testsuite/gdc.test/compilable/test21177.d
new file mode 100644
index 00000000000..b3b613bc0e9
--- /dev/null
+++ b/gcc/testsuite/gdc.test/compilable/test21177.d
@@ -0,0 +1,76 @@
+// https://issues.dlang.org/show_bug.cgi?id=21177
+/*
+DISABLED: win
+TEST_OUTPUT:
+---
+compilable/test21177.d(103): Deprecation: more format specifiers than 0 arguments
+compilable/test21177.d(150): Deprecation: more format specifiers than 0 arguments
+compilable/test21177.d(151): Deprecation: more format specifiers than 0 arguments
+compilable/test21177.d(152): Deprecation: more format specifiers than 0 arguments
+compilable/test21177.d(153): Deprecation: more format specifiers than 0 arguments
+compilable/test21177.d(200): Deprecation: more format specifiers than 0 arguments
+compilable/test21177.d(203): Deprecation: format specifier `"%m"` is invalid
+compilable/test21177.d(204): Deprecation: format specifier `"%m"` is invalid
+compilable/test21177.d(205): Deprecation: argument `c` for format specification `"%a"` must be `float*`, not `char*`
+compilable/test21177.d(206): Deprecation: argument `c` for format specification `"%a"` must be `float*`, not `char*`
+---
+*/
+
+import core.stdc.stdio;
+import core.stdc.string;
+import core.stdc.stdlib;
+
+void main()
+{
+ version (CRuntime_Glibc)
+ {
+ #line 100
+ printf("%m this is a string in errno");
+ printf("%s %m", "str".ptr, 2);
+ printf("%a", 2.);
+ printf("%m %m %s");
+ printf("%*m");
+
+ char* a, b;
+ sscanf("salut poilu", "%a %m", a, b);
+ assert(!strcmp(a, b));
+ free(a);
+ free(b);
+
+ char* t, p;
+ sscanf("Tomate Patate", "%ms %as", t, p);
+ free(t);
+ free(p);
+
+ #line 150
+ sscanf("150", "%m");
+ sscanf("151", "%ms");
+ sscanf("152", "%a");
+ sscanf("153", "%as");
+
+ pragma(msg, "compilable/test21177.d(200): Deprecation: more format specifiers than 0 arguments");
+ pragma(msg, "compilable/test21177.d(203): Deprecation: format specifier `\"%m\"` is invalid");
+ pragma(msg, "compilable/test21177.d(204): Deprecation: format specifier `\"%m\"` is invalid");
+ pragma(msg, "compilable/test21177.d(205): Deprecation: argument `c` for format specification `\"%a\"` must be `float*`, not `char*`");
+ pragma(msg, "compilable/test21177.d(206): Deprecation: argument `c` for format specification `\"%a\"` must be `float*`, not `char*`");
+ }
+ else
+ {
+ // fake it
+ pragma(msg, "compilable/test21177.d(103): Deprecation: more format specifiers than 0 arguments");
+ pragma(msg, "compilable/test21177.d(150): Deprecation: more format specifiers than 0 arguments");
+ pragma(msg, "compilable/test21177.d(151): Deprecation: more format specifiers than 0 arguments");
+ pragma(msg, "compilable/test21177.d(152): Deprecation: more format specifiers than 0 arguments");
+ pragma(msg, "compilable/test21177.d(153): Deprecation: more format specifiers than 0 arguments");
+
+ #line 200
+ printf("%m");
+
+ char* c;
+ sscanf("204", "%m", c);
+ sscanf("205", "%ms", c);
+ sscanf("206", "%a", c);
+ sscanf("207", "%as", c);
+
+ }
+}
diff --git a/gcc/testsuite/gdc.test/compilable/test21196.d b/gcc/testsuite/gdc.test/compilable/test21196.d
new file mode 100644
index 00000000000..f8507b434f2
--- /dev/null
+++ b/gcc/testsuite/gdc.test/compilable/test21196.d
@@ -0,0 +1,71 @@
+// https://issues.dlang.org/show_bug.cgi?id=21674
+// REQUIRED_ARGS: -de
+
+struct Module
+{
+ CachedString data;
+}
+
+struct CachedString
+{
+ private size_t len;
+
+ this (string data) { this.len = data.length; }
+ public string str () const { return null; }
+ public void str (string value) { this.len = value.length; }
+
+ alias str this;
+}
+
+void test21674a()
+{
+ Module m;
+ m.data = "Hello World";
+}
+
+//////////////////////////////////////////
+
+struct StaticGetter(T)
+{
+ private static T _impl;
+ static ref T value() { return _impl; }
+ alias value this;
+}
+
+struct StaticWrapper
+{
+ StaticGetter!int get;
+ alias get this;
+}
+
+void test21674b()
+{
+ StaticGetter!float sg;
+ sg = 4.2;
+
+ StaticWrapper sw;
+ sw = 42;
+}
+
+//////////////////////////////////////////
+
+EntryType arr;
+auto getPtr() { return &arr; }
+
+struct EntryType
+{
+ bool _state;
+ alias _state this;
+}
+
+struct S19441
+{
+ @property auto ref entry() { return *getPtr(); }
+ alias entry this;
+}
+
+void test19441()
+{
+ S19441 s19441;
+ s19441 = true;
+}
diff --git a/gcc/testsuite/gdc.test/compilable/test22224.d b/gcc/testsuite/gdc.test/compilable/test22224.d
index d16b2f4023d..ef131e998c3 100644
--- a/gcc/testsuite/gdc.test/compilable/test22224.d
+++ b/gcc/testsuite/gdc.test/compilable/test22224.d
@@ -1,4 +1,4 @@
// REQUIRED_ARGS: -profile -c
-import core.stdc.stdarg;
+import core.stdc.stdarg;
void error(...) { }
diff --git a/gcc/testsuite/gdc.test/compilable/test22632.d b/gcc/testsuite/gdc.test/compilable/test22632.d
new file mode 100644
index 00000000000..673b51b00f0
--- /dev/null
+++ b/gcc/testsuite/gdc.test/compilable/test22632.d
@@ -0,0 +1,4 @@
+// https://issues.dlang.org/show_bug.cgi?id=22632
+
+static assert(["one": 1] != null);
+static assert(null != ["one": 1]);
diff --git a/gcc/testsuite/gdc.test/compilable/test22714.d b/gcc/testsuite/gdc.test/compilable/test22714.d
new file mode 100644
index 00000000000..2973e1d0c27
--- /dev/null
+++ b/gcc/testsuite/gdc.test/compilable/test22714.d
@@ -0,0 +1,3 @@
+// EXTRA_FILES: imports/test22714a.d imports/test22714b.d
+// https://issues.dlang.org/show_bug.cgi?id=22714
+import imports.test22714a;
diff --git a/gcc/testsuite/gdc.test/compilable/test22734.d b/gcc/testsuite/gdc.test/compilable/test22734.d
new file mode 100644
index 00000000000..fdd962eedb4
--- /dev/null
+++ b/gcc/testsuite/gdc.test/compilable/test22734.d
@@ -0,0 +1,6 @@
+// https://issues.dlang.org/show_bug.cgi?id=22734
+// EXTRA_FILES: imports/imp22734.c
+
+import imports.imp22734;
+
+auto dc = C;
diff --git a/gcc/testsuite/gdc.test/compilable/test4375.d b/gcc/testsuite/gdc.test/compilable/test4375.d
index f5c4e4a9b40..1cc7a3a1c2e 100644
--- a/gcc/testsuite/gdc.test/compilable/test4375.d
+++ b/gcc/testsuite/gdc.test/compilable/test4375.d
@@ -256,7 +256,7 @@ label1:
else
assert(89);
else
- assert(12);
+ assert(12);
with (x)
@@ -299,7 +299,7 @@ label1:
if (true)
assert(110);
else
- assert(112);
+ assert(112);
finally
assert(111);
@@ -316,7 +316,7 @@ label1:
int w;
static if (true)
- int t;
+ int t;
else static if (false)
int u;
else
diff --git a/gcc/testsuite/gdc.test/compilable/test7172.d b/gcc/testsuite/gdc.test/compilable/test7172.d
index 859f29a13e5..a4cf663066e 100644
--- a/gcc/testsuite/gdc.test/compilable/test7172.d
+++ b/gcc/testsuite/gdc.test/compilable/test7172.d
@@ -7,7 +7,7 @@ void main()
static assert(!__traits(compiles, { class D : FinalC{} }));
scope class ScopeC{}
-// static assert(!__traits(compiles, { auto sc = new ScopeC(); }));
+ static assert(!__traits(compiles, { auto sc = new ScopeC(); }));
static assert( __traits(compiles, { scope sc = new ScopeC(); }));
synchronized class SyncC{ void f(){} }
diff --git a/gcc/testsuite/gdc.test/compilable/test8296.d b/gcc/testsuite/gdc.test/compilable/test8296.d
index d27ba15f3e0..cd175b55322 100644
--- a/gcc/testsuite/gdc.test/compilable/test8296.d
+++ b/gcc/testsuite/gdc.test/compilable/test8296.d
@@ -10,7 +10,7 @@ struct bar2
class InnerBar {
bar2 b;
-
+
this()
{
b = bar2(0);
@@ -21,7 +21,7 @@ struct bar1
{
InnerBar b;
}
-
+
class Foo
{
bar1 m_bar1;
diff --git a/gcc/testsuite/gdc.test/compilable/test8513.d b/gcc/testsuite/gdc.test/compilable/test8513.d
index bcdc657be93..4b5d5120502 100644
--- a/gcc/testsuite/gdc.test/compilable/test8513.d
+++ b/gcc/testsuite/gdc.test/compilable/test8513.d
@@ -5,25 +5,25 @@ class Bar
{
interface I_Foo { void i_inner(); }
class C_Foo { void c_inner() { } }
-
+
class Impl1 : C_Foo, I_Foo
{
override void i_inner() { }
override void c_inner() { }
}
-
+
class Impl2 : C_Foo, .I_Foo
{
override void i_outer() { }
override void c_inner() { }
}
-
+
class Impl3 : .C_Foo, I_Foo
{
override void i_inner() { }
override void c_outer() { }
}
-
+
class Impl4 : .C_Foo, .I_Foo
{
override void i_outer() { }
diff --git a/gcc/testsuite/gdc.test/compilable/testpostblit.d b/gcc/testsuite/gdc.test/compilable/testpostblit.d
index 60a0f4a1ce9..dff4bc59eb9 100644
--- a/gcc/testsuite/gdc.test/compilable/testpostblit.d
+++ b/gcc/testsuite/gdc.test/compilable/testpostblit.d
@@ -14,4 +14,4 @@ struct Test1c
{
const Test1b b;
@disable this(this);
-}
+}
diff --git a/gcc/testsuite/gdc.test/compilable/testsctreturn.d b/gcc/testsuite/gdc.test/compilable/testsctreturn.d
index 96b82da922f..7826cd4894d 100644
--- a/gcc/testsuite/gdc.test/compilable/testsctreturn.d
+++ b/gcc/testsuite/gdc.test/compilable/testsctreturn.d
@@ -17,3 +17,19 @@ void test()
size_t* p;
const ppi = const(PackedPtrImpl!(3))(p);
}
+
+/************************************************/
+
+// issues.dlang.org/show_bug.cgi?id=22541
+
+struct S
+{
+ int i;
+ int* ptr;
+
+ int* wannabeReturnRef() scope return
+ {
+ return &i;
+ }
+}
+
diff --git a/gcc/testsuite/gdc.test/compilable/typeid_name.d b/gcc/testsuite/gdc.test/compilable/typeid_name.d
index e77d5c80a75..b2292bf60d7 100644
--- a/gcc/testsuite/gdc.test/compilable/typeid_name.d
+++ b/gcc/testsuite/gdc.test/compilable/typeid_name.d
@@ -9,6 +9,6 @@ class Panzer {}
class Tiger : Panzer {}
static assert (() {
- Panzer p = new Tiger(); return classname(p);
+ Panzer p = new Tiger(); return classname(p);
} () == "Tiger");
diff --git a/gcc/testsuite/gdc.test/compilable/vgc1.d b/gcc/testsuite/gdc.test/compilable/vgc1.d
index 8a11657ac3d..8bfe1d079e2 100644
--- a/gcc/testsuite/gdc.test/compilable/vgc1.d
+++ b/gcc/testsuite/gdc.test/compilable/vgc1.d
@@ -65,20 +65,9 @@ void testNewScope()
/***************** DeleteExp *******************/
-/*
-TEST_OUTPUT:
----
-compilable/vgc1.d(81): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
-compilable/vgc1.d(81): vgc: `delete` requires the GC
-compilable/vgc1.d(82): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
-compilable/vgc1.d(82): vgc: `delete` requires the GC
-compilable/vgc1.d(83): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
-compilable/vgc1.d(83): vgc: `delete` requires the GC
----
-*/
void testDelete(int* p, Object o, S1* s)
{
- delete p;
- delete o;
- delete s;
+ destroy(p);
+ destroy(o);
+ destroy(s);
}