aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2020-03-17 19:33:14 +0100
committerIain Buclaw <ibuclaw@gdcproject.org>2020-03-19 18:34:52 +0100
commit37482edc3f7f19110da7178d0d4c3003ea5272f3 (patch)
tree4315c56858f31991be0342d1964b064eecdddd80 /gcc/testsuite
parentf22712bd8a2ed57d3cc7e6fa92730bd5852e27b3 (diff)
downloadgcc-37482edc3f7f19110da7178d0d4c3003ea5272f3.zip
gcc-37482edc3f7f19110da7178d0d4c3003ea5272f3.tar.gz
gcc-37482edc3f7f19110da7178d0d4c3003ea5272f3.tar.bz2
d/dmd: Merge upstream dmd d1a606599
Fixes long standing regression in the D front-end implemention, and adds a new field to allow retrieving a list of all content imports from the code generator. Reviewed-on: https://github.com/dlang/dmd/pull/10913 https://github.com/dlang/dmd/pull/10933
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/gdc.test/compilable/imports/pr9471a.d2
-rw-r--r--gcc/testsuite/gdc.test/compilable/imports/pr9471b.d5
-rw-r--r--gcc/testsuite/gdc.test/compilable/imports/pr9471c.d18
-rw-r--r--gcc/testsuite/gdc.test/compilable/imports/pr9471d.d1
-rw-r--r--gcc/testsuite/gdc.test/compilable/pr9471.d6
-rw-r--r--gcc/testsuite/gdc.test/runnable/traits.d4
6 files changed, 34 insertions, 2 deletions
diff --git a/gcc/testsuite/gdc.test/compilable/imports/pr9471a.d b/gcc/testsuite/gdc.test/compilable/imports/pr9471a.d
new file mode 100644
index 0000000..79b78e1
--- /dev/null
+++ b/gcc/testsuite/gdc.test/compilable/imports/pr9471a.d
@@ -0,0 +1,2 @@
+import imports.pr9471c;
+class AggregateDeclaration : ScopeDsymbol { }
diff --git a/gcc/testsuite/gdc.test/compilable/imports/pr9471b.d b/gcc/testsuite/gdc.test/compilable/imports/pr9471b.d
new file mode 100644
index 0000000..a46a12c
--- /dev/null
+++ b/gcc/testsuite/gdc.test/compilable/imports/pr9471b.d
@@ -0,0 +1,5 @@
+import imports.pr9471a;
+class ClassDeclaration : AggregateDeclaration
+{
+ void isBaseOf();
+}
diff --git a/gcc/testsuite/gdc.test/compilable/imports/pr9471c.d b/gcc/testsuite/gdc.test/compilable/imports/pr9471c.d
new file mode 100644
index 0000000..d80a614
--- /dev/null
+++ b/gcc/testsuite/gdc.test/compilable/imports/pr9471c.d
@@ -0,0 +1,18 @@
+import imports.pr9471b;
+
+struct Array(T)
+{
+ static if (is(typeof(T.opCmp))) { }
+}
+alias ClassDeclarations = Array!ClassDeclaration;
+
+class Dsymbol
+{
+ void addObjcSymbols(ClassDeclarations);
+}
+
+class ScopeDsymbol : Dsymbol
+{
+ import imports.pr9471d;
+ void importScope();
+}
diff --git a/gcc/testsuite/gdc.test/compilable/imports/pr9471d.d b/gcc/testsuite/gdc.test/compilable/imports/pr9471d.d
new file mode 100644
index 0000000..187b908
--- /dev/null
+++ b/gcc/testsuite/gdc.test/compilable/imports/pr9471d.d
@@ -0,0 +1 @@
+// Module needs to be imported to trigger bug.
diff --git a/gcc/testsuite/gdc.test/compilable/pr9471.d b/gcc/testsuite/gdc.test/compilable/pr9471.d
new file mode 100644
index 0000000..37ff32e
--- /dev/null
+++ b/gcc/testsuite/gdc.test/compilable/pr9471.d
@@ -0,0 +1,6 @@
+// PERMUTE_ARGS:
+// EXTRA_FILES: imports/pr9471a.d imports/pr9471b.d imports/pr9471c.d imports/pr9471d.d
+import imports.pr9471a;
+import imports.pr9471b;
+
+static assert (__traits(getVirtualIndex, ClassDeclaration.isBaseOf) == 7);
diff --git a/gcc/testsuite/gdc.test/runnable/traits.d b/gcc/testsuite/gdc.test/runnable/traits.d
index 6c3bf78..b73ee01c 100644
--- a/gcc/testsuite/gdc.test/runnable/traits.d
+++ b/gcc/testsuite/gdc.test/runnable/traits.d
@@ -1253,7 +1253,7 @@ struct S10096X
this(this) {}
~this() {}
- string getStr() in(str) out(r; r == str) { return str; }
+ string getStr() in { assert(str); } out(r) { assert(r == str); } body { return str; }
}
static assert(
[__traits(allMembers, S10096X)] ==
@@ -1271,7 +1271,7 @@ class C10096X
this(int) {}
~this() {}
- string getStr() in(str) out(r; r == str) { return str;
+ string getStr() in { assert(str); } out(r) { assert(r == str); } body { return str; }
}
static assert(
[__traits(allMembers, C10096X)] ==