Răsfoiți Sursa

o partially applied patches from mantis #16248 by Sven Barth:
+ test cpp class renaming (compiled for linux/i386 and all darwin platforms)
* changed compilation instructions for obj/cpptcl1.cpp

git-svn-id: trunk@15239 -

Jonas Maebe 15 ani în urmă
părinte
comite
43033bacae

+ 8 - 0
.gitattributes

@@ -8375,27 +8375,33 @@ tests/test/cg/obj/beos/i386/tcext3.o -text
 tests/test/cg/obj/beos/i386/tcext4.o -text
 tests/test/cg/obj/beos/i386/tcext5.o -text
 tests/test/cg/obj/cpptcl1.cpp svneol=native#text/plain
+tests/test/cg/obj/cpptcl2.cpp svneol=native#text/plain
 tests/test/cg/obj/darwin/arm/cpptcl1.o -text
+tests/test/cg/obj/darwin/arm/cpptcl2.o -text
 tests/test/cg/obj/darwin/arm/ctest.o -text
 tests/test/cg/obj/darwin/arm/tcext3.o -text
 tests/test/cg/obj/darwin/arm/tcext4.o -text
 tests/test/cg/obj/darwin/arm/tcext5.o -text
 tests/test/cg/obj/darwin/i386/cpptcl1.o -text
+tests/test/cg/obj/darwin/i386/cpptcl2.o -text
 tests/test/cg/obj/darwin/i386/ctest.o -text
 tests/test/cg/obj/darwin/i386/tcext3.o -text
 tests/test/cg/obj/darwin/i386/tcext4.o -text
 tests/test/cg/obj/darwin/i386/tcext5.o -text
 tests/test/cg/obj/darwin/powerpc/cpptcl1.o -text
+tests/test/cg/obj/darwin/powerpc/cpptcl2.o -text
 tests/test/cg/obj/darwin/powerpc/ctest.o -text
 tests/test/cg/obj/darwin/powerpc/tcext3.o -text
 tests/test/cg/obj/darwin/powerpc/tcext4.o -text
 tests/test/cg/obj/darwin/powerpc/tcext5.o -text
 tests/test/cg/obj/darwin/powerpc64/cpptcl1.o -text
+tests/test/cg/obj/darwin/powerpc64/cpptcl2.o -text
 tests/test/cg/obj/darwin/powerpc64/ctest.o -text
 tests/test/cg/obj/darwin/powerpc64/tcext3.o -text
 tests/test/cg/obj/darwin/powerpc64/tcext4.o -text
 tests/test/cg/obj/darwin/powerpc64/tcext5.o -text
 tests/test/cg/obj/darwin/x86_64/cpptcl1.o -text
+tests/test/cg/obj/darwin/x86_64/cpptcl2.o -text
 tests/test/cg/obj/darwin/x86_64/ctest.o -text
 tests/test/cg/obj/darwin/x86_64/tcext3.o -text
 tests/test/cg/obj/darwin/x86_64/tcext4.o -text
@@ -8425,6 +8431,7 @@ tests/test/cg/obj/linux/arm/tcext3.o -text
 tests/test/cg/obj/linux/arm/tcext4.o -text
 tests/test/cg/obj/linux/arm/tcext5.o -text
 tests/test/cg/obj/linux/i386/cpptcl1.o -text
+tests/test/cg/obj/linux/i386/cpptcl2.o -text
 tests/test/cg/obj/linux/i386/ctest.o -text
 tests/test/cg/obj/linux/i386/tcext3.o -text
 tests/test/cg/obj/linux/i386/tcext4.o -text
@@ -8575,6 +8582,7 @@ tests/test/cg/tcnvstr1.pp svneol=native#text/plain
 tests/test/cg/tcnvstr2.pp svneol=native#text/plain
 tests/test/cg/tcnvstr3.pp svneol=native#text/plain
 tests/test/cg/tcppcl1.pp svneol=native#text/plain
+tests/test/cg/tcppcl2.pp svneol=native#text/plain
 tests/test/cg/tderef.pp svneol=native#text/plain
 tests/test/cg/tdivz1.pp svneol=native#text/plain
 tests/test/cg/tdivz2.pp svneol=native#text/plain

+ 2 - 2
tests/test/cg/obj/cpptcl1.cpp

@@ -1,5 +1,5 @@
-// compile as
-// gcc -fno-exceptions -c -o cpptestclass1.o cpptestclass1.cpp
+// compile with
+// gcc -fno-exceptions -c -o $OS/$PLATFORM/cpptcl1.o cpptcl1.cpp
 
 class TestClass
 {

+ 16 - 0
tests/test/cg/obj/cpptcl2.cpp

@@ -0,0 +1,16 @@
+// test code for class renaming
+// compile with
+// gcc -fno-exceptions -c -o $OS/$PLATFORM/cpptcl2.o cpptcl2.cpp
+
+class TestClass {
+	public:
+		static void TestProc();
+};
+
+class testclass {
+	public:
+		static void TestProc();
+};
+
+void TestClass::TestProc() {};
+void testclass::TestProc() {};

BIN
tests/test/cg/obj/darwin/arm/cpptcl2.o


BIN
tests/test/cg/obj/darwin/i386/cpptcl2.o


BIN
tests/test/cg/obj/darwin/powerpc/cpptcl2.o


BIN
tests/test/cg/obj/darwin/powerpc64/cpptcl2.o


BIN
tests/test/cg/obj/darwin/x86_64/cpptcl2.o


BIN
tests/test/cg/obj/linux/i386/cpptcl2.o


+ 27 - 0
tests/test/cg/tcppcl2.pp

@@ -0,0 +1,27 @@
+{ Test the C++ class renaming }
+program tcppcl2;
+
+{$mode objfpc}
+{$L cpptcl2.o}
+
+type
+  TestClass = cppclass
+  public
+    class procedure TestProc;
+  end; external;
+
+  TestClass2 = cppclass
+  public
+    class procedure TestProc;
+  end; external name 'testclass';
+
+begin
+  try
+    TestClass.TestProc;
+    TestClass2.TestProc;
+  except
+    ExitCode := 1;
+    writeln('error');
+  end;
+end.
+