summaryrefslogtreecommitdiff
path: root/Examples/test-suite/d/preproc_constants_c_runme.1.d
diff options
context:
space:
mode:
authorDavid Nadlinger <code@klickverbot.at>2010-11-18 00:24:02 +0000
committerDavid Nadlinger <code@klickverbot.at>2010-11-18 00:24:02 +0000
commit03aefbc6e95d094a6de231e1f5264c0946e209a3 (patch)
tree94dff73a4aa3c27366f29f36712bde78317c5776 /Examples/test-suite/d/preproc_constants_c_runme.1.d
parenta355d2d46af56c655816c37f24bb59fa6bade43f (diff)
downloadswig-03aefbc6e95d094a6de231e1f5264c0946e209a3.tar.gz
Added support for the D programming languge.
It is still a bit rough around some edges, particularly with regard to multi-threading and operator overloading, and there are some documentation bits missing, but it should be fine for basic use. The test-suite should build and run fine with the current versions of DMD, LDC and Tango (at least) on Linux x86_64 and Mac OS X 10.6. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12299 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Examples/test-suite/d/preproc_constants_c_runme.1.d')
-rw-r--r--Examples/test-suite/d/preproc_constants_c_runme.1.d63
1 files changed, 63 insertions, 0 deletions
diff --git a/Examples/test-suite/d/preproc_constants_c_runme.1.d b/Examples/test-suite/d/preproc_constants_c_runme.1.d
new file mode 100644
index 000000000..f25bbfdee
--- /dev/null
+++ b/Examples/test-suite/d/preproc_constants_c_runme.1.d
@@ -0,0 +1,63 @@
+module preproc_constants_c_runme;
+
+import preproc_constants_c.preproc_constants_c;
+
+// Same as preproc_constants.i testcase, but bool types are int instead.
+void main() {
+ static assert(is(int == typeof(CONST_INT1())));
+ static assert(is(int == typeof(CONST_INT2())));
+ static assert(is(uint == typeof(CONST_UINT1())));
+ static assert(is(uint == typeof(CONST_UINT2())));
+ static assert(is(uint == typeof(CONST_UINT3())));
+ static assert(is(uint == typeof(CONST_UINT4())));
+ static assert(is(int == typeof(CONST_LONG1())));
+ static assert(is(int == typeof(CONST_LONG2())));
+ static assert(is(int == typeof(CONST_LONG3())));
+ static assert(is(int == typeof(CONST_LONG4())));
+ static assert(is(long == typeof(CONST_LLONG1())));
+ static assert(is(long == typeof(CONST_LLONG2())));
+ static assert(is(long == typeof(CONST_LLONG3())));
+ static assert(is(long == typeof(CONST_LLONG4())));
+ static assert(is(ulong == typeof(CONST_ULLONG1())));
+ static assert(is(ulong == typeof(CONST_ULLONG2())));
+ static assert(is(ulong == typeof(CONST_ULLONG3())));
+ static assert(is(ulong == typeof(CONST_ULLONG4())));
+ static assert(is(double == typeof(CONST_DOUBLE1())));
+ static assert(is(double == typeof(CONST_DOUBLE2())));
+ static assert(is(double == typeof(CONST_DOUBLE3())));
+ static assert(is(double == typeof(CONST_DOUBLE4())));
+ static assert(is(double == typeof(CONST_DOUBLE5())));
+ static assert(is(double == typeof(CONST_DOUBLE6())));
+ static assert(is(int == typeof(CONST_BOOL1())));
+ static assert(is(int == typeof(CONST_BOOL2())));
+ static assert(is(char == typeof(CONST_CHAR())));
+ static assert(is(char[] == typeof(CONST_STRING1())));
+ static assert(is(char[] == typeof(CONST_STRING2())));
+
+ static assert(is(int == typeof(INT_AND_BOOL())));
+// static assert(is(int == typeof(INT_AND_CHAR())));
+ static assert(is(int == typeof(INT_AND_INT())));
+ static assert(is(uint == typeof(INT_AND_UINT())));
+ static assert(is(int == typeof(INT_AND_LONG())));
+ static assert(is(uint == typeof(INT_AND_ULONG())));
+ static assert(is(long == typeof(INT_AND_LLONG())));
+ static assert(is(ulong == typeof(INT_AND_ULLONG())));
+ static assert(is(int == typeof(BOOL_AND_BOOL())));
+
+ static assert(is(int == typeof(EXPR_MULTIPLY())));
+ static assert(is(int == typeof(EXPR_DIVIDE())));
+ static assert(is(int == typeof(EXPR_PLUS())));
+ static assert(is(int == typeof(EXPR_MINUS())));
+ static assert(is(int == typeof(EXPR_LSHIFT())));
+ static assert(is(int == typeof(EXPR_RSHIFT())));
+ static assert(is(int == typeof(EXPR_LTE())));
+ static assert(is(int == typeof(EXPR_GTE())));
+ static assert(is(int == typeof(EXPR_INEQUALITY())));
+ static assert(is(int == typeof(EXPR_EQUALITY())));
+ static assert(is(int == typeof(EXPR_AND())));
+ static assert(is(int == typeof(EXPR_XOR())));
+ static assert(is(int == typeof(EXPR_OR())));
+ static assert(is(int == typeof(EXPR_LAND())));
+ static assert(is(int == typeof(EXPR_LOR())));
+ static assert(is(double == typeof(EXPR_CONDITIONAL())));
+}