summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/runnable/xtest47.d
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gdc.test/runnable/xtest47.d')
-rw-r--r--gcc/testsuite/gdc.test/runnable/xtest47.d67
1 files changed, 67 insertions, 0 deletions
diff --git a/gcc/testsuite/gdc.test/runnable/xtest47.d b/gcc/testsuite/gdc.test/runnable/xtest47.d
new file mode 100644
index 00000000000..42cabaf9197
--- /dev/null
+++ b/gcc/testsuite/gdc.test/runnable/xtest47.d
@@ -0,0 +1,67 @@
+// PERMUTE_ARGS: -unittest
+/* TEST_OUTPUT:
+---
+f
+toString
+toHash
+opCmp
+opEquals
+Monitor
+factory
+---
+*/
+
+import core.stdc.stdio;
+
+/***************************************************/
+
+void test3()
+{
+ version (unittest)
+ {
+ printf("unittest!\n");
+ }
+ else
+ {
+ printf("no unittest!\n");
+ }
+
+ version (assert)
+ {
+ printf("assert!\n");
+ }
+ else
+ {
+ printf("no assert!\n");
+ }
+}
+
+/***************************************************/
+// https://issues.dlang.org/show_bug.cgi?id=7983
+
+class A7983 {
+ void f() {
+ g7983(this);
+ }
+ unittest {
+ }
+}
+
+void g7983(T)(T a)
+{
+ foreach (name; __traits(allMembers, T)) {
+ pragma(msg, name);
+ static if (__traits(compiles, &__traits(getMember, a, name)))
+ {
+ }
+ }
+}
+
+/***************************************************/
+
+int main()
+{
+ test3();
+
+ return 0;
+}