URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
Compare Revisions
- This comparison shows the changes necessary to convert path
/openrisc/trunk/gnu-src/gcc-4.2.2/gcc/testsuite/g++.dg/rtti
- from Rev 149 to Rev 154
- ↔ Reverse comparison
Rev 149 → Rev 154
/typeid1.C
0,0 → 1,11
#include <typeinfo> |
|
struct A { |
virtual ~A() {} |
}; |
|
int main() { |
A* a = new A; |
typeid(*a).name(); |
} |
|
typeid1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: incomplete1.C
===================================================================
--- incomplete1.C (nonexistent)
+++ incomplete1.C (revision 154)
@@ -0,0 +1,12 @@
+// PR c++/28109
+// { dg-do compile }
+
+#include
+
+struct A;
+
+void foo()
+{
+ A a; // { dg-error "incomplete type" }
+ typeid (a);
+}
incomplete1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: tinfo1.C
===================================================================
--- tinfo1.C (nonexistent)
+++ tinfo1.C (revision 154)
@@ -0,0 +1,40 @@
+// Test if a local definition is in a linkonce/comdat section.
+// { dg-do compile }
+// { dg-final { scan-assembler "_ZTIP9CTemplateIhE\[: \t\n\]" } }
+// { dg-final { scan-assembler-not "(.globl|.global)\[ \]+_ZTIP9CTemplateIhE" } }
+// { dg-final { scan-assembler-not ".section\[^\n\r\]*_ZTIP9CTemplateIhE\[^\n\r\]*" } }
+
+
+namespace std
+{
+ class type_info
+ {
+ protected:
+ const char *__name;
+
+ protected:
+ explicit type_info(const char *__n): __name(__n) { }
+
+ public:
+ const char* name() const
+ { return __name; }
+ };
+}
+
+template
+class CTemplate
+{
+};
+
+class CSecondModule {
+public:
+ CSecondModule();
+
+private:
+ const CTemplate *m_variable; typedef CTemplate m_variable_type;
+};
+
+CSecondModule::CSecondModule()
+{
+ typeid(const_cast(m_variable)).name() != 0;
+}
tinfo1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typeid2.C
===================================================================
--- typeid2.C (nonexistent)
+++ typeid2.C (revision 154)
@@ -0,0 +1,15 @@
+// { dg-do run }
+
+#include
+
+template const char *print_type (const T &) {
+ return typeid(T).name();
+}
+
+/* no template */ void pp1 (int) {}
+template void pp2 (X) {}
+
+int main () {
+ if (print_type (&pp1) != print_type (&pp2))
+ return 1;
+}
typeid2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: no-rtti-voidptr.C
===================================================================
--- no-rtti-voidptr.C (nonexistent)
+++ no-rtti-voidptr.C (revision 154)
@@ -0,0 +1,21 @@
+// { dg-do compile }
+// { dg-options "-fno-rtti" }
+
+// PR C++/28687
+
+struct A {
+ virtual ~A() { }
+};
+
+struct B : A {
+};
+
+A* f()
+{
+ return new B();
+}
+
+int main()
+{
+ void* b = dynamic_cast(f());
+}
no-rtti-voidptr.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash1.C
===================================================================
--- crash1.C (nonexistent)
+++ crash1.C (revision 154)
@@ -0,0 +1,10 @@
+// { dg-do compile }
+
+// Copyright (C) 2002 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 29 Sep 2002
+
+// PR 7788. ICE
+
+class foo;
+extern const foo bar;
+class bar;
crash1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typeid3.C
===================================================================
--- typeid3.C (nonexistent)
+++ typeid3.C (revision 154)
@@ -0,0 +1,11 @@
+#include
+
+template class T> struct A {
+ void error() {
+ typeid(T).name(); // { dg-error "missing" }
+ }
+};
+
+template struct B {};
+
+template void A::error();
typeid3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash2.C
===================================================================
--- crash2.C (nonexistent)
+++ crash2.C (revision 154)
@@ -0,0 +1,9 @@
+// Copyright (C) 2005 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 16 Jun 2005
+
+// Crash when compiler is optimized
+// Origin: Andrew Pinski pinskia@gcc.gnu.org
+
+struct facet { virtual ~facet(); };
+struct ctype_base {};
+struct ctype : facet, ctype_base {};
crash2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typeid4.C
===================================================================
--- typeid4.C (nonexistent)
+++ typeid4.C (revision 154)
@@ -0,0 +1,26 @@
+// { dg-do run }
+// { dg-options "-O2" }
+
+#include
+#include
+
+struct A { virtual ~A () {} };
+
+struct APtr
+{
+ APtr (A* p) : p_ (p) { }
+ A& operator* () const { return *p_; }
+ A* p_;
+};
+
+int main ()
+{
+ APtr ap (new A);
+ std::type_info const* const exp = &typeid (*ap);
+ for (bool cont = true; cont; cont = false)
+ {
+ std::cout << "inner: cont " << cont << std::endl;
+ if (exp) ;
+ }
+}
+
typeid4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash3.C
===================================================================
--- crash3.C (nonexistent)
+++ crash3.C (revision 154)
@@ -0,0 +1,10 @@
+// PR c++/23947
+// { dg-do compile }
+
+class A {};
+class B {};
+class C : public A, public B {};
+class D : public C {};
+void f () throw (D)
+{
+}
crash3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: dyncast1.C
===================================================================
--- dyncast1.C (nonexistent)
+++ dyncast1.C (revision 154)
@@ -0,0 +1,23 @@
+class JunkBase
+{
+public:
+ virtual void DoSomething( void ) = 0;
+protected:
+ virtual ~JunkBase( void ) {};
+ JunkBase( void ) {}
+};
+
+class Junk : protected JunkBase
+{
+public:
+ Junk( void ) : JunkBase() {}
+ virtual ~Junk( void ) {}
+protected:
+ inline JunkBase * AsBase( void )
+ { return dynamic_cast< JunkBase * >( this ); }
+ virtual void DoSomething( void ) { }
+};
+
+
+
+
dyncast1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: repo1.C
===================================================================
--- repo1.C (nonexistent)
+++ repo1.C (revision 154)
@@ -0,0 +1,17 @@
+// PR c++/22204
+// { dg-options "-frepo" }
+
+#include
+template
+struct function1
+{
+ function1()
+ {
+ typeid(int[100]);
+ }
+};
+function1<1> b;
+
+int main () {}
+
+// { dg-final { cleanup-repo-files } }
repo1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: cv1.C
===================================================================
--- cv1.C (nonexistent)
+++ cv1.C (revision 154)
@@ -0,0 +1,17 @@
+// { dg-do run }
+
+#include
+#include
+
+struct S {};
+
+typedef S volatile T[4];
+
+T t[3];
+
+const std::type_info& ti = typeid (t);
+
+int main () {
+ if (strcmp (ti.name (), "A3_A4_1S") != 0)
+ return 1;
+}
cv1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: no-rtti.C
===================================================================
--- no-rtti.C (nonexistent)
+++ no-rtti.C (revision 154)
@@ -0,0 +1,18 @@
+// { dg-do compile }
+// { dg-options "-fno-rtti" }
+
+// PR C++/10891
+
+struct A {
+ virtual ~A() { }
+};
+
+struct B : A {
+};
+
+A* f();
+
+int main()
+{
+ B* b = dynamic_cast(f()); // { dg-error "error: " }
+}
no-rtti.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property