add test
authorMichael Wallner <mike@php.net>
Thu, 29 Nov 2018 09:01:12 +0000 (10:01 +0100)
committerMichael Wallner <mike@php.net>
Tue, 4 Dec 2018 11:13:50 +0000 (12:13 +0100)
tests/parser/cpp004.phpt [new file with mode: 0644]
tests/parser/cpp004/builtins.psi [new file with mode: 0644]

diff --git a/tests/parser/cpp004.phpt b/tests/parser/cpp004.phpt
new file mode 100644 (file)
index 0000000..2278e23
--- /dev/null
@@ -0,0 +1,23 @@
+--TEST--
+CPP argument prescan
+--SKIPIF--
+<?php 
+extension_loaded("psi") or die("skip - need ext/psi");
+?>
+--INI--
+psi.directory={PWD}/cpp004
+--FILE--
+===TEST===
+<?php 
+var_dump(CPP_TEST0, CPP_TEST1, CPP_TEST2, CPP_TEST3, CPP_TEST4, CPP_TEST5);
+?>
+===DONE===
+--EXPECT--
+===TEST===
+int(0)
+int(1)
+int(2)
+int(3003)
+int(4004)
+int(5005)
+===DONE===
diff --git a/tests/parser/cpp004/builtins.psi b/tests/parser/cpp004/builtins.psi
new file mode 100644 (file)
index 0000000..d6cbf38
--- /dev/null
@@ -0,0 +1,10 @@
+const \CPP_TEST0 = __COUNTER__;
+const \CPP_TEST1 = __COUNTER__;
+const \CPP_TEST2 = __COUNTER__;
+
+#define a(x,y) x ## y
+#define b(x,y) a(x,y)
+#define c(x) b(x, __COUNTER__)
+const \CPP_TEST3 = c(300);
+const \CPP_TEST4 = c(400);
+const \CPP_TEST5 = c(500);