Rev 154 → Rev 816
/empty10.C
0,0 → 1,28
// { dg-do run { target i?86-*-* x86_64-*-* } } |
// { dg-require-effective-target ilp32 } |
// { dg-options "-fabi-version=0 -w" } |
|
struct E {}; |
struct E2 : public E {}; |
|
struct A { |
int i; |
}; |
|
struct B { |
int j; |
}; |
|
struct C : |
public E, |
public A, |
public E2, |
virtual public B { |
}; |
|
C c; |
|
int main () { |
if (((char*)(B*)&c - (char*)&c) != 8) |
return 1; |
} |
empty10.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: layout2.C
===================================================================
--- layout2.C (nonexistent)
+++ layout2.C (revision 816)
@@ -0,0 +1,33 @@
+// Red Hat bugzilla 65210
+// { dg-do run }
+
+struct A {
+ int a;
+};
+
+struct B : public virtual A {};
+
+struct C {
+ long double c;
+};
+
+struct D : public virtual C {
+ int d;
+};
+
+struct E : public B, public D {
+ int e;
+};
+
+E e;
+
+/* The layout of E should begin with the B-in-E vtable pointer, followed by
+ the D-in-E vtable pointer. The bug was that we used to pad out the D
+ fields for long double alignment. */
+
+int main ()
+{
+ D* dp = &e;
+ unsigned long d_offset = ((char*)dp) - ((char*) &e);
+ return (d_offset != sizeof(void *));
+}
layout2.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: vthunk1.C
===================================================================
--- vthunk1.C (nonexistent)
+++ vthunk1.C (revision 816)
@@ -0,0 +1,45 @@
+// { dg-do link }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 29 Jul 2001
+
+// Origin snyder@fnal.gov
+// Bug 3631. We mis-calculated the non-virtual part of a virtual
+// thunk. Leading to a link failure, in this case.
+
+struct A { virtual ~A () {} };
+
+struct B : virtual public A
+{
+ virtual void destroy() {}
+};
+
+class C : virtual public B {};
+class D : virtual public C {};
+class E : public virtual A {};
+
+struct F : virtual public B, virtual public E
+{
+ virtual void destroy() = 0;
+};
+
+struct G : public virtual F
+{
+ virtual void destroy() {}
+};
+
+class H : virtual public C, virtual public F {};
+class I : virtual public D, virtual public H {};
+class J : public virtual G, public virtual H {};
+
+class K : public virtual I, public virtual J
+{
+ public:
+ virtual ~K();
+};
+K::~K() {}
+
+int main ()
+{
+ return 0;
+}
vthunk1.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: layout4.C
===================================================================
--- layout4.C (nonexistent)
+++ layout4.C (revision 816)
@@ -0,0 +1,19 @@
+// { dg-do run { target i?86-*-* x86_64-*-* } }
+// { dg-require-effective-target ilp32 }
+// { dg-options "-fabi-version=1" }
+
+struct C4
+{
+ int b:30;
+ C4(){};
+};
+
+struct C1: virtual C4
+{
+ int i;
+};
+
+int main() {
+ if (sizeof (C1) != 12)
+ return 1;
+}
layout4.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: vthunk3.C
===================================================================
--- vthunk3.C (nonexistent)
+++ vthunk3.C (revision 816)
@@ -0,0 +1,27 @@
+// { dg-do compile { target i?86-*-* x86_64-*-* } }
+// { dg-require-effective-target ilp32 }
+// { dg-options "-fabi-version=0" }
+
+struct A {
+ virtual void a ();
+};
+
+struct B : virtual public A {
+ virtual void b ();
+ virtual void a ();
+};
+
+struct C {
+ virtual void c ();
+};
+
+struct D : public C, public B {
+};
+
+struct E : virtual public D {
+ void b ();
+};
+
+void E::b () {}
+
+// { dg-final { scan-assembler _ZTvn4_n20_N1E1bEv } }
vthunk3.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: arm_rtti1.C
===================================================================
--- arm_rtti1.C (nonexistent)
+++ arm_rtti1.C (revision 816)
@@ -0,0 +1,14 @@
+// { dg-do compile { target arm*-*-eabi* arm*-*-symbianelf* } }
+// { dg-options "-O2" }
+// Check that, even when optimizing, we emit an out-of-line call to
+// the type-info comparison function.
+// { dg-final { scan-assembler _ZNKSt9type_infoeqERKS_ } }
+
+#include
+
+extern const std::type_info& t1;
+extern const std::type_info& t2;
+
+bool f() {
+ return t1 == t2;
+}
arm_rtti1.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: rtti2.C
===================================================================
--- rtti2.C (nonexistent)
+++ rtti2.C (revision 816)
@@ -0,0 +1,12 @@
+// { dg-do run }
+
+#include
+#include
+
+int main () {
+ const std::type_info& ti = typeid (const int (*)[3]);
+ const abi::__pointer_type_info& pti
+ = static_cast(ti);
+ if ((pti.__flags & pti.__const_mask) == 0)
+ return 1;
+}
rtti2.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: mangle10.C
===================================================================
--- mangle10.C (nonexistent)
+++ mangle10.C (revision 816)
@@ -0,0 +1,13 @@
+// { dg-options "-fabi-version=0" }
+
+template
class Q>
+void f (typename Q::X) {}
+
+template
+struct S {
+ typedef int X;
+};
+
+template void f (int);
+
+// { dg-final { scan-assembler _Z1fI1SEvNT_IiE1XE } }
mangle10.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: vbase8-10.C
===================================================================
--- vbase8-10.C (nonexistent)
+++ vbase8-10.C (revision 816)
@@ -0,0 +1,75 @@
+// { dg-options -w }
+// { dg-do run }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 26 Jul 2001
+
+// Origin stefan@space.twc.de
+// Bug 3145 case 10. Horribly complicated class hierarchy
+
+class C0
+{};
+class C1
+ : public C0
+{};
+class C2
+ : public C1
+ , virtual public C0
+{};
+class C3
+ : public C1
+ , public C2
+ , virtual public C0
+{};
+class C4
+ : virtual public C1
+ , virtual public C0
+ , virtual public C3
+ , public C2
+{};
+class C5
+ : public C3
+ , virtual public C0
+ , virtual public C2
+{};
+class C6
+ : public C1
+ , public C2
+ , virtual public C5
+ , virtual public C3
+ , virtual public C0
+{};
+class C7
+ : public C1
+ , virtual public C5
+ , virtual public C4
+ , virtual public C2
+ , virtual public C0
+ , virtual public C6
+{};
+class C8
+ : virtual public C4
+ , public C3
+ , public C0
+ , virtual public C7
+ , virtual public C6
+{};
+class C9
+ : virtual public C0
+ , public C4
+ , public C8
+ , public C1
+ , public C6
+{};
+main() {
+ C0 c0;
+ C1 c1;
+ C2 c2;
+ C3 c3;
+ C4 c4;
+ C5 c5;
+ C6 c6;
+ C7 c7;
+ C8 c8;
+ C9 c9;
+}
vbase8-10.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: mangle12.C
===================================================================
--- mangle12.C (nonexistent)
+++ mangle12.C (revision 816)
@@ -0,0 +1,11 @@
+// { dg-options "-Wabi -fabi-version=1" }
+
+template
class Q>
+void f (typename Q::X) {} // { dg-warning "mangle" }
+
+template
+struct S {
+ typedef int X;
+};
+
+template void f (int);
mangle12.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: mangle14.C
===================================================================
--- mangle14.C (nonexistent)
+++ mangle14.C (revision 816)
@@ -0,0 +1,12 @@
+// { dg-do compile }
+// { dg-options "-Wabi -fabi-version=1" }
+
+struct A {
+ template
int f ();
+};
+
+typedef int (A::*P)();
+
+template struct S {};
+
+void g (S<&A::f >) {} // { dg-warning "mangle" }
mangle14.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: thunk1.C
===================================================================
--- thunk1.C (nonexistent)
+++ thunk1.C (revision 816)
@@ -0,0 +1,24 @@
+// { dg-do compile { target i?86-*-* x86_64-*-* } }
+// { dg-require-effective-target ilp32 }
+
+
+struct A {
+ virtual void f ();
+};
+
+struct B : public virtual A {
+ virtual void f ();
+};
+
+struct C {
+ virtual void g ();
+};
+
+struct D : public C, public B {
+ virtual void f ();
+};
+
+void D::f () {}
+
+// { dg-final { scan-assembler _ZThn4_N1D1fEv } }
+// { dg-final { scan-assembler _ZTv0_n12_N1D1fEv } }
thunk1.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: mangle16.C
===================================================================
--- mangle16.C (nonexistent)
+++ mangle16.C (revision 816)
@@ -0,0 +1,18 @@
+// { dg-options "-fabi-version=0" }
+
+enum E { e = 3 };
+
+template
struct S {};
+
+template void f (S) {}
+template void f<7>(S);
+
+template void g (S) {}
+template void g<7>(S);
+
+template void h (S) {}
+template void h<7>(S<7 + 1>);
+
+// { dg-final { scan-assembler _Z1fILi7EEv1SILi4EE } }
+// { dg-final { scan-assembler _Z1gILi7EEv1SILi3EE } }
+// { dg-final { scan-assembler _Z1hILi7EEv1SIXplT_Li1EEE } }
mangle16.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: mangle18-2.C
===================================================================
--- mangle18-2.C (nonexistent)
+++ mangle18-2.C (revision 816)
@@ -0,0 +1,23 @@
+// { dg-do compile }
+// { dg-options "-fabi-version=1 -Wabi" }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 30 Nov 2003
+
+// PR 13241
+// mangled template arguments that are external objects incorrectly
+
+extern "C" void Foo ();
+namespace NMS
+{
+ extern "C" int V;
+}
+
+template struct S {};
+template struct T {};
+
+void f (S){} // { dg-warning "mangled name" }
+// { dg-final { scan-assembler "\n_?_Z1f1SIXadL3FooEEE\[: \t\n\]" } }
+
+void g (T<&NMS::V>){} // { dg-warning "mangled name" }
+// { dg-final { scan-assembler "\n_?_Z1g1TIXadL_ZN3NMS1VEEEE\[: \t\n\]" } }
mangle18-2.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: thunk3.C
===================================================================
--- thunk3.C (nonexistent)
+++ thunk3.C (revision 816)
@@ -0,0 +1,22 @@
+// { dg-require-weak "" }
+// { dg-final { scan-assembler-not ".weak\[\t \]_?_ZThn._N7Derived3FooEv" { target { ! { *-*-darwin* } } } } }
+// { dg-final { scan-assembler-not ".weak_definition\[\t \]_?_ZThn._N7Derived3FooEv" { target { *-*-darwin* } } } }
+
+struct Base
+{
+ virtual void Foo ();
+};
+
+struct Filler
+{
+ virtual void Baz ();
+};
+
+struct Derived : Filler, Base
+{
+ virtual void Foo ();
+};
+
+void Derived::Foo ()
+{
+}
thunk3.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: mangle19-2.C
===================================================================
--- mangle19-2.C (nonexistent)
+++ mangle19-2.C (revision 816)
@@ -0,0 +1,13 @@
+// { dg-do compile }
+// { dg-options "-fabi-version=1 -Wabi" }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 15 Dec 2003
+
+// PR 13242
+// mangled template arguments that are external objects incorrectly
+
+extern int N;
+template struct S {};
+void n (S) {} // { dg-warning "mangled name" }
+// { dg-final { scan-assembler "\n_?_Z1n1SIXadL_Z1NEEE\[: \t\n\]" } }
mangle19-2.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: dcast1.C
===================================================================
--- dcast1.C (nonexistent)
+++ dcast1.C (revision 816)
@@ -0,0 +1,29 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 28 Jan 2003
+
+// PR 9433. segfault at runtime.
+
+struct A { virtual void f() {}; };
+struct B {int b;};
+struct C : A, B { virtual void f() {}; int c;};
+struct D : C {int d;};
+struct E : C {int e;};
+struct F : protected D, E {int f;};
+struct H : virtual F {int h;};
+struct I : H {int i;};
+struct J : H {int j;};
+struct K : I, J { virtual void f() {}; int k; };
+struct M : K {int m;};
+struct N : M {int n;};
+struct O : M {int o;};
+struct P : N, O { virtual void f() {}; int p;};
+
+int main()
+{
+ P obj;
+ A* a1 = (D *) (&obj);
+ H* hp = dynamic_cast(a1);
+ return hp != 0;
+}
dcast1.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: macro0.C
===================================================================
--- macro0.C (nonexistent)
+++ macro0.C (revision 816)
@@ -0,0 +1,5 @@
+// { dg-options "-fabi-version=0" }
+
+#if __GXX_ABI_VERSION != 999999
+#error "Incorrect value of __GXX_ABI_VERSION"
+#endif
macro0.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: param1.C
===================================================================
--- param1.C (nonexistent)
+++ param1.C (revision 816)
@@ -0,0 +1,28 @@
+// { dg-do run }
+//
+
+// Failed on powerpc64-linux for structure sizes > 64 and with size not a
+// multiple of 8 after padding.
+struct object
+{
+ int i1;
+ char s1[60];
+ int i2;
+ char s2[64];
+};
+
+extern int subr (struct object obj);
+
+int main ()
+{
+ struct object obj;
+
+ obj.i1 = 1234;
+ obj.i2 = 5678;
+ return subr (obj);
+}
+
+int subr (struct object obj)
+{
+ return obj.i1 != 1234 || obj.i2 != 5678;
+}
param1.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: empty4.C
===================================================================
--- empty4.C (nonexistent)
+++ empty4.C (revision 816)
@@ -0,0 +1,86 @@
+// { dg-do run }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 31 Jul 2001
+
+// Bug 3820. We were bit copying empty bases including the
+// padding. Which clobbers whatever they overlay.
+
+struct Empty {};
+
+struct Inter : Empty {};
+
+long now = 0;
+
+struct NonPod
+{
+ long m;
+
+ NonPod () {m = 0x12345678;}
+ NonPod (long m_) {m = m_;}
+ NonPod &operator= (NonPod const &src) {now = m; m = src.m; return *this;}
+ NonPod (NonPod const &src) {m = src.m;}
+};
+
+struct A : Inter
+{
+ A (long c) {m = c;}
+
+ NonPod m;
+};
+
+struct B
+{
+ Inter empty;
+ NonPod m;
+
+ B (long c) {m = c;}
+};
+
+struct C : NonPod, Inter
+{
+ C (long c) : NonPod (c), Inter () {}
+};
+
+int main ()
+{
+ A a (0x12131415);
+
+ long was = a.m.m;
+
+ a = 0x22232425;
+
+ if (was != now)
+ return 1; // we copied the empty base which clobbered a.m.m's
+ // original value.
+
+ A b (0x32333435);
+ *(Inter *)&a = *(Inter *)&b;
+
+ if (a.m.m != 0x22232425)
+ return 2; // we copied padding, which clobbered a.m.m
+
+ A b2 (0x32333435);
+ (Inter &)b2 = Inter ();
+ if (b2.m.m != 0x32333435)
+ return 2; // we copied padding, which clobbered b2.m.m
+
+ B c (0x12131415);
+ was = c.m.m;
+ c = 0x22232425;
+ if (was != now)
+ return 3;
+
+ B d (0x32333435);
+ c.empty = d.empty;
+
+ if (c.m.m != 0x22232425)
+ return 4;
+
+ C e (0x32333435);
+
+ if (e.m != 0x32333435)
+ return 2; // we copied padding
+
+ return 0;
+}
empty4.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: macro2.C
===================================================================
--- macro2.C (nonexistent)
+++ macro2.C (revision 816)
@@ -0,0 +1,5 @@
+// { dg-options "-fabi-version=2" }
+
+#if __GXX_ABI_VERSION != 1002
+#error "Incorrect value of __GXX_ABI_VERSION"
+#endif
macro2.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: bitfield11.C
===================================================================
--- bitfield11.C (nonexistent)
+++ bitfield11.C (revision 816)
@@ -0,0 +1,14 @@
+// { dg-do run }
+// { dg-options "-w -fabi-version=0" }
+
+struct S {
+ char c : 1024;
+};
+
+S s;
+
+int main () {
+ s.c = 1;
+ if (*(char *)&s != 1)
+ return 1;
+}
bitfield11.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: empty6.C
===================================================================
--- empty6.C (nonexistent)
+++ empty6.C (revision 816)
@@ -0,0 +1,14 @@
+// { dg-options "-Wabi" }
+
+struct A {};
+
+struct B {
+ A a; // { dg-warning "empty" "" { xfail mmix-*-* } }
+ virtual void f () {}
+} __attribute__((aligned(2 * sizeof (void *))));
+/* The preceding attribute is necessary on targets with
+ BIGGEST_ALIGNMENT <= POINTER_SIZE to trigger the warning, as
+ otherwise the offset of 'a' (i.e. POINTER_SIZE) is split into a
+ non-zero DECL_FIELD_OFFSET and a zero DECL_FIELD_BIT_OFFSET,
+ and then there is no discrepancy between DECL_FIELD_OFFSET and
+ byte_position to warn about. */
empty6.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: empty8.C
===================================================================
--- empty8.C (nonexistent)
+++ empty8.C (revision 816)
@@ -0,0 +1,14 @@
+// { dg-do run }
+// { dg-options "-fabi-version=0" }
+
+struct E1 {};
+struct E2 : public E1 {};
+struct S1 { int i; };
+struct S2 : public S1, E2 {};
+
+S2 s2;
+
+int main () {
+ if ((char *)(E2*) &s2 != (char *)&s2)
+ return 1;
+}
empty8.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: dtor1.C
===================================================================
--- dtor1.C (nonexistent)
+++ dtor1.C (revision 816)
@@ -0,0 +1,23 @@
+// { dg-do compile { target i?86-*-* x86_64-*-* } }
+// { dg-require-effective-target ilp32 }
+// { dg-options "-fabi-version=0" }
+
+struct A {
+ virtual void a ();
+};
+
+struct B {
+ virtual ~B ();
+};
+
+struct C : public A, public B {
+ virtual void c ();
+};
+
+struct D : virtual public C {
+ virtual void d ();
+};
+
+void D::d () {}
+
+// { dg-final { scan-assembler _ZTv0_n20_N1DD1Ev } }
dtor1.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: vbase11.C
===================================================================
--- vbase11.C (nonexistent)
+++ vbase11.C (revision 816)
@@ -0,0 +1,13 @@
+// { dg-do run { target i?86-*-* x86_64-*-* } }
+// { dg-require-effective-target ilp32 }
+// { dg-options "-fabi-version=0" }
+
+struct A { virtual void f(); char c1; };
+struct B { B(); char c2; };
+struct C : public A, public virtual B { };
+
+int main () {
+ if (sizeof (C) != 8)
+ return 1;
+}
+
vbase11.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: bitfield1.C
===================================================================
--- bitfield1.C (nonexistent)
+++ bitfield1.C (revision 816)
@@ -0,0 +1,34 @@
+// { dg-do run }
+// { dg-options "-ansi -pedantic-errors -funsigned-bitfields" }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 15 Dec 2001
+
+typedef int Int;
+typedef signed int SInt;
+typedef unsigned int UInt;
+
+struct A
+{
+ SInt bitS : 1; // signed
+ UInt bitU : 1; // unsigned
+ Int bit : 1; // signedness by -f{signed,unsigned}-bitfields
+};
+
+int main ()
+{
+ A a;
+
+ a.bitS = 1; // { dg-warning "overflow" }
+ a.bitU = 1;
+ a.bit = 1;
+
+ if (a.bitS != -1)
+ return 1;
+ if (a.bitU != 1)
+ return 2;
+ if (a.bit != 1)
+ return 3;
+
+ return 0;
+}
bitfield1.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: mangle20-2.C
===================================================================
--- mangle20-2.C (nonexistent)
+++ mangle20-2.C (revision 816)
@@ -0,0 +1,16 @@
+// { dg-do compile }
+// { dg-options "-fabi-version=1 -Wabi" }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 15 Dec 2003
+
+// PR 9043
+// mangled array types in templates
+
+template void f(int (*)[2]) {} // { dg-warning "mangled name" }
+template void g(int (*)[I+2]) {}
+
+template void f<1>(int (*)[2]);
+// { dg-final { scan-assembler "\n_?_Z1fILi1EEvPALi2E_i\[: \t\n\]" } }
+template void g<1>(int (*)[3]);
+// { dg-final { scan-assembler "\n_?_Z1gILi1EEvPAplT_Li2E_i\[: \t\n\]" } }
mangle20-2.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: vbase13.C
===================================================================
--- vbase13.C (nonexistent)
+++ vbase13.C (revision 816)
@@ -0,0 +1,17 @@
+// { dg-do run }
+// { dg-options "-fabi-version=0 -w" }
+
+struct E1 {};
+struct E2 : public E1 {};
+struct E : public E1, public E2 {};
+struct N : public E { virtual void f () {} };
+
+struct X : virtual public N {
+};
+
+int main () {
+ X x;
+ /* N should not be the primary base of X; it is not nearly empty. */
+ if ((void*)&x == (void*)(N*)&x)
+ return 1;
+}
vbase13.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: bitfield3.C
===================================================================
--- bitfield3.C (nonexistent)
+++ bitfield3.C (revision 816)
@@ -0,0 +1,84 @@
+// Test for oversized bitfield alignment in structs on IA-32
+// { dg-do run { target i?86-*-* x86_64-*-* } }
+// { dg-options "-O2" }
+// Cygwin and mingw32 default to MASK_ALIGN_DOUBLE. Override to ensure
+// 4-byte alignment.
+// { dg-options "-mno-align-double" { target i?86-*-cygwin* i?86-*-mingw* } }
+// { dg-require-effective-target ilp32 }
+
+struct A
+{
+ char a;
+ int b : 224; // { dg-warning "exceeds its type" "" }
+ char c;
+} a, a4[4];
+
+struct B
+{
+ char d;
+ A e;
+ char f;
+} b;
+
+struct C
+{
+ char g;
+ long long h : 64;
+ char i;
+} c, c4[4];
+
+struct D
+{
+ char j;
+ C k;
+ char l;
+} d;
+
+struct E
+{
+ char m;
+ long long n : 160; // { dg-warning "exceeds its type" "" }
+ char o;
+} e, e4[4];
+
+struct F
+{
+ char p;
+ E q;
+ char r;
+} f;
+
+int main (void)
+{
+ if (&a.c - &a.a != 32)
+ return 1;
+ if (sizeof (a) != 36)
+ return 2;
+ if (sizeof (a4) != 4 * 36)
+ return 3;
+ if (sizeof (b) != 2 * 4 + 36)
+ return 4;
+ if (__alignof__ (b.e) != 4)
+ return 5;
+ if (&c.i - &c.g != 12)
+ return 6;
+ if (sizeof (c) != 16)
+ return 7;
+ if (sizeof (c4) != 4 * 16)
+ return 8;
+ if (sizeof (d) != 2 * 4 + 16)
+ return 9;
+ if (__alignof__ (d.k) != 4)
+ return 10;
+ if (&e.o - &e.m != 24)
+ return 11;
+ if (sizeof (e) != 28)
+ return 12;
+ if (sizeof (e4) != 4 * 28)
+ return 13;
+ if (sizeof (f) != 2 * 4 + 28)
+ return 14;
+ if (__alignof__ (f.q) != 4)
+ return 15;
+ return 0;
+}
bitfield3.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: mangle21.C
===================================================================
--- mangle21.C (nonexistent)
+++ mangle21.C (revision 816)
@@ -0,0 +1,13 @@
+// PR c++/14324
+// { dg-do assemble }
+
+extern "C" {
+
+void fun1(void)
+{
+ do { static int xyz __attribute__((unused)) = 1; } while (0);
+ do { static int xyz __attribute__((unused)) = 2; } while (0);
+ do { static int xyz __attribute__((unused)) = 3; } while (0);
+}
+
+}
mangle21.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: covariant1.C
===================================================================
--- covariant1.C (nonexistent)
+++ covariant1.C (revision 816)
@@ -0,0 +1,21 @@
+// { dg-do compile }
+// { dg-options "-w" }
+
+// We don't want to use a covariant thunk to have a virtual
+// primary base
+
+struct c4 {};
+
+struct c6 : c4 { virtual c4* f17(); };
+
+c4* c6::f17() { return 0; }
+
+struct c11 : virtual c6 { int i; };
+
+struct c12 : c11 { };
+
+struct c14 :
+ virtual c12,
+ virtual c11 { virtual c12* f17(); };
+
+// { dg-final { scan-assembler-not "\n_ZTch0_v0_n16_N3c143f17Ev\[: \t\n\]" } }
covariant1.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: bitfield5.C
===================================================================
--- bitfield5.C (nonexistent)
+++ bitfield5.C (revision 816)
@@ -0,0 +1,15 @@
+// { dg-do compile }
+// { dg-options "-Wabi -fabi-version=1" }
+// { dg-options "-Wabi -fabi-version=1 -mno-ms-bitfields" { target i?86-*-* x86_64-*-* } }
+
+struct A {
+ virtual void f();
+ int f1 : 1;
+};
+
+struct B : public A {
+ int f2 : 1; // { dg-warning "ABI" }
+ int : 0;
+ int f3 : 4;
+ int f4 : 3;
+};
bitfield5.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: vbase8-21.C
===================================================================
--- vbase8-21.C (nonexistent)
+++ vbase8-21.C (revision 816)
@@ -0,0 +1,75 @@
+// { dg-options -w }
+// { dg-do run }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 26 Jul 2001
+
+// Origin stefan@space.twc.de
+// Bug 3145 case 10. Horribly complicated class hierarchy
+
+class C0
+{};
+class C1
+ : virtual public C0
+{};
+class C2
+ : virtual public C1
+ , virtual public C0
+{};
+class C3
+ : virtual public C2
+ , virtual public C1
+{};
+class C4
+ : virtual public C2
+ , public C0
+ , public C1
+{};
+class C5
+ : virtual public C0
+ , public C2
+ , virtual public C1
+ , virtual public C3
+ , virtual public C4
+{};
+class C6
+ : virtual public C1
+ , virtual public C3
+ , public C0
+ , public C2
+ , virtual public C4
+{};
+class C7
+ : virtual public C5
+ , public C2
+ , public C6
+ , virtual public C0
+ , public C3
+{};
+class C8
+ : virtual public C5
+ , public C7
+ , virtual public C0
+ , virtual public C2
+ , virtual public C6
+{};
+class C9
+ : virtual public C2
+ , virtual public C4
+ , public C1
+ , virtual public C0
+ , public C7
+ , public C5
+{};
+main() {
+ C0 c0;
+ C1 c1;
+ C2 c2;
+ C3 c3;
+ C4 c4;
+ C5 c5;
+ C6 c6;
+ C7 c7;
+ C8 c8;
+ C9 c9;
+}
vbase8-21.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: mangle23.C
===================================================================
--- mangle23.C (nonexistent)
+++ mangle23.C (revision 816)
@@ -0,0 +1,9 @@
+// PR c++/16240
+// { dg-options "-fabi-version=2" }
+
+void foo(char);
+template
struct CB {};
+
+void g(CB i) {}
+
+// { dg-final { scan-assembler "\n_?_Z1g2CBILZ3foocEE\[: \t\n\]" } }
mangle23.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: covariant3.C
===================================================================
--- covariant3.C (nonexistent)
+++ covariant3.C (revision 816)
@@ -0,0 +1,85 @@
+// { dg-do run }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 12 Dec 2003
+// Origin: grigory@stl.sarov.ru
+
+// PR c++/13118. Missing covariant thunk.
+
+struct c0 {};
+struct c1 : virtual c0 {
+ virtual c0* f6();
+};
+
+struct c5 {
+ virtual void foo();
+};
+
+struct c10 : virtual c1 {
+ virtual void foo();
+};
+
+struct c1a : c1 {}; // disambiguation
+
+struct c11 : virtual c10, c1a {
+ int i;
+ virtual c1* f6 () = 0;
+};
+
+struct c18 : c5, virtual c1 {
+ virtual void bar();
+};
+
+struct c28 : virtual c0, virtual c11 {
+ virtual c18* f6();
+};
+
+c0 *c1::f6 () {}
+void c5::foo () {}
+void c10::foo () {}
+void c18::bar () {}
+
+c18 ret;
+
+c18 *c28::f6 ()
+{
+ return &ret;
+}
+
+bool check_c1 (c1 *ptr)
+{
+ c0 *r = ptr->f6 ();
+ return r != &ret;
+}
+bool check_c10 (c10 *ptr)
+{
+ c0 *r = ptr->f6 ();
+ return r != &ret;
+}
+bool check_c11 (c11 *ptr)
+{
+ c1 *r = ptr->f6 ();
+ return r != &ret;
+}
+bool check_c28 (c28 *ptr)
+{
+ c18 *r = ptr->f6 ();
+ return r != &ret;
+}
+
+int main ()
+{
+ c28 obj;
+
+ if (check_c1 (static_cast (&obj)))
+ return 1;
+ if (check_c1 (static_cast (&obj)))
+ return 2;
+ if (check_c10 (&obj))
+ return 3;
+ if (check_c11 (&obj))
+ return 4;
+ if (check_c28 (&obj))
+ return 5;
+ return 0;
+}
covariant3.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: bitfield7.C
===================================================================
--- bitfield7.C (nonexistent)
+++ bitfield7.C (revision 816)
@@ -0,0 +1,7 @@
+// { dg-do compile }
+// { dg-options "-Wabi -fabi-version=1" }
+
+union U { // { dg-warning "ABI" }
+ int i: 4096; // { dg-warning "exceeds" }
+};
+
bitfield7.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: key1.C
===================================================================
--- key1.C (nonexistent)
+++ key1.C (revision 816)
@@ -0,0 +1,26 @@
+// On ARM EABI platforms, key methods may never be inline.
+// { dg-do compile { target arm*-*-eabi* arm*-*-symbianelf* } }
+// { dg-final { scan-assembler-not _ZTV1S } }
+// { dg-final { scan-assembler-not _ZTV1T } }
+// { dg-final { scan-assembler _ZTV1U } }
+
+struct S {
+ virtual void f();
+};
+
+inline void S::f() {}
+
+struct T {
+ virtual void g();
+ virtual void h();
+};
+
+inline void T::g() {}
+
+struct U {
+ virtual void i();
+ virtual void j();
+};
+
+inline void U::i() {}
+void U::j () {}
key1.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: mangle25.C
===================================================================
--- mangle25.C (nonexistent)
+++ mangle25.C (revision 816)
@@ -0,0 +1,13 @@
+// Test mangling of __float128.
+// The C++ ABI document says __float128 is mangled as "g". It
+// also says that "long double" is mangled as "e", so these conflict on
+// ia64-hpux where "long double" is "e" and __float128 is synonymous with
+// "long double".
+// Origin: Joseph Myers
+// { dg-do compile { target { ia64-*-* || { { i?86-*-* x86_64-*-*} && lp64 } } } }
+// { dg-options "" } */
+// { dg-final { scan-assembler "_Z1fg" { target i?86-*-* x86_64-*-* } } } */
+// { dg-final { scan-assembler "_Z1fg" { target { ia64-*-* && { ! "ia64-*-hpux*" } } } } } */
+// { dg-final { scan-assembler "_Z1fe" { target ia64-*-hpux* } } } */
+
+int f(__float128 x) { return 0; }
mangle25.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: offsetof.C
===================================================================
--- offsetof.C (nonexistent)
+++ offsetof.C (revision 816)
@@ -0,0 +1,22 @@
+// Test that we can refer to the address of a base member of a null pointer
+// to get its offset. The standard says that offsetof shall not be used on
+// non-POD classes, but there seems to be no such restriction on the common
+// implementation thereof.
+
+// Yes, this is bad, naughty, evil code. But it seems to be well-formed.
+// So we'll just warn.
+
+// { dg-do run }
+
+struct A { int i; };
+
+struct B: public A {
+ virtual void f ();
+};
+
+struct C: public B { };
+
+int main ()
+{
+ return ((unsigned long) &((C*)0)->i) != sizeof(void*); // { dg-warning "offsetof|invalid" "" }
+}
offsetof.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: covariant5.C
===================================================================
--- covariant5.C (nonexistent)
+++ covariant5.C (revision 816)
@@ -0,0 +1,52 @@
+// Copyright (C) 2005 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 4 Apr 2005
+
+// { dg-do run }
+
+// PR 20746: Covariant return pointer could be null.
+
+// Origin: yanliu@ca.ibm.com
+// nathan@codesourcery.com
+
+struct A {
+ virtual void One ();
+};
+struct B {
+ virtual B *Two ();
+ virtual B &Three ();
+};
+
+struct C : A, B
+{
+ virtual C *Two ();
+ virtual C &Three ();
+};
+void A::One () {}
+B *B::Two() {return this;}
+B &B::Three() {return *this;}
+C *C::Two () {return 0;}
+C &C::Three () {return *(C *)0;}
+
+B *Foo (B *b)
+{
+ return b->Two ();
+}
+
+B &Bar (B *b)
+{
+ return b->Three ();
+}
+
+int main ()
+{
+ C c;
+
+ /* We should not adjust a null pointer. */
+ if (Foo (&c))
+ return 1;
+ /* But we should adjust a (bogus) null reference. */
+ if (!&Bar (&c))
+ return 2;
+
+ return 0;
+}
covariant5.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: bitfield9.C
===================================================================
--- bitfield9.C (nonexistent)
+++ bitfield9.C (revision 816)
@@ -0,0 +1,12 @@
+// { dg-do run { target i?86-*-* x86_64-*-* } }
+// { dg-require-effective-target ilp32 }
+// { dg-options -w }
+
+struct X {
+ char : 45;
+};
+
+int main () {
+ if (__alignof__ (X) != 4)
+ return 1;
+}
bitfield9.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: mangle27.C
===================================================================
--- mangle27.C (nonexistent)
+++ mangle27.C (revision 816)
@@ -0,0 +1,14 @@
+// Test of std::basic_iostream
> mangling
+
+// { dg-do compile }
+// { dg-options "-fno-inline" }
+
+namespace std {
+ template struct char_traits;
+
+ template struct basic_iostream { basic_iostream(){} };
+}
+
+std::basic_iostream > s1;
+
+// { dg-final { scan-assembler "\n_?_ZNSdC1Ev\[: \t\n\]" } }
mangle27.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: mangle29.C
===================================================================
--- mangle29.C (nonexistent)
+++ mangle29.C (revision 816)
@@ -0,0 +1,14 @@
+// Test of std::basic_ostream
> mangling
+
+// { dg-do compile }
+// { dg-options "-fno-inline" }
+
+namespace std {
+ template struct char_traits;
+
+ template struct basic_ostream { basic_ostream(){} };
+}
+
+std::basic_ostream > s1;
+
+// { dg-final { scan-assembler "\n_?_ZNSoC1Ev\[: \t\n\]" } }
mangle29.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: mangle1.C
===================================================================
--- mangle1.C (nonexistent)
+++ mangle1.C (revision 816)
@@ -0,0 +1,28 @@
+// Test for mangling of simple testcase involving construction vtables.
+
+// { dg-do compile }
+// { dg-options "-fno-inline" }
+
+struct A {
+ virtual void f () { }
+};
+
+struct B: public virtual A { };
+struct C: public B { };
+
+C c;
+
+// { dg-final { scan-assembler "\n_?_ZN1A1fEv\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_ZN1AC2Ev\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_ZN1BC2Ev\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_ZN1CC1Ev\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_ZTC1C0_1B\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_ZTI1A\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_ZTI1B\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_ZTI1C\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_ZTS1A\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_ZTS1B\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_ZTS1C\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_ZTT1C\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_ZTV1A\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_ZTV1C\[: \t\n\]" } }
mangle1.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: enum1.C
===================================================================
--- enum1.C (nonexistent)
+++ enum1.C (revision 816)
@@ -0,0 +1,16 @@
+// { dg-do run }
+
+#include
+
+enum foo
+{
+ foo1 = 0,
+ foo2 = 0xffffffffffffffffULL,
+ foo3 = 0xf0fffffffffffffeULL
+};
+
+int main ()
+{
+ if (sizeof (enum foo) != sizeof (unsigned long long))
+ std::abort ();
+}
enum1.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: mangle3.C
===================================================================
--- mangle3.C (nonexistent)
+++ mangle3.C (revision 816)
@@ -0,0 +1,19 @@
+// Test mangling of type casts
+// { dg-do compile }
+
+template
class A {};
+template class B {};
+
+template void f(A &, B &) {}
+template void g(A &, B(i)> &) {}
+
+int main()
+{
+ A<1> a;
+ B b;
+ f(a, b);
+ g(a, b);
+}
+
+// { dg-final { scan-assembler "\n_?_Z1fILi1EEvR1AIXT_EER1BIXcvbT_EE\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_Z1gILi1EEvR1AIXT_EER1BIXcvbT_EE\[: \t\n\]" } }
mangle3.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: mangle5.C
===================================================================
--- mangle5.C (nonexistent)
+++ mangle5.C (revision 816)
@@ -0,0 +1,6 @@
+// Test mangling of pointers to cv-qualified member functions
+
+struct A;
+void f (void (A::*)() const) {}
+
+// { dg-final { scan-assembler "\n_?_Z1fM1AKFvvE\[: \t\n\]" } }
mangle5.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: arm_cxa_vec1.C
===================================================================
--- arm_cxa_vec1.C (nonexistent)
+++ arm_cxa_vec1.C (revision 816)
@@ -0,0 +1,32 @@
+// Check that __cxa_vec_[c]ctor returns a pointer to the array
+// { dg-do run { target arm*-*-* xscale*-*-* } }
+
+#include
+
+#ifdef ___ARM_EABI__
+static void cctor (void * a, void * b)
+{
+ *(char *) a = *(char *) b
+}
+
+int main()
+{
+ char data;
+ char data2;
+ char *p;
+
+ p = __cxa_vec_ctor (&data, 1, 1, NULL, NULL);
+ if (p != &data)
+ return 1;
+ p = __cxa_vec_cctor (&data2, &data, 1, 1, cctor, NULL);
+ if (p != &data2)
+ return 1;
+
+ return 0;
+}
+#else
+int main()
+{
+ return 0;
+}
+#endif
arm_cxa_vec1.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: vbase8-4.C
===================================================================
--- vbase8-4.C (nonexistent)
+++ vbase8-4.C (revision 816)
@@ -0,0 +1,78 @@
+// { dg-options -w }
+// { dg-do run }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 20 Nov 2001
+
+// Origin stefan@space.twc.de
+// Bug 3145 case 4. Horribly complicated class hierarchy
+
+class C0
+{};
+class C1
+ : virtual public C0
+{};
+class C2
+ : public C0
+ , public C1
+{};
+class C3
+ : virtual public C0
+ , public C1
+ , public C2
+{};
+class C4
+ : public C2
+ , public C3
+ , virtual public C1
+ , virtual public C0
+{};
+class C5
+ : virtual public C2
+ , public C1
+ , public C0
+{};
+class C6
+ : virtual public C0
+ , virtual public C5
+ , public C1
+ , public C3
+ , public C4
+{};
+class C7
+ : public C6
+ , virtual public C0
+ , public C1
+ , public C2
+ , virtual public C4
+{};
+class C8
+ : public C2
+ , virtual public C6
+ , virtual public C7
+ , public C5
+ , public C3
+ , virtual public C4
+{};
+class C9
+ : public C5
+ , virtual public C3
+ , virtual public C8
+ , public C0
+ , public C2
+ , public C7
+ , public C6
+ , public C4
+{};
+main() {
+ C0 c0;
+ C1 c1;
+ C2 c2;
+ C3 c3;
+ C4 c4;
+ C5 c5;
+ C6 c6;
+ C7 c7;
+ C8 c8;
+ C9 c9;
+}
vbase8-4.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: mangle7.C
===================================================================
--- mangle7.C (nonexistent)
+++ mangle7.C (revision 816)
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+
+typedef void *const t1[2];
+float const f1(t1 (&)[79], ...) {}
+
+/* { dg-final { scan-assembler _Z2f1RA79_A2_KPvz } } */
mangle7.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: cookie1.C
===================================================================
--- cookie1.C (nonexistent)
+++ cookie1.C (revision 816)
@@ -0,0 +1,15 @@
+// { dg-options "-fabi-version=0" }
+
+void *operator new[](__SIZE_TYPE__, void *);
+
+struct A {
+ ~A(){}
+};
+
+int main()
+{
+ A * a = (A*) new char[20];
+ A * b = new(a) A[3];
+ if (a != b)
+ return 1;
+}
cookie1.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: mangle9.C
===================================================================
--- mangle9.C (nonexistent)
+++ mangle9.C (revision 816)
@@ -0,0 +1,12 @@
+// { dg-options "-fabi-version=0" }
+
+template
+void f (typename Q::X) {}
+
+struct S {
+ typedef int X;
+};
+
+template void f (int);
+
+// { dg-final { scan-assembler _Z1fI1SEvNT_1XE } }
mangle9.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: vtt1.C
===================================================================
--- vtt1.C (nonexistent)
+++ vtt1.C (revision 816)
@@ -0,0 +1,11 @@
+// { dg-do compile }
+
+struct A {
+};
+
+struct B : virtual public A {
+};
+
+B b;
+
+// { dg-final { scan-assembler _ZTT1B } }
vtt1.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: layout1.C
===================================================================
--- layout1.C (nonexistent)
+++ layout1.C (revision 816)
@@ -0,0 +1,31 @@
+// Red Hat bugzilla 64535
+// Bug: We are allocationg stuff into the tail padding of POD class "A".
+// { dg-do run }
+
+struct A
+{
+ int x;
+ char y;
+};
+
+struct B : public A {
+ virtual void f () {}
+ char z;
+};
+
+A a = { 21, 42 };
+B b;
+
+int
+main (void)
+{
+ b.x = 12;
+ b.y = 24;
+ b.z = 36;
+
+ A *ap = &b;
+
+ *ap = a;
+
+ return (b.z != 36);
+}
layout1.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: empty11.C
===================================================================
--- empty11.C (nonexistent)
+++ empty11.C (revision 816)
@@ -0,0 +1,19 @@
+// { dg-do run }
+// { dg-options "-w -fabi-version=0" }
+
+struct E {};
+struct E2 : public E {};
+struct E3 : public E, public E2 {};
+struct E4 : public E, public E2, public E3 { };
+struct E5 : public E, public E2, public E3, public E4 {};
+
+struct S : public virtual E5 {
+ E e;
+};
+
+S s;
+
+int main () {
+ if ((char*)(E4*)&s - (char*)&s == 0)
+ return 1;
+}
empty11.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: layout3.C
===================================================================
--- layout3.C (nonexistent)
+++ layout3.C (revision 816)
@@ -0,0 +1,27 @@
+// { dg-do run { target i?86-*-* x86_64-*-* } }
+// { dg-require-effective-target ilp32 }
+// { dg-options "-fabi-version=0 -w" }
+
+struct S {
+ virtual void f() {}
+};
+
+struct T : virtual public S { };
+
+struct U : public S, virtual public T {
+ char c[100];
+};
+
+struct V : public U, virtual public S {};
+
+struct W : public V {
+ int i;
+};
+
+int main () {
+ W w;
+
+ if ((char*) &w.i - (char *) &w != 104)
+ return 1;
+}
+
layout3.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: vthunk2.C
===================================================================
--- vthunk2.C (nonexistent)
+++ vthunk2.C (revision 816)
@@ -0,0 +1,17 @@
+// { dg-do compile { target i?86-*-* x86_64-*-*} }
+// { dg-require-effective-target ilp32 }
+
+struct c0 {
+ virtual void f ();
+};
+
+struct c1 : virtual public c0 {
+};
+
+struct c2 : virtual public c0, public c1 {
+ virtual void f ();
+};
+
+void c2::f () {}
+
+// { dg-final { scan-assembler _ZTv0_n12_N2c21fEv } }
vthunk2.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: rtti1.C
===================================================================
--- rtti1.C (nonexistent)
+++ rtti1.C (revision 816)
@@ -0,0 +1,13 @@
+// Test that we don't emit the type_info for a polymorphic class other than
+// with the vtable.
+
+struct A {
+ virtual ~A();
+};
+
+void f ()
+{
+ throw A();
+}
+
+// { dg-final { scan-assembler-dem-not {\ntypeinfo for A[: \t\n]} } }
rtti1.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: rtti3.C
===================================================================
--- rtti3.C (nonexistent)
+++ rtti3.C (revision 816)
@@ -0,0 +1,15 @@
+// PR 20647, we must emit the typeinfo's string as weak, but not the
+// necessarily the type info object
+
+// { dg-require-weak "" }
+// { dg-final { scan-assembler ".weak\[ \t\]_?_ZTSPP1A" { target { ! { *-*-darwin* } } } } }
+// { dg-final { scan-assembler-not ".weak\[ \t\]_?_ZTIPP1A" { target { ! { *-*-darwin* } } } } }
+// { dg-final { scan-assembler ".weak_definition\[ \t\]_?_ZTSPP1A" { target { *-*-darwin* } } } }
+// { dg-final { scan-assembler-not ".weak_definition\[ \t\]_?_ZTIPP1A" { target { *-*-darwin* } } } }
+
+struct A;
+
+void Foo ()
+{
+ throw (A **)0;
+}
rtti3.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: mangle11.C
===================================================================
--- mangle11.C (nonexistent)
+++ mangle11.C (revision 816)
@@ -0,0 +1,10 @@
+// { dg-options "-Wabi -fabi-version=1" }
+
+template
+void f (typename Q::X) {} // { dg-warning "mangle" }
+
+struct S {
+ typedef int X;
+};
+
+template void f (int);
mangle13.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: mangle15.C
===================================================================
--- mangle15.C (nonexistent)
+++ mangle15.C (revision 816)
@@ -0,0 +1,14 @@
+// { dg-do compile }
+// { dg-options "-fabi-version=0" }
+
+struct A {
+ template
int f ();
+};
+
+typedef int (A::*P)();
+
+template struct S {};
+
+void g (S<&A::f >) {}
+
+// { dg-final { scan-assembler _Z1g1SIXadL_ZN1A1fIiEEivEEE } }
mangle15.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: mangle18-1.C
===================================================================
--- mangle18-1.C (nonexistent)
+++ mangle18-1.C (revision 816)
@@ -0,0 +1,23 @@
+// { dg-do compile }
+// { dg-options "-fabi-version=2" }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 30 Nov 2003
+
+// PR 13241
+// mangled template arguments that are external objects incorrectly
+
+extern "C" void Foo ();
+namespace NMS
+{
+ extern "C" int V;
+}
+
+template struct S {};
+template struct T {};
+
+void f (S){}
+// { dg-final { scan-assembler "\n_?_Z1f1SIXadL_Z3FooEEE\[: \t\n\]" } }
+
+void g (T<&NMS::V>){}
+// { dg-final { scan-assembler "\n_?_Z1g1TIXadL_Z1VEEE\[: \t\n\]" } }
mangle18-1.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: mangle19-1.C
===================================================================
--- mangle19-1.C (nonexistent)
+++ mangle19-1.C (revision 816)
@@ -0,0 +1,13 @@
+// { dg-do compile }
+// { dg-options "-fabi-version=2" }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 15 Dec 2003
+
+// PR 13242
+// mangled template arguments that are external objects incorrectly
+
+extern int N;
+template struct S {};
+void n (S) {}
+// { dg-final { scan-assembler "\n_?_Z1n1SILZ1NEE\[: \t\n\]" } }
mangle19-1.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: mangle17.C
===================================================================
--- mangle17.C (nonexistent)
+++ mangle17.C (revision 816)
@@ -0,0 +1,11 @@
+// { dg-options "-Wabi -fabi-version=1" }
+
+enum E { e = 3 };
+
+template
struct S {};
+
+template void f (S) {} // { dg-warning "mangle" }
+template void f<7>(S<7 + e + int (3.7)>);
+
+template void g (S) {} // { dg-warning "mangle" }
+template void g<7>(S<7 + e + int (3.7)>);
mangle17.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: local1.C
===================================================================
--- local1.C (nonexistent)
+++ local1.C (revision 816)
@@ -0,0 +1,22 @@
+// { dg-do run }
+// { dg-additional-sources "local1-a.cc" }
+
+#include
+
+struct B {
+ virtual void b() {}
+};
+
+static B* f() {
+ struct D : public B {
+ };
+
+ return new D;
+}
+
+extern B* g();
+
+int main () {
+ if (typeid (*f()) == typeid (*g()))
+ return 1;
+}
local1.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: thunk2.C
===================================================================
--- thunk2.C (nonexistent)
+++ thunk2.C (revision 816)
@@ -0,0 +1,27 @@
+// { dg-do compile { target i?86-*-* x86_64-*-* } }
+// { dg-require-effective-target ilp32 }
+// { dg-options -w }
+
+struct A {
+ virtual void f2 ();
+ virtual void f3 ();
+};
+
+struct B : virtual public A {
+ virtual void f3 ();
+};
+
+struct C : public A, public B {
+ virtual void f4 ();
+};
+
+struct D : virtual public B, virtual public C, virtual public A
+{
+ virtual void f5 ();
+ virtual void f6 ();
+ virtual void f3 ();
+};
+
+void D::f3 () {}
+
+// { dg-final { scan-assembler _ZTvn4_n20_N1D2f3Ev } }
thunk2.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: thunk4.C
===================================================================
--- thunk4.C (nonexistent)
+++ thunk4.C (revision 816)
@@ -0,0 +1,24 @@
+// { dg-require-weak "" }
+// { dg-final { scan-assembler ".weak\[ \t\]_?_ZThn._N7Derived3FooEv" { target { ! { *-*-darwin* } } } } }
+// { dg-final { scan-assembler ".weak_definition\[ \t\]_?_ZThn._N7Derived3FooEv" { target { *-*-darwin* } } } }
+
+struct Base
+{
+ virtual void Foo ();
+};
+
+struct Filler
+{
+ virtual void Baz ();
+};
+
+struct Derived : Filler, Base
+{
+ virtual void Foo ();
+};
+
+inline void Derived::Foo ()
+{
+}
+
+Derived f;
thunk4.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: structret1.C
===================================================================
--- structret1.C (nonexistent)
+++ structret1.C (revision 816)
@@ -0,0 +1,31 @@
+// { dg-do run { target ia64-*-* } }
+// { dg-options "-fabi-version=0" }
+
+extern "C" void abort ();
+
+struct ConstructedObject {
+ ConstructedObject() {};
+ ~ConstructedObject() {};
+ ConstructedObject(const ConstructedObject &from) {};
+};
+
+struct FrameworkObject {
+ ConstructedObject action();
+};
+
+ConstructedObject FrameworkObject::action() {
+ void *r32, *r33;
+
+ asm("mov %0 = r32\nmov %1 = r33" : "=r"(r32), "=r"(r33) : );
+ if (this != r33) {
+ abort ();
+ }
+}
+
+int main()
+{
+ FrameworkObject slawa;
+ slawa.action();
+ return 0;
+}
+
structret1.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: macro1.C
===================================================================
--- macro1.C (nonexistent)
+++ macro1.C (revision 816)
@@ -0,0 +1,5 @@
+// { dg-options "-fabi-version=1" }
+
+#if __GXX_ABI_VERSION != 102
+#error "Incorrect value of __GXX_ABI_VERSION"
+#endif
macro1.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: param2.C
===================================================================
--- param2.C (nonexistent)
+++ param2.C (revision 816)
@@ -0,0 +1,18 @@
+// PR target/20795
+// Test passing aligned empty aggregate
+// { dg-do compile }
+
+struct S { union {} a; } __attribute__((aligned));
+
+S
+foo (S arg)
+{
+ return arg;
+}
+
+void
+bar (void)
+{
+ S arg;
+ foo (arg);
+}
param2.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: vcall1.C
===================================================================
--- vcall1.C (nonexistent)
+++ vcall1.C (revision 816)
@@ -0,0 +1,36 @@
+// { dg-do run }
+// { dg-options "-w" }
+
+extern "C" void abort ();
+
+struct B;
+
+B* b;
+
+struct A {
+ virtual void f () {}
+};
+
+struct B : virtual public A {
+ B () {
+ b = this;
+ ((A*) this)->f ();
+ }
+
+ virtual void f () {
+ if (this != b)
+ abort ();
+ }
+};
+
+struct C : public B {
+};
+
+struct D : public C, public B {
+ virtual void f () {}
+};
+
+int main () {
+ D d;
+}
+
vcall1.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: bitfield10.C
===================================================================
--- bitfield10.C (nonexistent)
+++ bitfield10.C (revision 816)
@@ -0,0 +1,5 @@
+// { dg-options "-w" }
+
+struct S {
+ int i : 64;
+};
bitfield10.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: empty5.C
===================================================================
--- empty5.C (nonexistent)
+++ empty5.C (revision 816)
@@ -0,0 +1,17 @@
+// { dg-options "-fabi-version=0" }
+
+struct A {};
+
+struct B {
+ A a;
+ virtual void f () {}
+};
+
+struct C : public B, public A {};
+
+C c;
+
+int main () {
+ if ((void*) (A*) &c != &c)
+ return 1;
+}
empty5.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: bitfield12.C
===================================================================
--- bitfield12.C (nonexistent)
+++ bitfield12.C (revision 816)
@@ -0,0 +1,5 @@
+// { dg-options "-Wabi -fabi-version=1" }
+
+struct S { // { dg-warning "ABI" }
+ char c : 1024; // { dg-warning "width" }
+};
bitfield12.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: empty7.C
===================================================================
--- empty7.C (nonexistent)
+++ empty7.C (revision 816)
@@ -0,0 +1,19 @@
+// { dg-do run { target i?86-*-* x86_64-*-* } }
+// { dg-require-effective-target ilp32 }
+// { dg-options "-fabi-version=0" }
+
+struct S1 {};
+struct S2 { virtual void f () {} S1 s1[4]; };
+struct S3 : virtual public S2 {};
+struct S4 : virtual public S2 { int i; };
+struct S5 : public S3, virtual public S4 {};
+struct S6 { S5 s5; };
+struct S7 { S1 s1[5]; };
+struct S8 : public S1, public S6, virtual public S7 { };
+
+S8 s8;
+
+int main () {
+ if ((char *)(S7 *)&s8 - (char *)&s8 != 24)
+ return 1;
+}
empty7.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: empty9.C
===================================================================
--- empty9.C (nonexistent)
+++ empty9.C (revision 816)
@@ -0,0 +1,17 @@
+// { dg-do run { target i?86-*-* x86_64-*-* } }
+// { dg-require-effective-target ilp32 }
+// { dg-options "-w -fabi-version=0" }
+
+struct E1 {};
+struct E2 : public E1 {
+ virtual void f ();
+};
+struct E3 : virtual public E1 {
+};
+struct S : public E2, virtual public E3 {
+};
+
+int main () {
+ if (sizeof (S) != 12)
+ return 1;
+}
empty9.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: dtor2.C
===================================================================
--- dtor2.C (nonexistent)
+++ dtor2.C (revision 816)
@@ -0,0 +1,14 @@
+// { dg-do compile }
+// { dg-options "-Wabi -fabi-version=1" }
+
+struct A {
+ virtual void a ();
+};
+
+struct B {
+ virtual ~B ();
+};
+
+struct C : public A, public B { // { dg-warning "virtual" }
+ virtual void c ();
+};
dtor2.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: local1-a.cc
===================================================================
--- local1-a.cc (nonexistent)
+++ local1-a.cc (revision 816)
@@ -0,0 +1,14 @@
+struct B {
+ virtual void b() {}
+};
+
+static B* f() {
+ struct D : public B {
+ };
+
+ return new D;
+}
+
+B* g() {
+ return f();
+}
Index: inline1.C
===================================================================
--- inline1.C (nonexistent)
+++ inline1.C (revision 816)
@@ -0,0 +1,6 @@
+struct S {
+ S() {}
+ virtual void g() {}
+};
+
+// { dg-final { scan-assembler-not "_ZTV1S" } }
inline1.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: vbase10.C
===================================================================
--- vbase10.C (nonexistent)
+++ vbase10.C (revision 816)
@@ -0,0 +1,14 @@
+// { dg-do compile }
+// -fpack-struct is necessary because the code below assumes the initial
+// packing is larger than 1, which cannot ge guaranteed for all targets.
+// { dg-options "-Wabi -fabi-version=1 -fpack-struct=8" }
+// On ARM processors, the alignment of B will be 4 even though it
+// contains only a single "char". That would avoids the situation
+// that the warning below is designed to catch. We therefore
+// explicitly set the default structure alignment to 1.
+// { dg-options "-Wabi -fabi-version=1 -mstructure-size-boundary=8" { target arm*-*-* } }
+
+struct A { virtual void f(); char c1; };
+struct B { B(); char c2; };
+struct C : public A, public virtual B {}; // { dg-warning "ABI" }
+
vbase10.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: mangle20-1.C
===================================================================
--- mangle20-1.C (nonexistent)
+++ mangle20-1.C (revision 816)
@@ -0,0 +1,19 @@
+// { dg-do compile }
+// { dg-options "-fabi-version=2" }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 15 Dec 2003
+
+// PR 9043
+// mangled array types in templates
+
+template void f(int (*)[2]) {}
+template void g(int (*)[I+2]) {}
+
+static const int I=1;
+static const int J=2;
+
+template void f<1>(int (*)[2]);
+// { dg-final { scan-assembler "\n_?_Z1fILi1EEvPA2_i\[: \t\n\]" } }
+template void g<1>(int (*)[3]);
+// { dg-final { scan-assembler "\n_?_Z1gILi1EEvPAplT_Li2E_i\[: \t\n\]" } }
mangle20-1.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: vbase12.C
===================================================================
--- vbase12.C (nonexistent)
+++ vbase12.C (revision 816)
@@ -0,0 +1,14 @@
+// { dg-do run }
+// { dg-options "-fabi-version=0" }
+
+struct A {};
+struct B { A a; virtual void f () {} };
+struct C : public B, virtual public A {};
+struct D : public C, virtual public A {};
+
+D d;
+
+int main () {
+ if (((char*)(A*)&d - (char*)&d) != 0)
+ return 1;
+}
vbase12.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: bitfield2.C
===================================================================
--- bitfield2.C (nonexistent)
+++ bitfield2.C (revision 816)
@@ -0,0 +1,34 @@
+// { dg-do run }
+// { dg-options "-ansi -pedantic-errors -fsigned-bitfields" }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 15 Dec 2001
+
+typedef int Int;
+typedef signed int SInt;
+typedef unsigned int UInt;
+
+struct A
+{
+ SInt bitS : 1; // signed
+ UInt bitU : 1; // unsigned
+ Int bit : 1; // signedness by -f{signed,unsigned}-bitfields
+};
+
+int main ()
+{
+ A a;
+
+ a.bitS = 1; // { dg-warning "overflow" }
+ a.bitU = 1;
+ a.bit = 1; // { dg-warning "overflow" }
+
+ if (a.bitS != -1)
+ return 1;
+ if (a.bitU != 1)
+ return 2;
+ if (a.bit != -1)
+ return 3;
+
+ return 0;
+}
bitfield2.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: vbase14.C
===================================================================
--- vbase14.C (nonexistent)
+++ vbase14.C (revision 816)
@@ -0,0 +1,6 @@
+// { dg-options "-Wabi -fabi-version=1" }
+
+struct E1 {};
+struct E2 : public E1 {}; // { dg-warning "layout" }
+struct E : public E1, public E2 {}; // { dg-warning "layout|ambiguity" }
+struct N : public E { virtual void f () {} }; // { dg-warning "nearly" }
vbase14.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: bitfield4.C
===================================================================
--- bitfield4.C (nonexistent)
+++ bitfield4.C (revision 816)
@@ -0,0 +1,41 @@
+/* { dg-do run { target { pcc_bitfield_type_matters || default_packed } } } */
+
+/* Check bitfields and non-bitfields are aligned & sized similarly.
+
+ Copyright (C) 2002 Free Software Foundation Inc
+ Contributed by Nathan Sidwell
+*/
+
+#include
+#include
+
+static int fail;
+
+#define CHECK1(N, T) do { \
+ typedef struct Field_##N { char c; T f; } Field_##N; \
+ typedef struct BitField_##N { char c; T f : sizeof (T) * CHAR_BIT; } BitField_##N; \
+ if (sizeof (Field_##N) != sizeof (BitField_##N)) { \
+ fail = 1; printf ("sizeof %s failed\n", #T); \
+ } \
+ if (__alignof__ (Field_##N) != __alignof__ (BitField_##N)) { \
+ fail = 1; printf ("__alignof__ %s failed\n", #T); \
+ } \
+} while (0)
+
+#define CHECK(N, T) do { \
+ CHECK1(N, T); \
+ CHECK1 (s##N, signed T); \
+ CHECK1 (u##N, unsigned T); \
+} while (0)
+
+int main ()
+{
+
+ CHECK (c, char);
+ CHECK (s, short);
+ CHECK (i, int);
+ CHECK (l, long);
+ CHECK (ll, long long);
+
+ return fail;
+}
bitfield4.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: mangle22.C
===================================================================
--- mangle22.C (nonexistent)
+++ mangle22.C (revision 816)
@@ -0,0 +1,9 @@
+// PR c++/16240
+// { dg-options "-fabi-version=3" }
+
+void foo(char);
+template
struct CB {};
+
+void g(CB i) {}
+
+// { dg-final { scan-assembler "\n_?_Z1g2CBIL_Z3foocEE\[: \t\n\]" } }
mangle22.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: bitfield6.C
===================================================================
--- bitfield6.C (nonexistent)
+++ bitfield6.C (revision 816)
@@ -0,0 +1,14 @@
+// { dg-do run }
+// { dg-options "-w -fabi-version=0" }
+
+#include
+
+union U {
+ int i: 4096;
+};
+
+int main () {
+ if (sizeof (U) * std::numeric_limits::digits != 4096)
+ return 1;
+}
+
bitfield6.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: covariant2.C
===================================================================
--- covariant2.C (nonexistent)
+++ covariant2.C (revision 816)
@@ -0,0 +1,32 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 12 Dec 2003
+// Origin: grigory@stl.sarov.ru
+
+// PR c++/12881. ICE in thunk generation
+
+struct c1 {};
+
+struct c3 : virtual c1
+{
+ virtual c1* f6() {};
+ int i;
+};
+
+struct c6 : virtual c3 { };
+
+struct c7 : c3
+{
+ virtual c3* f6() {};
+};
+
+struct c24 : virtual c7
+{
+ virtual c6* f6();
+};
+
+c6* c24::f6() { return 0; }
+
+struct c31 : c24 {};
+
covariant2.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: mangle24.C
===================================================================
--- mangle24.C (nonexistent)
+++ mangle24.C (revision 816)
@@ -0,0 +1,13 @@
+// Test mangling of __float80.
+// The C++ ABI document says __float80 is mangled as "e". It
+// also says that "long double" is mangled as "e", so these conflict on
+// ia64-hpux where "long double" is "e" and __float80 is "u9__float80".
+// Origin: Joseph Myers
+// { dg-do compile { target i?86-*-* x86_64-*-* ia64-*-* } } */
+// { dg-options "" } */
+// { dg-options "-mmmx" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+// { dg-final { scan-assembler "_Z1fe" { target i?86-*-* x86_64-*-* } } } */
+// { dg-final { scan-assembler "_Z1fe" { target { ia64-*-* && { ! "ia64-*-hpux*" } } } } } */
+// { dg-final { scan-assembler "_Z1fu9__float80" { target ia64-*-hpux* } } } */
+
+int f(__float80 x) { return 0; }
mangle24.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: vbase8-22.C
===================================================================
--- vbase8-22.C (nonexistent)
+++ vbase8-22.C (revision 816)
@@ -0,0 +1,80 @@
+// { dg-options -w }
+// { dg-do run }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 27 Jul 2001
+
+// Origin stefan@space.twc.de
+// Bug 3145 case 22. Horribly complicated class hierarchy
+
+class C0
+{};
+class C1
+ : public C0
+{};
+class C2
+ : public C1
+ , virtual public C0
+{};
+class C3
+ : virtual public C0
+ , virtual public C2
+ , virtual public C1
+{};
+class C4
+ : virtual public C2
+ , public C1
+ , virtual public C3
+ , public C0
+{};
+class C5
+ : virtual public C0
+ , virtual public C4
+ , public C1
+ , virtual public C2
+ , virtual public C3
+{};
+class C6
+ : public C0
+ , virtual public C1
+ , public C5
+ , public C2
+ , virtual public C3
+ , virtual public C4
+{};
+class C7
+ : virtual public C1
+ , public C5
+ , virtual public C6
+ , virtual public C4
+ , virtual public C3
+ , virtual public C0
+{};
+class C8
+ : virtual public C6
+ , virtual public C1
+ , virtual public C2
+ , public C3
+ , virtual public C4
+{};
+class C9
+ : public C4
+ , virtual public C2
+ , virtual public C8
+ , public C3
+ , public C1
+ , public C6
+ , public C5
+{};
+main() {
+ C0 c0;
+ C1 c1;
+ C2 c2;
+ C3 c3;
+ C4 c4;
+ C5 c5;
+ C6 c6;
+ C7 c7;
+ C8 c8;
+ C9 c9;
+}
vbase8-22.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: key2.C
===================================================================
--- key2.C (nonexistent)
+++ key2.C (revision 816)
@@ -0,0 +1,16 @@
+// On Darwin, key methods that are inline result in comdat style things. */
+// PR darwin/25908
+
+// { dg-do compile { target *-*-darwin* } }
+// { dg-final { scan-assembler ".globl __ZTV1f\\n .weak_definition __ZTV1f\\n .section __DATA,__const_coal,coalesced" } }
+// { dg-final { scan-assembler ".globl __ZTS1f\\n .weak_definition __ZTS1f\\n .section __TEXT,__const_coal,coalesced" } }
+// { dg-final { scan-assembler ".globl __ZTI1f\\n .weak_definition __ZTI1f\\n .section __DATA,__const_coal,coalesced" } }
+
+class f
+{
+ virtual void g();
+ virtual void h();
+} c;
+inline void f::g() {}
+int sub(void)
+{}
key2.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: bitfield8.C
===================================================================
--- bitfield8.C (nonexistent)
+++ bitfield8.C (revision 816)
@@ -0,0 +1,22 @@
+// { dg-do run { target i?86-*-* x86_64-*-* } }
+// { dg-options "-fabi-version=0" }
+// { dg-require-effective-target ilp32 }
+
+
+struct A {
+ virtual void f() {}
+ int f1 : 1;
+};
+
+struct B : public A {
+ int f2 : 31;
+ int f3 : 4;
+ int f4 : 3;
+};
+
+int main ()
+{
+ if (sizeof (B) != 16)
+ return 1;
+}
+
bitfield8.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: covariant4.C
===================================================================
--- covariant4.C (nonexistent)
+++ covariant4.C (revision 816)
@@ -0,0 +1,46 @@
+// { dg-do run }
+
+// Copyright (C) 2005 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 11 Feb 2005
+
+// Origin: bredelin@ucla.edu
+// Bug 19891: Incorrect covariant vtables
+
+struct Model {
+ bool full_tree;
+ virtual Model* clone() const =0;
+ virtual const char *name() const =0;
+ virtual ~Model() {}
+};
+
+struct R: virtual public Model {
+ virtual R* clone() const =0;
+};
+struct A: virtual public Model {
+ virtual A* clone() const=0;
+};
+struct RA: public R, public A {
+ virtual RA* clone() const=0;
+};
+
+static const char *string = "EQU";
+
+struct EQU: public RA {
+ virtual EQU* clone() const {return new EQU(*this);}
+ const char *name() const {return string;}
+};
+
+int main() {
+ Model* M1 = new EQU();
+ Model* M2 = M1->clone();
+ Model* M3 = M2->clone();
+
+ if (M1->name () != string)
+ return 1;
+ if (M2->name () != string)
+ return 2;
+ if (M3->name () != string)
+ return 3;
+
+ return 0;
+}
covariant4.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: align1.C
===================================================================
--- align1.C (nonexistent)
+++ align1.C (revision 816)
@@ -0,0 +1,27 @@
+// This was failuring on powerpc-darwin and powerpc-aix as
+// we were taking the embeded type as the first field decl.
+// This was PR target/18761.
+// { dg-do run }
+
+
+union A {
+ double d;
+};
+union B {
+ enum E { e };
+ double d;
+};
+struct AlignA {
+ char c;
+ A a;
+};
+struct AlignB {
+ char c;
+ B b;
+};
+extern "C" void abort ();
+int main () {
+ if ( __alignof__ (AlignA) != __alignof__ (AlignB))
+ abort ();
+}
+
align1.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: mangle26.C
===================================================================
--- mangle26.C (nonexistent)
+++ mangle26.C (revision 816)
@@ -0,0 +1,14 @@
+// Test of std mangling
+
+// { dg-do compile }
+// { dg-options "-fno-inline" }
+
+namespace std {
+ struct A {
+ virtual void f () { }
+ };
+}
+
+std::A a;
+
+// { dg-final { scan-assembler "\n_?_ZNSt1AC1Ev\[: \t\n\]" } }
mangle26.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: mangle28.C
===================================================================
--- mangle28.C (nonexistent)
+++ mangle28.C (revision 816)
@@ -0,0 +1,14 @@
+// Test of std::basic_istream
> mangling
+
+// { dg-do compile }
+// { dg-options "-fno-inline" }
+
+namespace std {
+ template struct char_traits;
+
+ template struct basic_istream { basic_istream(){} };
+}
+
+std::basic_istream > s1;
+
+// { dg-final { scan-assembler "\n_?_ZNSiC1Ev\[: \t\n\]" } }
mangle28.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: vbase1.C
===================================================================
--- vbase1.C (nonexistent)
+++ vbase1.C (revision 816)
@@ -0,0 +1,60 @@
+// { dg-do compile }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 5 Sept 2001
+
+// Bug 3986. Another indirect primary base problem.
+
+struct Consts
+{
+};
+
+struct MathLib :
+ virtual Consts
+{
+};
+
+struct Parallel :
+ virtual Consts
+{
+};
+
+struct Particles :
+ virtual MathLib,
+ virtual Parallel
+{
+};
+
+struct Ring :
+ virtual Particles
+{
+};
+
+struct Injection :
+ virtual Particles,
+ virtual Ring
+{
+};
+
+struct LSpaceCharge :
+ virtual Ring,
+ virtual Injection
+{
+};
+
+struct Bump :
+ virtual Consts
+{
+};
+
+struct Output :
+ virtual Injection,
+ virtual Bump
+{
+};
+
+struct Plots :
+ virtual LSpaceCharge,
+ virtual Output
+{
+};
vbase1.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: mangle2.C
===================================================================
--- mangle2.C (nonexistent)
+++ mangle2.C (revision 816)
@@ -0,0 +1,19 @@
+// Test that we handle mangling of statics in inlines properly.
+// { dg-options -fno-weak }
+// { dg-do run }
+
+inline int f ()
+{
+ static int nested;
+ nested = 24;
+ {
+ static int nested;
+ nested = 42;
+ }
+ return (nested != 24);
+}
+
+int main()
+{
+ return f ();
+}
mangle2.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: mangle4.C
===================================================================
--- mangle4.C (nonexistent)
+++ mangle4.C (revision 816)
@@ -0,0 +1,24 @@
+// Test mangling of type casts
+// { dg-do compile }
+
+class A {};
+class B : public A {};
+
+template
class C {};
+template class D {};
+template class E {};
+
+template void f(D &, C(b)> &) {} // { dg-error "" }
+template void g(D &, E(b)> &) {} // { dg-error "" }
+
+B b;
+
+int main()
+{
+ C(&b)> c; // { dg-error "" }
+ D<&b> d;
+ E(&b)> e; // { dg-error "" }
+ f(d, c);
+ g(d, e);
+}
+
mangle4.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: vague1.C
===================================================================
--- vague1.C (nonexistent)
+++ vague1.C (revision 816)
@@ -0,0 +1,17 @@
+// Test that we don't emit unneeded copies of static data member template
+// instantiations.
+
+// Disable debug info so we don't get confused by the symbol name there.
+// { dg-options "-g0" }
+
+template
struct A {
+ static const T t = 0;
+};
+
+template const T A::t;
+
+int i;
+int main ()
+{
+ i = A::t; // Should just use the value
+}
vague1.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: mangle6.C
===================================================================
--- mangle6.C (nonexistent)
+++ mangle6.C (revision 816)
@@ -0,0 +1,23 @@
+/* Check that __int128 types are mangled. */
+/* { dg-do compile { target mips*-*-* } } */
+
+#ifdef __mips64
+typedef int int128 __attribute__ ((mode(TI)));
+typedef unsigned int uint128 __attribute__ ((mode(TI)));
+
+struct S
+{
+ int128 i;
+ int128 func1 (int128) const { return i; }
+ uint128 func2 (uint128) const { return i; }
+};
+
+int128 (S::*ptr1) (int128) const = &S::func1;
+uint128 (S::*ptr2) (uint128) const = &S::func2;
+#else
+const char *str1 = "_ZNK1S5func1En";
+const char *str2 = "_ZNK1S5func2Eo";
+#endif
+
+/* { dg-final { scan-assembler _ZNK1S5func1En } } */
+/* { dg-final { scan-assembler _ZNK1S5func2Eo } } */
mangle6.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: vbase9.C
===================================================================
--- vbase9.C (nonexistent)
+++ vbase9.C (revision 816)
@@ -0,0 +1,29 @@
+// { dg-do compile }
+
+// Copyright (C) 2002 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 17 Mar 2002
+// Origin: Jakub Jelinek
+
+// PR 5681. ICE in build_secondary_vtable
+
+struct A {
+ virtual int f1 ();
+};
+
+struct B : virtual A {};
+
+struct C {
+ virtual int f2 ();
+};
+
+struct E : A {};
+
+struct D : E, B {};
+
+struct F : virtual D {};
+
+struct G : virtual F, C {};
+
+struct H : virtual F {};
+
+struct I : G, H {};
vbase9.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: cookie2.C
===================================================================
--- cookie2.C (nonexistent)
+++ cookie2.C (revision 816)
@@ -0,0 +1,16 @@
+// { dg-options "-fabi-version=1" }
+
+void *operator new[](__SIZE_TYPE__, void *);
+
+struct A {
+ ~A(){}
+};
+
+int main()
+{
+ A * a = (A*) new char[20];
+ A * b = new(a) A[3];
+ // In the 3.2 ABI, a cookie was allocated in this case.
+ if (a == b)
+ return 1;
+}
cookie2.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: mangle8.C
===================================================================
--- mangle8.C (nonexistent)
+++ mangle8.C (revision 816)
@@ -0,0 +1,16 @@
+// Red Hat bugzilla 65035
+// Bug: We were encoding the name of the instantiation as 'operator int'
+// rather than 'operator T'.
+// { dg-do compile }
+
+struct C {
+ template
+ operator T ();
+};
+
+template
+C::operator T () { return 0; }
+
+template C::operator int ();
+
+// { dg-final { scan-assembler _ZN1CcvT_IiEEv } }
mangle8.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