aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/compilable/parens_inc.d
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gdc.test/compilable/parens_inc.d')
-rw-r--r--gcc/testsuite/gdc.test/compilable/parens_inc.d23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/gdc.test/compilable/parens_inc.d b/gcc/testsuite/gdc.test/compilable/parens_inc.d
new file mode 100644
index 0000000..b9d11eb
--- /dev/null
+++ b/gcc/testsuite/gdc.test/compilable/parens_inc.d
@@ -0,0 +1,23 @@
+// Test UnaryExp (expr)++ parsing
+
+void main(){
+ int[2] y;
+ int *x = y.ptr;
+ *(x)++=0;
+ (*(x)--)=0;
+ (*x++)=0; // ok
+ int*[] z;
+ *(z[0])++=0; //ok
+ (y[0])--;
+ *x++=0;
+}
+
+void f()
+{
+ int b;
+ (b)++;
+ int[] a;
+ b = (a)[0]++; //ok
+ (a[0])--;
+ b = (int).init; //ok
+}