diff options
Diffstat (limited to 'gcc/testsuite/gdc.test/runnable/test17684.d')
-rw-r--r-- | gcc/testsuite/gdc.test/runnable/test17684.d | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/gdc.test/runnable/test17684.d b/gcc/testsuite/gdc.test/runnable/test17684.d index 4734d962810..d42baac0e16 100644 --- a/gcc/testsuite/gdc.test/runnable/test17684.d +++ b/gcc/testsuite/gdc.test/runnable/test17684.d @@ -74,6 +74,20 @@ bool boolTest(T)() assert(t == boolValue); assert(boolValue == t); + t = true; // tests inferType + auto inferredValue = t; + assert(inferredValue == true); + + t = true; // tests function argument + bool functionCall(bool test) + { + return test; + } + assert(t == functionCall(t)); + + t = true; // tests CastExp + assert(t == cast(bool)t); + t = true; return t; // tests ReturnStatement } @@ -97,6 +111,9 @@ int intTest(T)() assert(t <= 42); assert(42 >= t); + t = 42; // tests CastExp + assert(42 == cast(int)t); + // These currently don't work for properties due to https://issues.dlang.org/show_bug.cgi?id=8006 static if (!(typeid(T) is typeid(StructProperty!int)) && !(typeid(T) is typeid(ClassProperty!int))) { |