plateform
stringclasses
1 value
repo_name
stringclasses
2 values
name
stringlengths
1
78
ext
stringclasses
2 values
path
stringlengths
15
1.11k
size
int64
1
8.55M
source_encoding
stringclasses
11 values
md5
stringlengths
32
32
text
stringlengths
0
8.49M
google
chromium
assign1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/expr/assign1.C
648
utf_8
39cb0859475193884781cf1fe587c70e
// { dg-do run } // PR c++/13387. Clobbered tail padding of base inline void *operator new (__SIZE_TYPE__, void *ptr) { return ptr; } struct Base { Base() : i(0), c(0) {} int i; char c; }; struct Sub : Base { Sub () : d(0) {} char d; }; int main() { Sub sub; char base_alias[size...
google
chromium
call2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/expr/call2.C
312
utf_8
11d589082fe10f4614aafaae41200569
// { dg-do compile } // PR c++/12184. ICE class C; class D; bool mm(D); void g(C& f) { mm(f); // { dg-error "parameter" "" } }
google
chromium
ptrmem1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/expr/ptrmem1.C
537
utf_8
d108472b30fd8a2ccb535bb57ff25d0a
// { dg-do compile } // PR 11766. ICE template<typename T> struct normal_iterator { normal_iterator(const T& __i); }; template<typename _Tp> struct vector { void end() const { normal_iterator<const _Tp*> (this->pt); } void size() const { end(); } _Tp* pt; }; struct MuonTag { typedef void (MuonTag::*Select...
google
chromium
ptrmem6
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/expr/ptrmem6.C
188
utf_8
39041dce87ae406151a5cca310cd2ce4
// PR C++/21614 // { dg-additional-sources "ptrmem6a.C" } // { dg-do run } extern struct Z *p; extern int (Z::*m) (); int main () { if ((p->*m)() == 7) return 0; return 1; }
google
chromium
dtor4
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/expr/dtor4.C
89
utf_8
96485302525dddaf878ba9c9bd2027a5
typedef int C; typedef double D; void f () { C o; o.D::~C (); // { dg-error "" } }
google
chromium
anew3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/expr/anew3.C
545
utf_8
88cfba5bf8bdd95998bb48be16446076
// { dg-do run } // PR 11228: array operator new, with zero-initialization and a variable sized array. // Regression test for PR #include <new> #include <stdlib.h> #include <string.h> struct X { int a; double b; }; X* allocate(int n) { void *p; p = malloc(n * sizeof (X)); memset (p, 0xff, n * sizeof(X)); r...
google
chromium
bitfield6
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/expr/bitfield6.C
82
utf_8
fd46219c0040c2b4569b36afd840025b
// PR c++/30274 struct S { bool x : 4; }; S s; void f() { ++s.x = false; }
google
chromium
pr29066
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/expr/pr29066.C
451
utf_8
60bb03281297f707f9874467907ac6cf
// PR c++/29066 // Test pointer to member function comparison // { dg-do run } extern "C" void abort (void); struct X { virtual void a(void)=0; }; struct Z : public X { void a(void) {} }; void f(X *obj) { void (X::*xp)(void) = 0; void (X::*xp2)(void) = 0; xp = &X::a; if (xp == xp2) { abort(...
google
chromium
bitfield2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/expr/bitfield2.C
136
utf_8
38db662a9b8573d4e2269a76f0f370f9
// PR c++/27979 class Ast { enum AstKind { }; const AstKind kind : 8; void foo(AstKind k) { } void bar(void) { foo(kind); } };
google
chromium
enum1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/expr/enum1.C
126
utf_8
fd680877ab1cfa7b118501bb1e133e2a
// { dg-do run } extern "C" void abort(); int main() { enum { shelf = 4 } t = shelf; if (!(t & shelf)) abort (); }
google
chromium
static_cast6
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/expr/static_cast6.C
260
utf_8
b908cbd89626f67c64bd034d95994258
// PR c++/21853 struct blah { int a; }; int main( int argc, char ** argv ) { int blah::* ptdma = &blah::a; const void *ptdmv = static_cast< void * >( &ptdma ); int blah::* const ptdmb = * static_cast< int blah::* const * >( ptdmv ); return 0; }
google
chromium
comma1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/expr/comma1.C
286
utf_8
0bfd27616952c8ba004102d8eaa6d65c
// { dg-do run } extern "C" void abort (); struct gtst { unsigned char data[2]; }; static struct gtst s; int main(int argc, char *argv[]) { unsigned char * pc; struct gtst * ps; ps = &s; pc = (ps->data[0]='A', ps->data); if (&s.data[0] != pc) abort(); return 0; }
google
chromium
static_cast1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/expr/static_cast1.C
62
utf_8
89139f7a57a0c8dd7c105624b328d423
void foo(int x) { static_cast<const unsigned int&>(x); }
google
chromium
lval3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/expr/lval3.C
85
utf_8
73d538ed393311f1cc1a3918a0194983
// i++ is never an lvalue void f() { bool i = 0; i++ = 3; // { dg-error "" } }
google
chromium
ptrmem6a
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/expr/ptrmem6a.C
104
utf_8
014c6e35722352b75d65d090cb999dd7
struct Z { int f(); }; int Z::f() { return 7; } struct Z z; int (Z::*m)() = &Z::f; struct Z*p = &z;
google
chromium
lval1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/expr/lval1.C
110
utf_8
e9c430238d4efd57c1f944c12443406d
void f () { int n; (char) n = 1; // { dg-error "" } }
google
chromium
mangle23
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/mangle23.C
209
utf_8
e9b6e0cbb0fdfc7c2d759709e120ac89
// PR c++/16240 // { dg-options "-fabi-version=2 -Wno-abi" } void foo(char); template<void (&)(char)> struct CB {}; void g(CB<foo> i) {} // { dg-final { scan-assembler "\n_?_Z1g2CBILZ3foocEE\[: \t\n\]" } }
google
chromium
mangle21
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/mangle21.C
268
utf_8
19d5bab4f182e97a38690a5ff4541700
// 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); } }
google
chromium
thunk3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/thunk3.C
425
utf_8
64d1aa038d30ffe9d535aa3f5ea90c51
// { 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 { virtu...
google
chromium
vthunk3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/vthunk3.C
432
utf_8
6881f6a907aed22e3604db9a81d71753
// { 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...
google
chromium
mangle39
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/mangle39.C
465
utf_8
f57f07637ad084cc2e713f00ba3f05bd
// PR c++/42338 // { dg-options "-std=c++0x -fabi-version=5" } // { dg-final { scan-assembler "_Z1fIPiEDTcmppfp_Li0EET_" } } // { dg-final { scan-assembler "_Z1gIiEvRK1AIT_EDTixfL0p_Li0EE" } } template<typename T> auto f(T t) -> decltype(++t, 0) { ++t; return 0; } template <class T> struct A { T operator[](int)...
google
chromium
bitfield10
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/bitfield10.C
52
utf_8
9966069a163a3254b4d24ab2f38965c2
// { dg-options "-w" } struct S { int i : 64; };
google
chromium
macro2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/macro2.C
120
utf_8
06f0193b05c4ae743af4e38aec8d1122
// { dg-options "-fabi-version=2" } #if __GXX_ABI_VERSION != 1002 #error "Incorrect value of __GXX_ABI_VERSION" #endif
google
chromium
mangle10
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/mangle10.C
243
utf_8
e284ef1906cd5f1de0a8f3009ac761ff
// { dg-options "-fabi-version=0" } template <template <typename> class Q> void f (typename Q<int>::X) {} template <typename Q> struct S { typedef int X; }; template void f<S> (int); // { dg-final { scan-assembler _Z1fI1SEvNT_IiE1XE } }
google
chromium
mangle26
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/mangle26.C
207
utf_8
39be8be8221e8bfcf3cf9fad019a3ed1
// Test of std mangling // { dg-do compile } // { dg-options "-fno-inline" } namespace std { struct A { A() { } }; } std::A a; // { dg-final { scan-assembler "\n_?_ZNSt1AC\[12\]Ev\[: \t\n\]" } }
google
chromium
vbase1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/vbase1.C
685
utf_8
6b15aad70c63bb9bebfefe5096394d41
// { dg-do compile } // 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, virtua...
google
chromium
vbase13
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/vbase13.C
357
utf_8
2c858a9c525d6228c68ebd9b6adc4724
// { 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*)...
google
chromium
cookie2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/cookie2.C
263
utf_8
3bd4bb420676c4310003c9fffe83abe9
// { 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; }
google
chromium
mangle44
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/mangle44.C
260
utf_8
9c988f84715431366d71a7c072196e1b
// PR c++/45008 template <typename T> struct A { void fn1 () { struct Nested { static void fn2 () { } }; Nested::fn2(); } }; void fn3 () { A<double> a; a.fn1(); } // { dg-final { scan-assembler-not "_ZZN1AIT_E3fn1EvEN6Nested3fn2Ev" } }
google
chromium
bitfield9
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/bitfield9.C
197
utf_8
14697006c1045d90c0f505dbfc8c5072
// { 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; }
google
chromium
mangle3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/mangle3.C
450
utf_8
7ea778117a3d82dba90f3647d292b1c5
// Test mangling of type casts // { dg-do compile } template<int i> class A {}; template<bool b> class B {}; template<int i> void f(A<i> &, B<bool(i)> &) {} template<int i> void g(A<i> &, B<static_cast<bool>(i)> &) {} int main() { A<1> a; B<true> b; f(a, b); g(a, b); } // { dg-final { scan-assembler "\n_?_Z...
google
chromium
macro1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/macro1.C
119
utf_8
5a7979aab90c38484879bf5742d1bfae
// { dg-options "-fabi-version=1" } #if __GXX_ABI_VERSION != 102 #error "Incorrect value of __GXX_ABI_VERSION" #endif
google
chromium
pr39188-2a
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/pr39188-2a.C
165
utf_8
fe56cd912c0f058bb4436bed7ee10cea
// PR c++/39188 // { dg-do run } // { dg-options "-O2" } // { dg-additional-sources "pr39188-2b.C" } #include "pr39188-2.h" int x (int i) { return f<int> (i); }
google
chromium
offsetof
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/offsetof.C
578
utf_8
a6fb1aab1fbc0b1d04911a6330e496f1
// 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 wel...
google
chromium
structret1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/structret1.C
541
utf_8
51349b3acb94d1dc1909aec6ba384dae
// { 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 Fra...
google
chromium
mangle6
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/mangle6.C
618
utf_8
91c28df1b9796be812f1b833d650c6b1
/* 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...
google
chromium
mangle9
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/mangle9.C
196
utf_8
7e14b0353ae53e5a5a8bcf850c4fcbc9
// { dg-options "-fabi-version=0" } template <typename Q> void f (typename Q::X) {} struct S { typedef int X; }; template void f<S> (int); // { dg-final { scan-assembler _Z1fI1SEvNT_1XE } }
google
chromium
mangle12
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/mangle12.C
251
utf_8
cbe0f93f9d6465f2cfc06b83795f495a
// { dg-options "-Wabi -fabi-version=1" } template <template <typename> class Q> void f (typename Q<int>::X) {} // { dg-warning "mangle" } template <typename Q> struct S { typedef int X; }; template void f<S> (int); // { dg-message "required" }
google
chromium
mangle18-1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/mangle18-1.C
577
utf_8
bfbdcf19399c74a6691d65ef0ba49cd3
// { dg-do compile } // { dg-options "-fabi-version=2" } // PR 13241 // mangled template arguments that are external objects incorrectly extern "C" void Foo (); namespace NMS { extern "C" int V; } template <void (*)()> struct S {}; template <int *> struct T {}; void f (S<Foo>){} // { dg-final { scan-assembler "\n_?_...
google
chromium
layout3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/layout3.C
418
utf_8
6372326d116dead9b369290e7a9ccb46
// { 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...
google
chromium
key2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/key2.C
628
utf_8
566b277074549a74732c7ed51a289742
// 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)?\\n .align" } } // { dg-final { scan-assembler ".globl __ZTS...
google
chromium
arm_va_list2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/arm_va_list2.C
141
utf_8
e1aa0c563084dd7030c3c474c45a09dd
// { dg-do compile } // { dg-options "-Wpsabi" } // { dg-require-effective-target arm_eabi } #include <stdarg.h> #include "arm_va_list2.h"
google
chromium
inline1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/inline1.C
94
utf_8
111786b8402b8dd840adfb9a53cf3aac
struct S { S() {} virtual void g() {} }; // { dg-final { scan-assembler-not "_ZTV1S" } }
google
chromium
guard1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/guard1.C
159
utf_8
81d54a8ce0f88af87b94623f3b24e0b5
// PR c++/41611 // { dg-final { scan-assembler-not "_ZGVZN1A1fEvE1i" } } struct A { static int f() { static int &i = *new int(); return i; } };
google
chromium
mangle25
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/mangle25.C
658
utf_8
ae04b64f75744d4e08d314ffccafb713
// 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". // { dg-do compile { target ia64-*-* i?86-*-* x86_64-*-* } } ...
google
chromium
mangle11
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/mangle11.C
206
utf_8
bfce53319fad93afe4efb49117dd02dc
// { dg-options "-Wabi -fabi-version=1" } template <typename Q> void f (typename Q::X) {} // { dg-warning "mangle" } struct S { typedef int X; }; template void f<S> (int); // { dg-message "required" }
google
chromium
bitfield11
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/bitfield11.C
161
utf_8
e5e5ef8164ac7b43c7f20df7cfcd9b99
// { 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; }
google
chromium
thunk5
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/thunk5.C
226
utf_8
0ec5c22fec9ed33618612b880a806f5c
// PR c++/35067 // The thunks should be weak even on targets without one-only support. // { dg-require-weak "" } // { dg-final { scan-assembler "weak.*ZTv" } } struct A { virtual ~A() { } }; struct B: virtual A { }; B b;
google
chromium
mangle15
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/mangle15.C
249
utf_8
8ffaa1b19590f5f7ddf6464b1d009a9c
// { dg-do compile } // { dg-options "-fabi-version=0" } struct A { template <typename T> int f (); }; typedef int (A::*P)(); template <P> struct S {}; void g (S<&A::f<int> >) {} // { dg-final { scan-assembler _Z1g1SIXadL_ZN1A1fIiEEivEEE } }
google
chromium
vbase11
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/vbase11.C
293
utf_8
144d7001c1ac9ab9c89d8f5c56de4e09
// { 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 () { return 1; }
google
chromium
mangle47
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/mangle47.C
185
utf_8
75d7fbcfe35b540781d8b4eaade27b4a
// PR c++/47132 // { dg-options -std=c++0x } // { dg-final { scan-assembler "_Z1fIiEDToRfp_Li1EET_" } } template <typename T> auto f (T t) -> decltype(t |= 1); int main() { f(1); }
google
chromium
packed1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/packed1.C
448
utf_8
ed79cf5bf3c45230ee9187c4cf51338e
// PR c++/41788 // { dg-do run } // { dg-options "-Wpacked -Wno-attributes" } extern "C" void abort (); struct INNER { virtual int foo() const { return 1; } } __attribute__ ((packed)); struct OUTER { char c; INNER inner; } __attribute__ ((packed)); int main() { OUTER outer; int s = sizeof(outer); int o ...
google
chromium
bitfield12
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/bitfield12.C
124
utf_8
3fd7e30befde66c7c5adb5b41e25923e
// { dg-options "-Wabi -fabi-version=1" } struct S { // { dg-warning "ABI" } char c : 1024; // { dg-warning "width" } };
google
chromium
mangle33
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/mangle33.C
16,396
utf_8
c5d5176bf2a0d86ae5769b300e777296
// Testcase for mangling very long names. #define N \ abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcde...
google
chromium
mangle29
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/mangle29.C
381
utf_8
2c430e967d278da976c5ea2d63efd9c4
// Test of std::basic_ostream<char, std::char_traits<char> > mangling // { dg-do compile } // { dg-options "-fno-inline" } namespace std { template<typename> struct char_traits; template<typename, typename> struct basic_ostream { basic_ostream(){} }; } std::basic_ostream<char,std::char_traits<char> > s1; // { ...
google
chromium
vcall1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/vcall1.C
379
utf_8
c88701df415b47ac9bf5cba84cf379ab
// { 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, pub...
google
chromium
vbase12
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/vbase12.C
268
utf_8
90c43a38beef1adc9c358d0c1f470c6f
// { 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; }
google
chromium
forced
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/forced.C
434
utf_8
6f15172d825edc5509c1d35da3bfb275
// This test only applies to glibc (NPTL) targets. // { dg-do run { target *-*-linux* } } // { dg-options "-pthread" } #include <pthread.h> #include <cxxabi.h> extern "C" int printf (const char *, ...); int main() { try { pthread_exit (0); } catch (abi::__forced_unwind &) { printf ("caught...
google
chromium
arm_va_list
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/arm_va_list.C
449
utf_8
bbaf5f69b74e41af6b2db211ab43bb8f
// { dg-do compile } // { dg-options "-Wno-abi" } // { dg-require-effective-target arm_eabi } // AAPCS \S 7.1.4 requires that va_list be a typedef for "struct // __va_list". The mangling is as if it were "std::__va_list". // #include <stdarg.h> typedef __builtin_va_list va_list; // { dg-final { scan-assembler "\n_Z1...
google
chromium
empty11
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/empty11.C
355
utf_8
5ce11bfa25802ab713c346269c112592
// { 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...
google
chromium
mangle20-1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/mangle20-1.C
566
utf_8
dc5e5444adf348136bebba2aeea75a56
// { dg-do compile } // { dg-options "-fabi-version=2" } // PR 9043 // mangled array types in templates template <int I> void f(int (*)[2]) {} template <int I> 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\...
google
chromium
mangle45
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/mangle45.C
932
utf_8
fb8237ebd0446df7e1ec0f92d5b21005
// Testcase for mangling of parameters used other than in a trailing return type // { dg-options "-std=c++0x -fabi-version=5" } template<class T> void f(T p, decltype(p)) { } // L = 1 template<class T> void g(T p, decltype(p) (*)()) { } // L = 1 // G++ incorrectly rejects these currently. // te...
google
chromium
rtti3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/rtti3.C
870
utf_8
7f1a9a52b90e21fd2a8819748d84fe0f
// PR 20647, we must emit the typeinfo's string as weak, but not the // necessarily the type info object // { dg-require-weak "" } // { dg-skip-if "Linkonce not weak" { *-*-mingw* *-*-cygwin } { "*" } { "" } } // { dg-final { scan-assembler ".weak\[ \t\]_?_ZTSPP1A" { target { ! { *-*-darwin* alpha*-dec-osf* } } } } } ...
google
chromium
vbase15
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/vbase15.C
531
utf_8
49b6dc56ea075b441ba7099041f71417
// { dg-do run } struct Spec { virtual int id () const = 0; }; class D1_1_Spec : public virtual Spec { }; class D1_2_Spec : public virtual Spec { }; class D1_3_Spec : public virtual Spec { }; class D2_1_Spec : public D1_1_Spec, public D1_2_Spec { }; class D2_Spec : public virtual D2_1_Spec, public virtual D1_3_S...
google
chromium
mangle48
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/mangle48.C
439
utf_8
575aec76b36a256b043f2c3dbfc86f15
// Testcase for 'this' mangling // { dg-options -std=c++0x } struct B { template <class U> U f(); }; struct A { B b; // { dg-final { scan-assembler "_ZN1A1fIiEEDTcldtdtdefpT1b1fIT_EEEv" } } template <class U> auto f() -> decltype (b.f<U>()); // { dg-final { scan-assembler "_ZN1A1gIiEEDTcldtptfpT1b1fIT_EEEv"...
google
chromium
pragma-pack1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/pragma-pack1.C
788
utf_8
4a1543932abd77ea1cfba28eecdeeef4
// PR c++/7046 extern "C" int printf (const char *, ...); #pragma pack(4) template <typename X > struct T { char x1; /* Usually 3 padding bytes are added after x1 member. */ int x2; }; template <class T> int f() { struct A { char i1; int i2; }; return sizeof (A); } #pragma pack(1) template...
google
chromium
key1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/key1.C
487
utf_8
a128b5b94590dd451ff32844c5adb5e7
// 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() {} stru...
google
chromium
noreturn1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/noreturn1.C
320
utf_8
6d86ff25fe0e7bc030ff238bd833862a
// Test that attribute noreturn is not part of the mangled name. // { dg-options -fabi-version=0 } void baz (const char *fmt, ...); // { dg-final { scan-assembler "_Z3barPFvPKczE" } } void bar (void (*baz) (const char *fmt, ...) __attribute__ ((noreturn, format (printf, 1, 2)))); void foo () { bar (&baz); }
google
chromium
vbase8-4
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/vbase8-4.C
1,113
utf_8
6083c948c9046f70dfbcdfc448a5f784
// { dg-options -w } // { dg-do run } // 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 pu...
google
chromium
covariant6
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/covariant6.C
991
utf_8
6a1a75e32b0bce4b89b1e513bd694466
struct A { virtual A* f(); }; struct B: virtual A { virtual A* f(); }; struct C: B { virtual C* f(); }; C* C::f() { return 0; } // When we emit C::f, we should emit both thunks: one for B and one for A. // { dg-final { scan-assembler "_ZTch0_v0_n16_N1C1fEv" { target { ilp32 && { ! { ia64-*-hpux* } } } } } } ...
google
chromium
mangle2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/mangle2.C
270
utf_8
2fe54fcb3681eed20518e8a88f7e3849
// 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 (); }
google
chromium
bitfield5
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/bitfield5.C
312
utf_8
7a715981fdef3b0ea85d77633f3443e9
// { 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; };
google
chromium
vbase9
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/vbase9.C
475
utf_8
aa7850bb832428b452c702abac4c2357
// { dg-do compile } // 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 {};
google
chromium
param1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/param1.C
405
utf_8
a6094bf319c105760bebe41768865b66
// { 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 (...
google
chromium
bitfield8
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/bitfield8.C
307
utf_8
20c8af1b6abeb0a339e5fd9c3edbde57
// { 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; }
google
chromium
empty6
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/empty6.C
548
utf_8
7f05451661fd24772bf5911bafb6ff9e
// { dg-options "-Wabi -fabi-version=1" } 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 ot...
google
chromium
layout4
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/layout4.C
258
utf_8
bce89527ea384ef57e8233c6ea7e1ed2
// { 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; }
google
chromium
mangle19-2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/mangle19-2.C
435
utf_8
af9f8cddd1244dd9ba598cbf9f64adf5
// { dg-do compile } // { dg-options "-fabi-version=1 -Wabi" } // PR 13242 // mangled template arguments that are external objects incorrectly extern int N; template <int &> struct S {}; void n (S<N>) {} // { dg-warning "mangled name" } // { dg-final { scan-assembler "\n_?_Z1n1SIXadL_Z1NEEE\[: \t\n\]" } }
google
chromium
arm_cxa_vec1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/arm_cxa_vec1.C
570
utf_8
770a1857da6a05380e26eabb7f0ecb92
// Check that __cxa_vec_[c]ctor returns a pointer to the array // { dg-do run { target arm*-*-* } } #include <cxxabi.h> #ifdef __ARM_EABI__ using namespace __cxxabiv1; static __cxa_cdtor_return_type cctor (void * a, void * b) { *(char *) a = *(char *) b; return a; } int main() { char data; char data2; char...
google
chromium
empty5
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/empty5.C
196
utf_8
b3ca6b59f60c246ebf1e969e6120765f
// { 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; }
google
chromium
bitfield3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/bitfield3.C
1,388
utf_8
038a64cd63d0ddc5b1080aa45fe1e1ca
// Test for oversized bitfield alignment in structs on IA-32 // { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } } // { 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* } } s...
google
chromium
mangle14
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/mangle14.C
284
utf_8
a34b61046b432b42bb70d5c1efdb3f68
// { dg-do compile } // { dg-options "-Wabi -fabi-version=1" } // { dg-final { scan-assembler "_Z1g1SIXadsr1ANS0_1fIiEEivEE" } } struct A { template <typename T> int f (); }; typedef int (A::*P)(); template <P> struct S {}; void g (S<&A::f<int> >) {} // { dg-warning "mangle" }
google
chromium
vthunk1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/vthunk1.C
883
utf_8
5acd6755c279afd8abbf0ca970932bf8
// { dg-do link } // 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 {}; s...
google
chromium
covariant5
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/covariant5.C
851
utf_8
488e3869493233b0552a676aa01a7912
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)...
google
chromium
mangle36
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/mangle36.C
266
utf_8
cce4c67a841bd521be785fa4162dbefb
// PR c++/41959 // { dg-do compile { target i?86-*-* x86_64-*-* } } // { dg-options "-mavx -fabi-version=4" } // { dg-final { scan-assembler "_Z1fDv4_f" } } // { dg-final { scan-assembler "_Z1fDv8_f" } } #include <x86intrin.h> void f(__m128) { } void f(__m256) { }
google
chromium
vthunk2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/vthunk2.C
306
utf_8
a3ef49aa5fa035e0eaa1fb23c589fe61
// { 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 } }
google
chromium
mangle18-2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/mangle18-2.C
654
utf_8
ed08764439318b92bcfc00c24907e5eb
// { dg-do compile } // { dg-options "-fabi-version=1 -Wabi" } // PR 13241 // mangled template arguments that are external objects incorrectly extern "C" void Foo (); namespace NMS { extern "C" int V; } template <void (*)()> struct S {}; template <int *> struct T {}; void f (S<Foo>){} // { dg-warning "mangled name" ...
google
chromium
mangle5
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/mangle5.C
170
utf_8
8d713f873b380f7cb5bf13fe8019b486
// Test mangling of pointers to cv-qualified member functions struct A; void f (void (A::*)() const) {} // { dg-final { scan-assembler "\n_?_Z1fM1AKFvvE\[: \t\n\]" } }
google
chromium
covariant1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/covariant1.C
776
utf_8
06ad90a0554de61d87d60dab2a30bf3e
// { dg-do compile } // { dg-options "-w" } // If a covariant thunk is overriding a virtual primary base, we have to // use the vcall offset even though we know it will be 0. struct c4 {}; struct c6 : c4 { virtual c4* f17(); }; c4* c6::f17() { return 0; } struct c11 : virtual c6 { int i; }; struct c12 : c11 { }; ...
google
chromium
pr39188-2b
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/pr39188-2b.C
173
utf_8
0e0d3fd200f3fd63503e40a56053caf0
#include "pr39188-2.h" extern "C" void abort (); extern int x (int); int main (void) { if (x (1) != 0) abort (); if (f<int> (1) != 1) abort (); return 0; }
google
chromium
vague1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/vague1.C
357
utf_8
9266f22cfbaad15702320f26c3b6c146
// instantiations. // Disable debug info so we don't get confused by the symbol name there. // { dg-options "-g0" } template <class T> struct A { static const T t = 0; }; template <class T> const T A<T>::t; int i; int main () { i = A<int>::t; // Should just use the value }
google
chromium
mangle4
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/mangle4.C
509
utf_8
200f21813a4ee7cb051aaf6d88d18b5b
// Test mangling of type casts // { dg-do compile } class A {}; class B : public A {}; template<const A* a> class C {}; template<const B* b> class D {}; template<B* b> class E {}; template<const B* b> void f(D<b> &, C<static_cast<const A*>(b)> &) {} // { dg-error "" } template<const B* b> void g(D<b> &, E<const_cast...
google
chromium
vbase14
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/vbase14.C
257
utf_8
530a9c9d639369e0e074a2ac0f3f8e59
// { 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" }
google
chromium
mangle28
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/mangle28.C
381
utf_8
8a0d615dc9ec8202a830aeb08e5dcb92
// Test of std::basic_istream<char, std::char_traits<char> > mangling // { dg-do compile } // { dg-options "-fno-inline" } namespace std { template<typename> struct char_traits; template<typename, typename> struct basic_istream { basic_istream(){} }; } std::basic_istream<char,std::char_traits<char> > s1; // { ...
google
chromium
pr39188-3b
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/pr39188-3b.C
168
utf_8
98c00465484f65e4b1d1c30fbbb31e23
#include "pr39188-3.h" extern "C" void abort (); extern int x (int); int main (void) { if (x (1) != 0) abort (); if (f (1) != 0) abort (); return 0; }
google
chromium
mangle16
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/mangle16.C
457
utf_8
d6cfcf12071b19ad5863b84ad45b916e
// { dg-options "-fabi-version=0" } enum E { e = 3 }; template <int I> struct S {}; template <int I> void f (S<e + 1>) {} template void f<7>(S<e + 1>); template <int I> void g (S<e>) {} template void g<7>(S<e>); template <int I> void h (S<I + 1>) {} template void h<7>(S<7 + 1>); // { dg-final { scan-assembler _Z1...
google
chromium
noreturn2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/noreturn2.C
315
utf_8
c57345fa3b5ca1a7540c77ee0ce25605
// Test for buggy mangling of attribute noreturn in abi<=4 // { dg-options -fabi-version=4 } void baz (const char *fmt, ...); // { dg-final { scan-assembler "_Z3barPVFvPKczE" } } void bar (void (*baz) (const char *fmt, ...) __attribute__ ((noreturn, format (printf, 1, 2)))); void foo () { bar (&baz); }
google
chromium
bitfield4
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/bitfield4.C
1,002
utf_8
b8aaec32a77e9927231c6c5f3237432f
/* { dg-do run { target { pcc_bitfield_type_matters || default_packed } } } */ /* Check bitfields and non-bitfields are aligned & sized similarly. */ #include <limits.h> #include <stdio.h> static int fail; #define CHECK1(N, T) do { \ typedef struct Field_##N { char c; T f; } Field_##N; \ typedef struct BitField_##N...
google
chromium
mangle7
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/mangle7.C
144
utf_8
3ca84e7c044b9a2c08f1b773db1d5f4f
/* { dg-do compile } */ typedef void *const t1[2]; float const f1(t1 (&)[79], ...) {} /* { dg-final { scan-assembler _Z2f1RA79_A2_KPvz } } */
google
chromium
layout1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/abi/layout1.C
340
utf_8
44d0f298ab4a8fb8dcb8f4930bac5fd0
// 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; re...