summaryrefslogtreecommitdiffstats
path: root/soltools/cpp/Test.txt
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:06:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:06:44 +0000
commited5640d8b587fbcfed7dd7967f3de04b37a76f26 (patch)
tree7a5f7c6c9d02226d7471cb3cc8fbbf631b415303 /soltools/cpp/Test.txt
parentInitial commit. (diff)
downloadlibreoffice-ed5640d8b587fbcfed7dd7967f3de04b37a76f26.tar.xz
libreoffice-ed5640d8b587fbcfed7dd7967f3de04b37a76f26.zip
Adding upstream version 4:7.4.7.upstream/4%7.4.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'soltools/cpp/Test.txt')
-rw-r--r--soltools/cpp/Test.txt116
1 files changed, 116 insertions, 0 deletions
diff --git a/soltools/cpp/Test.txt b/soltools/cpp/Test.txt
new file mode 100644
index 000000000..484d150c1
--- /dev/null
+++ b/soltools/cpp/Test.txt
@@ -0,0 +1,116 @@
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#define ABC \
+ ggg
+
+ABC
+
+/* Standards */
+
+#define NOTHING
+NOTHING
+
+#define SYMBOL symbol
+#undef SYMBOL
+#define SYMBOL _symbol_
+
+< SYMBOL > // < _symbol_ >
+xSYMBOLx // xSYMBOLx
++SYMBOL- // +_symbol_-
+>SYMBOL< // >_symbol_<
+<SYMBOL> // <_symbol_>
+
+#define FALSE 0
+#define TRUE !FALSE
+a = x > 0 ? TRUE : FALSE // a = x > 0 ? !0 : 0
+
+#define A x
+#define B y
+#define MAC(a, b) \
+ T() { a(); return b; } // T() { x(); return y; }
+MAC(A,B);
+
+#ifdef MAC
+MAC(X,Y)
+#endif // MAC
+
+/* Recursions */
+
+#define y x
+#define x y
+x // x
+
+#define Test(a) a
+#define b Test(b)
+a = b; // a = b;
+
+#define func abc(func)
+a = func // a = abc(func)
+
+#define func1 func(abc)
+a = func1 // a = abc(func)(abc)
+
+#define args(func, args) func args
+args(t1, (args(t2, (x, y)))) // t1 (t2 (x, y))
+
+#define ARGS(a) a
+#define __ ARGS
+int foo __((int x)); // int foo (int x);
+
+/* Concatenations */
+
+#define tail _Test
+// Txt_##tail // Txt_##_Test
+
+#define z(e,f) e##_##f
+z ( abc, xyz ) // abc_xyz
+
+
+#define CAT( var ) fix##.var
+CAT( a ) // fix.a
+
+#define CAT3( class, ref ) class##ref::class##ref
+CAT3( a, b ) // ab::ab
+
+#define CAT2( var ) fix##var::fix##var
+CAT2( a ) // fixa::fixa
+
+/* Extremes */
+
+#define MAKE_X( name ) name##_Test
+#define MAKE_Y( name ) MAKE_X( name##_Sym )
+MAKE_Y( Txt ); // Txt_Sym_Test;
+
+
+/* Extensions */
+
+/*
+#ident "(c)# Test.txt"
+
+#if #machine(i386)
+# error illegal machine
+#endif
+char machine[6];
+*/
+
+/* Last bug */
+#define Cfstrcpy Cstrcpy
+#define Cstrcpy( s1, s2 ) strcpy( s1, s2 )
+
+Cfstrcpy(Par1,Par2 ) // blub( Par1, Par2 )