]> git.eshelyaron.com Git - emacs.git/commitdiff
Move tests in cedet/semantic
authorxscript <xscript@users.sourceforge.net>
Fri, 29 Apr 2011 00:32:56 +0000 (02:32 +0200)
committerEdward John Steere <edward.steere@gmail.com>
Wed, 25 Jan 2017 15:59:25 +0000 (17:59 +0200)
test/manual/cedet/cedet/semantic/tests/testsppcomplete.c [new file with mode: 0644]

diff --git a/test/manual/cedet/cedet/semantic/tests/testsppcomplete.c b/test/manual/cedet/cedet/semantic/tests/testsppcomplete.c
new file mode 100644 (file)
index 0000000..4a37e88
--- /dev/null
@@ -0,0 +1,29 @@
+/* Example provided by Hannes Janetzek */
+
+struct Test { int test; };
+
+#define BLA(_type) \
+  _type *bla = (_type*) malloc(sizeof(_type));
+
+#define BLUB(_type)                            \
+  (_type*)malloc(sizeof(_type));
+
+#define FOO(_type)                             \
+  _type *foo = BLUB(_type);
+
+#define BAR(_type)                             \
+  _type *bar = (*_type)BLUB(_type);
+
+int main(int argc, char *argv[]) {
+  BLA(Test);
+  bla->// -1-
+    ; // #1# ( "test" )
+
+  FOO(Test);
+  foo->// -2-
+    ; // #2# ( "test" )
+
+  BAR(Test);
+  bar->// -3-
+    ; // #3# ( "test" )
+}