]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/testsuite/gdc.test/runnable_cxx/extra-files/externmangle.cpp
d: Import dmd b8384668f, druntime e6caaab9, phobos 5ab9ad256 (v2.098.0-beta.1)
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / runnable_cxx / extra-files / externmangle.cpp
index da3e8449b2efa03790663c222321b0c51408f0c6..37c98ea8fdd3881f1779e6ba1de2ae57646422e3 100644 (file)
@@ -1,3 +1,4 @@
+#include <stddef.h>
 #include <stdint.h>
 
 template<class X>
@@ -194,17 +195,25 @@ int Module::dim(Array<Module*>* arr)
     return arr->dim;
 }
 
-#if _LP64
-unsigned long testlongmangle(int32_t a, uint32_t b, long c, unsigned long d)
+uint64_t testlongmangle(int a, unsigned int b, int64_t c, uint64_t d)
 {
     return a + b + c + d;
 }
-#else
-unsigned long long testlongmangle(int a, unsigned int b, long long c, unsigned long long d)
+
+unsigned long testCppLongMangle(long a, unsigned long b)
 {
-    return a + b + c + d;
+    return a + b;
+}
+
+unsigned long long testCppLongLongMangle(long long a, unsigned long long b)
+{
+    return a + b;
+}
+
+size_t testCppSizeTMangle(ptrdiff_t a, size_t b)
+{
+    return a + b;
 }
-#endif
 
 int test31[2][2][2] = {1, 1, 1, 1, 1, 1, 1, 1};
 int *test32 = 0;
@@ -401,4 +410,40 @@ int test39cpp(C2<char>* c2, S2<int>* s2)
     if (s2->value() != otherS2->value())
         return 2;
     return 0;
-}
\ No newline at end of file
+}
+
+namespace foo
+{
+    namespace bar
+    {
+        namespace baz
+        {
+            int doStuff(int i)
+            {
+                return i * 2;
+            }
+        }
+    }
+}
+
+#ifndef __DMC__ // DMC doesn't support c++11
+template<typename ...T> void foovargs(T... args);
+
+void test40()
+{
+    foovargs<int, float>(1, 2.0f);
+    char c = 'a';
+    foovargs<char*>(&c);
+}
+
+template<typename T, typename ...Args>
+void make_shared_poc(Args&... args);
+
+void test41()
+{
+    int a = 1;
+    int b = 2;
+    make_shared_poc<int, int, int>(a, b);
+
+}
+#endif