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
gnu-inline-global-reject
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/gnu-inline-global-reject.C
1,576
utf_8
ec07725f3e673e809231a2712e0ed157
/* Test __attribute__((gnu_inline)). Check that we reject various forms of duplicate definitions. */ /* { dg-do compile } */ /* { dg-options " -ansi -Wno-long-long" } */ #include "gnu-inline-common.h" #undef fn #define fn pfx(func_decl_inline_before) decl(inline, fn) // { dg-error "previous" "" } gnuindef(fn, 0) // { dg-error "redeclared" "" } #undef fn #define fn pfx(func_decl_inline_after) gnuindef(fn, 0) // { dg-error "previous" "" } decl(inline, fn) // { dg-error "redeclared" "" } #undef fn #define fn pfx(func_def_gnuin_redef) gnuindef(fn, 0) // { dg-error "previous" "" } gnuindef(fn, 1) // { dg-error "redefinition" "" } #undef fn #define fn pfx(func_def_inline_redef) def(inline, fn, 0) // { dg-error "previous" "" } def(inline, fn, 1) // { dg-error "redefinition" "" } #undef fn #define fn pfx(func_def_inline_after) gnuindef(fn, 0) // { dg-error "previous" "" } def(inline, fn, 1) // { dg-error "redeclare" "" } #undef fn #define fn pfx(func_def_inline_before) def(inline, fn, 0) // { dg-error "previous" "" } gnuindef(fn, 1) // { dg-error "redefinition" "" } #undef fn #define fn pfx(func_def_before) def(, fn, 0) // { dg-error "previous" "" } gnuindef(fn, 1) // { dg-error "redefinition" "" } #undef fn #define fn pfx(func_decl_static_inline_before) decl(static inline, fn) // { dg-error "previous" "" } gnuindef(fn, 0) // { dg-error "redeclared" "" } #undef fn #define fn pfx(func_def_static_inline_after) decl(static, fn) gnuindef(fn, 0) // { dg-error "previous" "" } decl(static, fn) def(static inline, fn, 1) // { dg-error "redeclare" "" }
google
chromium
selectany2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/selectany2.C
660
utf_8
bcc15b68ed2576412134a22bc0853e41
// { dg-do compile { target i?86-pc-cygwin } } // { dg-do compile { target i?86-pc-mingw* } } // Check for errors with invalid usage of selectany attribute. extern int foo; __declspec (selectany) int foo = 1; // OK struct d { static int foo; }; __declspec (selectany) int d::foo = 1; // OK struct f { int i; }; __declspec (selectany) struct f F= {1}; // OK __declspec (selectany) int boo; //{ dg-error "selectany" } __declspec (selectany) static int bar = 1; // { dg-error "selectany" } int use_bar = bar; // Avoid defined but not used warning. int baz() { __declspec (selectany) int foo = 1; // { dg-error "selectany" } return foo; }
google
chromium
dllimport12
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/dllimport12.C
528
utf_8
e752151f28c0823d9225c3d391aeca70
// PR target/27650 // Don't use dllimport semantics on virtual methods when initializing // vtables // { dg-do compile { target i?86-*-cygwin* i?86-*-mingw*} } // Use import lib thunk for vtable entry of explicitly virtual method, struct base { virtual void key_method(); __attribute__((dllimport)) virtual ~base(); }; void base::key_method() {} // Likewise for an implicitly virtual method. struct derived : public base { void key_method(); __attribute__((dllimport)) ~derived(); }; void derived::key_method() {}
google
chromium
max
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/max.C
80
utf_8
fc916d98d36fed4d9da40614102d5fdd
struct s_t { }; void foo(void) { s_t s; int i; s<?=i; // { dg-error "" } }
google
chromium
fixed2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/fixed2.C
97
utf_8
2dec269695cc75bd9f6561ca76c86464
// PR c++/35319 // { dg-options "" } void foo() { throw 0r; // { dg-error "not supported" } }
google
chromium
utf-gnuxx98
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/utf-gnuxx98.C
856
utf_8
508336efcb6722ef394c26643ffcbcc8
/* Expected errors for char16_t/char32_t in gnu++98. */ /* Ensure u and U prefixes are parsed as separate tokens in gnu++98. */ /* { dg-do compile } */ /* { dg-options "-std=gnu++98" } */ const static char16_t c0 = 'a'; /* { dg-error "not name a type" } */ const static char32_t c1 = 'a'; /* { dg-error "not name a type" } */ const unsigned short c2 = u'a'; /* { dg-error "not declared" } */ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 10 } */ const unsigned long c3 = U'a'; /* { dg-error "not declared" } */ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 12 } */ #define u 1 + #define U 2 + const unsigned short c5 = u'a'; const unsigned long c6 = U'a'; #undef u #undef U #define u "a" #define U "b" const void *s0 = u"a"; const void *s1 = U"a"; int main () {}
google
chromium
is_class_error2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/is_class_error2.C
1,552
utf_8
35547c60a5cca63fa7784b899fd77954
// PR c++/33464 template<int> void foo() { __has_nothrow_assign(int)(); // { dg-error "'__has_nothrow_assign\\(int\\)' cannot be used" } __has_trivial_assign(int)(); // { dg-error "'__has_trivial_assign\\(int\\)' cannot be used" } __has_nothrow_constructor(int)(); // { dg-error "'__has_nothrow_constructor\\(int\\)' cannot be used" } __has_trivial_constructor(int)(); // { dg-error "'__has_trivial_constructor\\(int\\)' cannot be used" } __has_nothrow_copy(int)(); // { dg-error "'__has_nothrow_copy\\(int\\)' cannot be used" } __has_trivial_copy(int)(); // { dg-error "'__has_trivial_copy\\(int\\)' cannot be used" } __has_trivial_destructor(int)(); // { dg-error "'__has_trivial_destructor\\(int\\)' cannot be used" } __has_virtual_destructor(int)(); // { dg-error "'__has_virtual_destructor\\(int\\)' cannot be used" } __is_abstract(int)(); // { dg-error "'__is_abstract\\(int\\)' cannot be used" } __is_base_of(int, float)(); // { dg-error "'__is_base_of\\(int, float\\)' cannot be used" } __is_class(int)(); // { dg-error "'__is_class\\(int\\)' cannot be used" } __is_convertible_to(int, float)(); // { dg-message "unimplemented" } __is_empty(int)(); // { dg-error "'__is_empty\\(int\\)' cannot be used" } __is_enum(int)(); // { dg-error "'__is_enum\\(int\\)' cannot be used" } __is_pod(int)(); // { dg-error "'__is_pod\\(int\\)' cannot be used" } __is_polymorphic(int)(); // { dg-error "'__is_polymorphic\\(int\\)' cannot be used" } __is_union(int)(); // { dg-error "'__is_union\\(int\\)' cannot be used" } }
google
chromium
label4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/label4.C
213
utf_8
745640ccb4853caedd76af8799204a4b
// PR c++/20563: ICE (--enable-checking), infinite loop (--disable-checking) // { dg-do compile } __label__ *l; // { dg-error "not at the beginning of" }
google
chromium
selectany1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/selectany1.C
555
utf_8
401efbd0398afc823de7b1ed9ad64376
// { dg-do compile { target i?86-pc-cygwin } } // { dg-do compile { target i?86-pc-mingw* } } // Check that selectany attribute puts symbols into link-once sections. // { dg-final { scan-assembler "\.section\t\.data\\\$foo\[^\n\]*\n\t\.linkonce discard" } } // { dg-final { scan-assembler "\.section\t\.data\\\$x\[^\n\]*\n\t\.linkonce discard" } } // { dg-final { scan-assembler-dem "\nguard variable for x:" } } __declspec (selectany) int foo = 1; class X { private: int m_i; public: X(int i): m_i(i){} ~X(){} }; __declspec(selectany) X x(1);
google
chromium
label3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/label3.C
656
utf_8
2f937b0172f68361eedae818d69b598b
// Bug: we were removing the p = q assignment in dce, and then reinserting // it *after* the try/catch in out-of-ssa. Oops. // testcase reduced from libjava/interpret.cc. // { dg-do run } // { dg-options "-O2" } extern "C" int printf (const char *, ...); bool b; int main() { __label__ one, two, done; void *labs[] = { &&one, &&two, &&done }; const void **q = (const void **)labs; const void **p = q; try { one: printf ("one!\n"); if (b) throw 42; goto **p++; two: printf ("two!\n"); goto **p++; done: printf ("done!\n"); } catch (int) { printf ("caught!\n"); } }
google
chromium
gnu-inline-class
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/gnu-inline-class.C
508
utf_8
3e9228fd78fc3a72b584e4e2eaab7d3f
/* { dg-do compile } */ /* { dg-options "-O" } */ // such that static functions are optimized out /* { dg-final { scan-assembler "func1" } } */ /* { dg-final { scan-assembler "func2" } } */ /* { dg-final { scan-assembler-not "func3" } } */ /* { dg-final { scan-assembler "func4" } } */ /* { dg-final { scan-assembler "func5" } } */ #define IN_CLASS gnu_test struct IN_CLASS { int func1(void); int func2(void); int func3(void); int func4(void); int func5(void); }; #include "gnu-inline-global.C"
google
chromium
always_inline-3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/always_inline-3.C
412
utf_8
501bf92c734eebe5c5c57a9e64a340e1
// { dg-options "-O0" } // { dg-do compile } // PR C++/34715 namespace X { template <class T> inline __attribute__ ((always_inline)) const T& min123(const T& a, const T& b); } template <class T> inline __attribute__ ((always_inline)) const T& X::min123(const T& a, const T& b) { return a < b ? a : b; } int main() { int a, b; return X::min123(a, b); } // { dg-final { scan-assembler-not "min123" } }
google
chromium
complit6
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/complit6.C
138
utf_8
493a8222f8737e0b1e764acebae321f4
// PR c++/20103 // { dg-options "" } struct A { A(const A&); }; struct B { A a; }; void foo(B); void bar(A &x) { foo((B){x}); }
google
chromium
builtin5
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/builtin5.C
248
utf_8
fb2e513e1e4562144ff7be35634bd225
// Verify that builtin is used when declared in namespace std // { dg-do compile } // { dg-options "-Wall" } namespace std { extern "C" int printf(const char*,...); } void foo() { std::printf("%d"); // { dg-warning "too few arguments" } }
google
chromium
packed11
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/packed11.C
283
utf_8
9cb80a2f0d2b2720aea9e37828f44d0f
// PR c++/26670 struct nonpod { nonpod(); }; struct nonpod_pack { nonpod n; // { dg-warning "ignoring packed attribute" } } __attribute__ ((packed)); struct nonpod_pack2 { nonpod_pack p; // { dg-warning "ignoring packed attribute" } } __attribute__ ((packed));
google
chromium
static1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/static1.C
363
utf_8
0cc2b837a96214f4ba420513a4d610a8
// PR c++/23699 // { dg-options "" } template<typename _CharT > class basic_string; typedef basic_string<char> string; template<typename _CharT> struct basic_string { static const int npos = -1; }; template<typename _CharT> const int basic_string<_CharT>::npos; extern template class basic_string<char>; struct A { static const long npos = string::npos; };
google
chromium
no-gnu-keywords-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/no-gnu-keywords-1.C
293
utf_8
d5f662860124db72994e984fae6aac16
// { dg-do compile } // { dg-options "-fno-gnu-keywords" } // Verify that the keyword asm is recognized and that the GNU // extension typeof is not recognized as a keyword when using // -fno-gnu-keywords. int asm; // { dg-error "before .asm." } int typeof; // { dg-bogus "before .typeof." }
google
chromium
sync-3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/sync-3.C
229
utf_8
96d325d0b1cb729ac3fd1b3d32a6b67b
// PR debug/41801 // { dg-do compile } // { dg-options "-O2 -g" } struct T { void foo () volatile { __sync_lock_release (&t); __sync_synchronize (); } bool t; }; int main () { T t = { false }; t.foo (); }
google
chromium
builtin7
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/builtin7.C
223
utf_8
f75543f5ea1a62d2e49f182ac3ff8f36
// PR c++/19628 // Verify that __builtin_constant_p may appear in a constant-expression. // { dg-do run } int main() { switch (3) { case (__builtin_constant_p(7) ? 3 : 8): return 0; default: return 1; } }
google
chromium
asm4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/asm4.C
48
utf_8
f8da779ccf232ebdb2dee94530a1bf48
void f () { __asm__ __volatile__ ("" : : ); }
google
chromium
builtin3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/builtin3.C
264
utf_8
2eb79b8e493396d3b59ec091894971a4
// Verify that declaring builtin in namespace std doesn't give us // declaration in global namespace // { dg-do compile } // { dg-options "" } namespace std { extern "C" int printf(char*, ...); } void foo() { printf("abc"); // { dg-error "not declared" } }
google
chromium
typeof4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/typeof4.C
264
utf_8
bb35b4ce331483ff19b91d62234fac6b
// { dg-do compile } // { dg-options "" } // PR c++/9459: typeof in return type of template function void foo (int) {} void foo (double) {} template <typename C> typeof(foo(1)) bar () { return foo(1); }
google
chromium
attrib14
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/attrib14.C
359
utf_8
cdd8170c3003199a19ce5299f8dd1d17
// PR c++/13170 // The bogus attribute is ignored, but was in TYPE_ATTRIBUTES during // parsing of the class, causing some variants to have it and some not. struct __attribute__((bogus)) A { // { dg-warning "ignored" "" } virtual ~A(); void foo(const A&); void bar(const A&); }; void A::foo(const A&) {} void A::bar(const A& a) { foo(a); }
google
chromium
always_inline-2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/always_inline-2.C
373
utf_8
44b18dc394b2fe02bfec7111c89c3315
// { dg-options "-O0" } // { dg-do compile } // PR C++/34715 namespace X { template <class T> const T& min123(const T& a, const T& b); } template <class T> inline __attribute__ ((always_inline)) const T& X::min123(const T& a, const T& b) { return a < b ? a : b; } int main() { int a, b; return X::min123(a, b); } // { dg-final { scan-assembler-not "min123" } }
google
chromium
builtin9
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/builtin9.C
84
utf_8
9ec34b90151fc823df34413d59729df4
// PR c++/21619 // { dg-options "" } int f[__builtin_constant_p(&"Hello"[0])?1:-1];
google
chromium
typedef-init
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/typedef-init.C
1,418
utf_8
6e81456dea123a5190b198232e976b24
/* { dg-do compile } */ /* { dg-options "-fpermissive" } // suppress default -pedantic-errors */ /* This code used to be a legitimate, if dubious, extension. However, it's been broken since GCC 3.0 (caused ICE) and we have now removed the extension. See PR c/7353. For cases A and C, C++ issues a warning in addition to the error, since this construct appears to be a case of implicit int (forbidden in std. C++) until we get to the equals sign. */ /* Case A: just the bare name = initializer. */ typedef A = 0; /* { dg-error "initialized" "A" } */ /* { dg-warning "no type" "A warns" { target *-*-* } 14 } */ A a; /* { dg-error "does not name a type" "A error cascade" } */ /* Case B: with a type also. */ typedef int B = 0; /* { dg-error "initialized" "B" } */ B b; /* { dg-error "does not name a type" "B error cascade" } */ /* C and D are the same as A and B, but wrapped in a structure; field declarations go by a different code path in C++ (ick). */ struct S { typedef C = 0; /* { dg-error "initialized" "C" } */ /* { dg-warning "no type" "C warns" { target *-*-* } 27 } */ C c; /* { dg-bogus "" "C error cascade" } */ typedef int D = 0; /* { dg-error "initialized" "D" } */ D d; /* { dg-bogus "" "D error cascade" } */ }; template<int> void foo() { typedef int i = 0; /* { dg-error "is initialized" } */ }
google
chromium
attrib11
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/attrib11.C
444
utf_8
7d199628520ab2d84e8e00fc3200e683
// { dg-do compile } // { dg-options "-Wall" } // PR c++/13507, spurious warning due to attribute clobbering extern "C" { extern int printf (__const char *__restrict __format, ...) throw (); extern int scanf (__const char *__restrict __format, ...) throw (); } void foo(unsigned int x) { printf ("%d\n", x); }
google
chromium
vla4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/vla4.C
336
utf_8
96ef8e77465b89de054095f26955d054
// PR c++/29318 // { dg-options "" } #include <typeinfo> void f(int i) { try { int a[i]; throw &a; // { dg-error "variable size" } } catch (int (*)[i]) { // { dg-error "variable size" } } } int main() { int i = 5; int va[i]; const std::type_info& info(typeid(&va)); // { dg-error "variable size" } return 0; }
google
chromium
packed5
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/packed5.C
124
utf_8
16a931c57f92231bf11258bf8610b8ca
// PR c++/14173 struct A; void foo(const A&); struct A { A(const A&); }; struct B { A a; A bar() { return a; } };
google
chromium
complit3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/complit3.C
192
utf_8
7c0cfd2335d61954c46222aa7517e055
// { dg-options "" } int Compound_Literals_0() { static int y[] = (int []) {1, 2, 3}; // { dg-error "init" } static int z[] = (int [3]) {1}; // { dg-error "init" } return y[0]+z[0]; }
google
chromium
attrib31
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/attrib31.C
201
utf_8
871bf59c89d9fdf913b212ba40c878a1
// PR c++/35097 template<int> struct A; template<> struct A<0> { typedef int X __attribute((aligned(4))); }; template<typename T> void foo(const A<0>::X&, T); void bar() { foo(A<0>::X(), 0); }
google
chromium
anon-struct2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/anon-struct2.C
1,026
utf_8
0e1fc7f945fafc3c224a24b23c1c2a76
/* { dg-options "" } */ /* In GNU C++ mode, we recognize the anonymous struct extension, but not Microsoft C extensions. */ struct A { char a; }; struct B { struct A; /* forward decl of B::A. */ char b; }; char testB[sizeof(B) == sizeof(A) ? 1 : -1]; struct C { struct D { char d; }; /* decl of C::D. */ char c; }; char testD[sizeof(C::D) == sizeof(A) ? 1 : -1]; /* GNU extension. */ struct E { struct { char z; }; char e; }; char testE[sizeof(E) == 2 * sizeof(A) ? 1 : -1]; char testEz[sizeof( ((E *)0)->z )]; typedef struct A typedef_A; struct F { typedef_A; /* { dg-error "does not declare anything" } */ char f; }; char testF[sizeof(F) == sizeof(A) ? 1 : -1]; /* Test that __extension__ does the right thing coming _from_ GNU C mode. */ __extension__ struct G { struct { char z; }; char g; }; char testG[sizeof(G) == 2 * sizeof(A) ? 1 : -1]; struct H { struct { char z; }; char h; }; char testH[sizeof(H) == 2 * sizeof(A) ? 1 : -1];
google
chromium
fnname2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/fnname2.C
538
utf_8
a06d181d1f37ed4bbf17112c988f9608
// Test whether __func__ works for ordinary member functions. // { dg-do run } struct y8a { const char* zqjx(int, char); }; const char* y8a::zqjx(int, char) { return __func__; } int main() { y8a tmp; const char* s = tmp.zqjx(16, 'x'); bool ok = true; ok = ok && s[0] == 'z'; ok = ok && s[1] == 'q'; ok = ok && s[2] == 'j'; ok = ok && s[3] == 'x'; ok = ok && s[4] == '\0'; return ok ? 0 : 1; }
google
chromium
utf32-4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/utf32-4.C
762
utf_8
993c9b9950651aca9d3859d5daa449a6
/* Expected errors for char32_t character constants. */ /* { dg-do compile } */ /* { dg-options "-std=c++0x" } */ const static char32_t c0 = U''; /* { dg-error "empty character" } */ const static char32_t c1 = U'ab'; /* { dg-warning "constant too long" } */ const static char32_t c2 = U'\U00064321'; const static char32_t c3 = 'a'; const static char32_t c4 = u'a'; const static char32_t c5 = u'\u2029'; const static char32_t c6 = u'\U00064321'; /* { dg-warning "constant too long" } */ const static char32_t c7 = L'a'; const static char32_t c8 = L'\u2029'; const static char32_t c9 = L'\U00064321'; /* { dg-warning "constant too long" "" { target { ! 4byte_wchar_t } } } */ int main () {}
google
chromium
stmtexpr7
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/stmtexpr7.C
156
utf_8
7e2b298f25a70913e3a563f97e4cf5b7
// PR c++/24686 // { dg-options "" } struct A { ~A(); }; bool h(int, const A&); int f(); int i; void g() { i && (A(), ({ static int l = f(); l; })); }
google
chromium
packed9
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/packed9.C
330
utf_8
0932ad5ce3e0455a61e5bd35e5ed587a
// DR21166. unnecessary error on packed char struct s1 { char c1; } __attribute__((packed)); char& f(struct s1 *s) { return s->c1; } char * g(struct s1 *s) { return &s->c1; }
google
chromium
vector5
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/vector5.C
150
utf_8
1c3c5b3c715f584a5634252e1b73f6ec
// PR c++/30022 // { dg-do compile } void foo() { int __attribute__((vector_size(8))) v; v = 1/v; // { dg-error "invalid operands of types" } }
google
chromium
weak1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/weak1.C
440
utf_8
8c86ea641b4518800fb5154a1a151e06
// Test for #pragma weak where the weak alias symbol isn't declared, // although the symbol it is an alias for is defined in the // translation unit. Bug 7544. // { dg-do compile } // { dg-require-weak "" } // { dg-require-alias "" } // { dg-options "-fno-common" } // { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?bar1" } } #pragma weak bar1 = foo1 extern "C" void foo1 (void) {}
google
chromium
tmplattr9
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/tmplattr9.C
330
utf_8
025a5972f75731b8e82a3214589eeedc
// PR c++/34937, 34962 // { dg-require-weak "" } // { dg-options "" } struct A { static const int i; }; template<int> void foo() { int x[A::i] __attribute((vector_size(8))); } template<int> struct B { enum { a, b = a }; void bar(B<b>) __attribute((weak)); }; void f() { foo<0>(); B<0> b; b.bar (B<B<0>::b>()); }
google
chromium
vector7
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/vector7.C
254
utf_8
499980717843a208168505a264f263e3
// { dg-options "" } // { dg-do compile } // PR C++/31721 and PR 14217 // the attribute vector_size would change a reference type into a pointer type which was wrong. #define vector __attribute__((__vector_size__(16) )) vector int b; vector int &a = b;
google
chromium
lvalue1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/lvalue1.C
179
utf_8
4d2204ac6e2ce03af82e6431536be376
// Test that we complain about the gcc cast-as-lvalue extension. int main () { char c; return c != 2; }
google
chromium
stmtexpr12
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/stmtexpr12.C
128
utf_8
9d43ea9a813c48446105372589470afa
// PR c++/29000 // { dg-options "" } template<int> int foo() { return ({foo;})==0; // { dg-error "insufficient context" } }
google
chromium
has_trivial_destructor-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/has_trivial_destructor-1.C
1,333
utf_8
fac1ffc31ae39a0464e2687b6498f7a7
// { dg-do "run" } #include <cassert> struct A { double a; double b; }; union U { double a; double b; }; struct B { ~B() { } }; struct C : public B { }; struct D : public A { }; template<typename T> bool f() { return __has_trivial_destructor(T); } template<typename T> class My { public: bool f() { return !!__has_trivial_destructor(T); } }; template<typename T> class My2 { public: static const bool trait = __has_trivial_destructor(T); }; template<typename T> const bool My2<T>::trait; template<typename T, bool b = __has_trivial_destructor(T)> struct My3_help { static const bool trait = b; }; template<typename T, bool b> const bool My3_help<T, b>::trait; template<typename T> class My3 { public: bool f() { return My3_help<T>::trait; } }; #define PTEST(T) (__has_trivial_destructor(T) && f<T>() \ && My<T>().f() && My2<T>::trait && My3<T>().f()) #define NTEST(T) (!__has_trivial_destructor(T) && !f<T>() \ && !My<T>().f() && !My2<T>::trait && !My3<T>().f()) int main() { assert (PTEST (int)); assert (NTEST (int (int))); assert (NTEST (void)); assert (PTEST (A)); assert (PTEST (U)); assert (NTEST (B)); assert (PTEST (D)); assert (PTEST (D[])); return 0; }
google
chromium
altivec-types-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/altivec-types-1.C
4,617
utf_8
6d4cff810ab6e9e65baf25ba498ad8e7
/* { dg-do compile { target powerpc*-*-linux* } } */ /* { dg-require-effective-target powerpc_altivec_ok } */ /* { dg-options "-maltivec -std=c++98" } */ /* Valid AltiVec vector types should be accepted with no warnings. */ __vector char vc; __vector unsigned char vuc; __vector signed char vsc; __vector __bool char vbc; __vector short vh; __vector signed short vsh; __vector unsigned short vuh; __vector short int vhi; __vector signed short int vshi; __vector unsigned short int vuhi; __vector __bool short vbh; __vector __bool short int vbhi; __vector int vi; __vector unsigned int vui; __vector signed int vsi; __vector __bool int vbi; __vector unsigned vuj; __vector signed vsj; __vector __bool vbj; __vector float vf; /* These should be rejected as invalid AltiVec types. */ __vector bool vb; /* { dg-error "AltiVec types" "" } */ __vector long long vll; /* { dg-error "AltiVec types" "" } */ __vector unsigned long long vull; /* { dg-error "AltiVec types" "" } */ __vector signed long long vsll; /* { dg-error "AltiVec types" "" } */ __vector __bool long long vbll; /* { dg-error "AltiVec types" "" } */ __vector long long int vlli; /* { dg-error "AltiVec types" "" } */ __vector unsigned long long int vulli; /* { dg-error "AltiVec types" "" } */ __vector signed long long int vslli; /* { dg-error "AltiVec types" "" } */ __vector __bool long long int vblli; /* { dg-error "AltiVec types" "" } */ __vector double vd1; /* { dg-error "AltiVec types" "" } */ __vector long double vld; /* { dg-error "AltiVec types" "" } */ __vector _Complex float vcf; /* { dg-error "AltiVec types" "" } */ __vector _Complex double vcd; /* { dg-error "AltiVec types" "" } */ __vector _Complex long double vcld; /* { dg-error "AltiVec types" "" } */ __vector _Complex signed char vcsc; /* { dg-error "AltiVec types" "" } */ __vector _Complex unsigned char vcuc; /* { dg-error "AltiVec types" "" } */ __vector _Complex short vcss; /* { dg-error "AltiVec types" "" } */ __vector _Complex unsigned short vcus; /* { dg-error "AltiVec types" "" } */ __vector _Complex int vcsi; /* { dg-error "AltiVec types" "" } */ __vector _Complex unsigned int vcui; /* { dg-error "AltiVec types" "" } */ __vector _Complex long vcsl; /* { dg-error "AltiVec types" "" } */ __vector _Complex unsigned long vcul; /* { dg-error "AltiVec types" "" } */ __vector _Complex long long vcsll; /* { dg-error "AltiVec types" "" } */ __vector _Complex unsigned long long vcull; /* { dg-error "AltiVec types" "" } */ __vector __complex float v_cf; /* { dg-error "AltiVec types" "" } */ __vector __complex double v_cd; /* { dg-error "AltiVec types" "" } */ __vector __complex long double v_cld; /* { dg-error "AltiVec types" "" } */ __vector __complex signed char v_csc; /* { dg-error "AltiVec types" "" } */ __vector __complex unsigned char v_cuc; /* { dg-error "AltiVec types" "" } */ __vector __complex short v_css; /* { dg-error "AltiVec types" "" } */ __vector __complex unsigned short v_cus; /* { dg-error "AltiVec types" "" } */ __vector __complex int v_csi; /* { dg-error "AltiVec types" "" } */ __vector __complex unsigned int v_cui; /* { dg-error "AltiVec types" "" } */ __vector __complex long v_csl; /* { dg-error "AltiVec types" "" } */ __vector __complex unsigned long v_cul; /* { dg-error "AltiVec types" "" } */ __vector __complex long long v_csll; /* { dg-error "AltiVec types" "" } */ __vector __complex unsigned long long v_cull; /* { dg-error "AltiVec types" "" } */ /* These should be rejected because the component types are invalid. We don't care about the actual error messages here. */ __vector __bool unsigned char vbuc; /* { dg-error "" "" } */ __vector __bool signed char vbsc; /* { dg-error "" "" } */ __vector __bool unsigned short vbuh; /* { dg-error "" "" } */ __vector __bool signed short vbsh; /* { dg-error "" "" } */ __vector __bool unsigned int vbui; /* { dg-error "" "" } */ __vector __bool signed int vbsi; /* { dg-error "" "" } */ __vector __bool unsigned vbuj; /* { dg-error "" "" } */ __vector __bool signed vbsj; /* { dg-error "" "" } */ __vector signed float vsf; /* { dg-error "" "" } */ __vector unsigned float vuf; /* { dg-error "" "" } */ __vector short float vsf; /* { dg-error "" "" } */ __vector signed double vsd; /* { dg-error "" "" } */ __vector unsigned double vud; /* { dg-error "" "" } */ __vector short double vsd; /* { dg-error "" "" } */ __vector __bool float vbf; /* { dg-error "" "" } */ __vector __bool double vbd; /* { dg-error "" "" } */ __vector __bool short float blf; /* { dg-error "" "" } */ __vector __bool short double vlbd; /* { dg-error "" "" } */
google
chromium
dllimport11
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/dllimport11.C
331
utf_8
afd0ddacb830eaaab6028defc4a2ea94
// PR target/23589 // Template member functions do not get dllimport status of class. // { dg-do compile { target i?86-*-cygwin* i?86-*-mingw*} } struct __attribute__((dllimport)) Foo { template <class T> Foo (T); }; void a (int i) { Foo f(i); } template <class T> Foo::Foo (T) {} // no dllimport warnings on definition.
google
chromium
packed7
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/packed7.C
322
utf_8
2e29b33d9b093b6a30a0e49d1b42c6c8
// PR c++/14124 // A packed enum uses the minimal underlying type. // { dg-do run } enum XXX { xyzzy = 3 } __attribute__((packed)); int main() { int enumsize = sizeof(xyzzy); return (enumsize == 1) ? 0 : 1; }
google
chromium
is_abstract
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/is_abstract.C
1,272
utf_8
c8441975995cf5b489a5e180b7676146
// { dg-do "run" } #include <cassert> struct A { double a; double b; }; union U { double a; double b; }; class B { B(); }; class C { virtual void rotate(int) = 0; }; class D { virtual void rotate(int) { } }; template<typename T> bool f() { return __is_abstract(T); } template<typename T> class My { public: bool f() { return !!__is_abstract(T); } }; template<typename T> class My2 { public: static const bool trait = __is_abstract(T); }; template<typename T> const bool My2<T>::trait; template<typename T, bool b = __is_abstract(T)> struct My3_help { static const bool trait = b; }; template<typename T, bool b> const bool My3_help<T, b>::trait; template<typename T> class My3 { public: bool f() { return My3_help<T>::trait; } }; #define PTEST(T) (__is_abstract(T) && f<T>() \ && My<T>().f() && My2<T>::trait && My3<T>().f()) #define NTEST(T) (!__is_abstract(T) && !f<T>() \ && !My<T>().f() && !My2<T>::trait && !My3<T>().f()) int main() { assert (NTEST (int)); assert (NTEST (void)); assert (NTEST (A)); assert (NTEST (U)); assert (NTEST (B)); assert (NTEST (B[])); assert (NTEST (D)); return 0; }
google
chromium
member-attr
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/member-attr.C
652
utf_8
76dc6abfdf7c1982462bb0cc9c44fb6f
/* Test to see if__attribute__'s are handled by inline member functions */ /* { dg-do compile } */ /* { dg-options "-fmessage-length=0" } */ /* Previously __attribute__'s were handled by the grammar but "dropped on the floor", these effectively ignoring them. This tests the fix to see that they are now handled. In this test it should report that we have an illegal attribute. */ class T { public: __attribute__ ((garbage1)) void member1(int) {} /* { dg-warning "'garbage1' attribute directive ignored" "" } */ void __attribute__ ((garbage2)) member2(int) {} /* { dg-warning "'garbage2' attribute directive ignored" "" } */ };
google
chromium
inline1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/inline1.C
765
utf_8
f2cf0baaaf489aa15f22210e07d052d1
// { dg-do compile } // { dg-options "-O" } // Make sure inlined non-outlined functions aren't marked weak. // We'd get a ".weak xyzzy" annotation trigged by the second declaration. // { dg-final { scan-assembler-not "weak\[^ \t\]*\[ \t\]_?xyzzy" } } // The next check isn't really part of the actual test, just to make // sure there's no outline-copy of xyzzy, because if that really // happened, it *should* be marked linkonce or perhaps weak. // { dg-final { scan-assembler-not "xyzzy" } } extern int x; extern void foo(void); extern void bar(void); extern "C" inline int xyzzy(int a) { foo(); return a + x; } extern "C" int xyzzy(int); extern inline int plugh(int c) { } int y; void doit(int b) { y = xyzzy (b) + plugh (b); }
google
chromium
utf-dflt
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/utf-dflt.C
852
utf_8
fde1aeb08e5c566ba734e4aaeaf669fb
/* Expected errors for char16_t/char32_t in default std. */ /* Ensure u and U prefixes are parsed as separate tokens in default std. */ /* { dg-do compile } */ /* { dg-options "" } */ const static char16_t c0 = 'a'; /* { dg-error "not name a type" } */ const static char32_t c1 = 'a'; /* { dg-error "not name a type" } */ const unsigned short c2 = u'a'; /* { dg-error "not declared" } */ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 10 } */ const unsigned long c3 = U'a'; /* { dg-error "not declared" } */ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 12 } */ #define u 1 + #define U 2 + const unsigned short c4 = u'a'; const unsigned long c5 = U'a'; #undef u #undef U #define u "a" #define U "b" const void *s0 = u"a"; const void *s1 = U"a"; int main () {}
google
chromium
attrib10
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/attrib10.C
155
utf_8
7e9f8e5acd7da503c63f6342955e1873
// PR c++/12795 // { dg-require-alias "" } void foo() { extern void bar () __attribute__ ((__alias__ ("BAR"))); // { dg-warning "ignored" } bar (); }
google
chromium
stmtexpr11
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/stmtexpr11.C
130
utf_8
9b385207de7bf590c1ddd0d68c3ccea4
// PR c++/31337 // { dg-options "" } struct A { int i[0]; A(); A(const A&); ~A(); }; void foo() { A a = ({ A(); }); }
google
chromium
is_union
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/is_union.C
1,099
utf_8
2e8453a4e0be4018f2b415a3cb899b8e
// { dg-do "run" } #include <cassert> struct A { double a; double b; }; class B { B() { } }; union U { double a; double b; }; template<typename T> bool f() { return __is_union(T); } template<typename T> class My { public: bool f() { return !!__is_union(T); } }; template<typename T> class My2 { public: static const bool trait = __is_union(T); }; template<typename T> const bool My2<T>::trait; template<typename T, bool b = __is_union(T)> struct My3_help { static const bool trait = b; }; template<typename T, bool b> const bool My3_help<T, b>::trait; template<typename T> class My3 { public: bool f() { return My3_help<T>::trait; } }; #define PTEST(T) (__is_union(T) && f<T>() \ && My<T>().f() && My2<T>::trait && My3<T>().f()) #define NTEST(T) (!__is_union(T) && !f<T>() \ && !My<T>().f() && !My2<T>::trait && !My3<T>().f()) int main() { assert (NTEST (int)); assert (NTEST (void)); assert (NTEST (A)); assert (NTEST (B)); assert (PTEST (U)); return 0; }
google
chromium
conv1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/conv1.C
304
utf_8
356f009d32e7c4d124b9aff9f08aa85b
// Test for backwards brain-damage compatibility with -fpermissive. // { dg-options "-fpermissive -w" } void f (); void f (int *); void g (int); int main () { void *v = 1234; void (*p)() = v; int i = v; f (i); f (v); g (v); enum { a } b = i; void (*p2)(int) = p; unsigned *ip = &i; }
google
chromium
attrib4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/attrib4.C
566
utf_8
0689e86022776421672cfd3ac67e3153
// Test for syntax support of various attribute permutations. int __attribute__((noreturn)) __attribute__((unused)) one(void); // OK __attribute__((noreturn)) __attribute__((unused)) int two(void); // OK int __attribute__((unused)) three (void) __attribute__((noreturn)); // OK __attribute__((unused)) int four (void) __attribute__((noreturn)); // OK int five(void) __attribute__((noreturn)) __attribute__((unused)); // OK __attribute__((noreturn)) int __attribute__((unused)) // parse error before '__attribute__' in C++ six (void); // OK in C
google
chromium
va-arg1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/va-arg1.C
117
utf_8
8f368ee52bff2600a087163d174828d3
// PR c++/33462 struct A {}; void foo() { ++__builtin_va_arg(0, A); // { dg-error "'\\+\\+va_arg\\(0, A\\)'" } }
google
chromium
utf32-2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/utf32-2.C
771
utf_8
c568d20fa8e2994282acbbf27946ca84
/* Test the support for char32_t* string constants. */ /* { dg-do run } */ /* { dg-options "-std=c++0x -Wall -Werror" } */ extern "C" void abort (void); const static char32_t *s0 = U"ab"; const static char32_t *s1 = U"a\u0024"; const static char32_t *s2 = U"a\u2029"; const static char32_t *s3 = U"a\U00064321"; #define A 0x00000061 #define B 0x00000062 #define D 0x00000024 #define X 0x00002029 #define Y 0x00064321 int main () { if (s0[0] != A || s0[1] != B || s0[2] != 0x00000000) abort (); if (s1[0] != A || s1[1] != D || s0[2] != 0x00000000) abort (); if (s2[0] != A || s2[1] != X || s0[2] != 0x00000000) abort (); if (s3[0] != A || s3[1] != Y || s3[2] != 0x00000000) abort (); }
google
chromium
alias-canon2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/alias-canon2.C
658
utf_8
3edd13b80e6278657af7d13a3250a544
// { dg-do compile } // PR c++/37553 typedef unsigned int ui32; __extension__ typedef unsigned long long int ui64; typedef ui32 __attribute__ ((__may_alias__)) ui32a; typedef ui64 __attribute__ ((__may_alias__)) ui64a; union u_u32 { ui32a v; } __attribute__ ((__may_alias__)); union u_u64 { ui64a v; struct { union u_u32 lo32, hi32; } u; } __attribute__ ((__may_alias__)); void out_long (ui64 longVal) { if ((*(union u_u64 *) &longVal).u.lo32.v < 0x10000000ul) { if ((ui32) ((*(union u_u64 *) &longVal).u.lo32.v) < 0x4000u) { /* do something useful */ } } } void f(ui32 *) { } void f(ui32a *) { }
google
chromium
has_trivial_copy
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/has_trivial_copy.C
1,484
utf_8
991bf0381cb4af44db418daf1990cb16
// { dg-do "run" } #include <cassert> struct A { double a; double b; }; union U { double a; double b; }; struct B { B(const B&) { } }; struct C { virtual int f() { return 1; } }; struct D : public B { }; struct E : public A { }; struct F { A a; }; struct G { B b; }; template<typename T> bool f() { return __has_trivial_copy(T); } template<typename T> class My { public: bool f() { return !!__has_trivial_copy(T); } }; template<typename T> class My2 { public: static const bool trait = __has_trivial_copy(T); }; template<typename T> const bool My2<T>::trait; template<typename T, bool b = __has_trivial_copy(T)> struct My3_help { static const bool trait = b; }; template<typename T, bool b> const bool My3_help<T, b>::trait; template<typename T> class My3 { public: bool f() { return My3_help<T>::trait; } }; #define PTEST(T) (__has_trivial_copy(T) && f<T>() \ && My<T>().f() && My2<T>::trait && My3<T>().f()) #define NTEST(T) (!__has_trivial_copy(T) && !f<T>() \ && !My<T>().f() && !My2<T>::trait && !My3<T>().f()) int main() { assert (PTEST (int)); assert (NTEST (int (int))); assert (NTEST (void)); assert (PTEST (A)); assert (PTEST (U)); assert (NTEST (B)); assert (NTEST (D)); assert (PTEST (E)); assert (NTEST (E[])); assert (PTEST (F)); assert (NTEST (G)); assert (PTEST (B&)); return 0; }
google
chromium
vla7
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/vla7.C
280
utf_8
f339c929810ba11885868c48c99722f6
// PR c++/40013 // { dg-options "" } template <class T> struct A { struct B { struct { int fn () { return 0; } } b; }; void test (); }; template <class T> void A <T>::test () { B a; int vla[a.b.fn ()]; } int main () { A <char> a; a.test (); }
google
chromium
stmtexpr9
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/stmtexpr9.C
106
utf_8
1a8af85002e8ca32cf0c099dd5920e54
// PR c++/28899 // { dg-options "" } void f() { unsigned l, l1; l1 = l = ({ unsigned __v; __v; }); }
google
chromium
utf-gnuxx0x
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/utf-gnuxx0x.C
340
utf_8
914ff28c3b3bf7ec6702854ab6a6a54b
/* Test parsing of u and U prefixes when also used as macros. */ /* { dg-do compile } */ /* { dg-options "-std=gnu++0x" } */ #define u L #define U L const unsigned short c2 = u'a'; const unsigned long c3 = U'a'; const void *s0 = u"a"; const void *s1 = U"a"; int main () {}
google
chromium
complit12
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/complit12.C
848
utf_8
cd39637cbec2b2507f9279554da9904c
// PR c++/40948 // { dg-do run } // { dg-options "" } int c; struct M { M () { ++c; } M (const M&) { ++c; } ~M () { --c; } }; struct S { S (); M m[1]; }; S::S () : m ((M[1]) { M () }) { } struct T { T (); M m[4]; }; T::T () : m ((M[4]) { M (), M (), M (), M () }) { } typedef M MA[1]; MA &bar (MA, MA& r) { return r; } M f(M m) { return m; } int main () { { M m[1] = (M[1]) { M () }; if (c != 1) return 1; M n = (M) { M () }; if (c != 2) return 2; M o[4] = (M[4]) { M (), M (), M (), M () }; if (c != 6) return 3; S s; if (c != 7) return 4; T t; if (c != 11) return 5; MA ma = bar ((M[2]) { M(), M() }, m); if (c != 12) return 7; M mm[2] = ((M[2]) { f(M()), f(M()) }); if (c != 14) return 8; } if (c != 0) return 6; }
google
chromium
dllimport1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/dllimport1.C
539
utf_8
49d4139859203b19e08de8394ce6cc72
// PR c++/7910 // { dg-do compile { target i?86-*-cygwin* i?86-*-mingw*} } // { dg-options { -Wall -W } } class __attribute__((dllimport)) Foo { public: virtual void dummy_foo_func(void) {} void dummy_foo_fun2(); virtual ~Foo(); // avoid warning }; void Foo::dummy_foo_fun2() // { dg-warning "redeclared without dllimport" } { } class Bar : public Foo { public: ~Bar(); void dummy_bar_func(); }; Bar::~Bar() {} void Bar::dummy_bar_func() {} // { dg-final { scan-assembler-not "__imp___ZN3Foo14dummy_foo_fun" } }
google
chromium
dllimport2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/dllimport2.C
661
utf_8
fefa293f2877456b95804b812eb1acbe
// { dg-do compile { target i?86-*-cygwin* i?86-*-mingw*} } // PR c++/9738 Dllimport attribute is overriden by later definition/redeclaration void __attribute__((dllimport)) Bar(void); void __attribute__((dllimport)) Baz(void); __attribute__((dllimport)) int Biz; __attribute__((dllimport)) int Boz; void Foo(void) { Bar(); Baz(); Biz++; Boz++; } void Baz(void); // { dg-warning "referenced with dll linkage" } void Bar(void) // { dg-warning "referenced with dll linkage" } { } extern int Biz; // { dg-warning "referenced with dll linkage" } int Boz; // { dg-warning "referenced with dll linkage" } void foo() { Biz++; }
google
chromium
case-range3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/case-range3.C
492
utf_8
5df848d67cacf5f69d3851c5aa6df4af
// { dg-do compile } // Tests if case ranges (a GNU extension) emit errors in ISO mode // { dg-options "-pedantic" } const int low = -2; const int high = 15; template <typename T> T f2 (T i) { switch (i) { case low ... high : return i + 1; // { dg-warning "non-standard" } default : return 0; } } int f (int i) { switch (i) { case 1 ... 10: return i + 1; // { dg-warning "non-standard" } default: return f2 (i); // { dg-message "instantiated" } } }
google
chromium
pretty2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/pretty2.C
1,079
utf_8
faa8333681bedde3ba84daa60ec26ff8
// PR c++/6794 // Test whether __PRETTY_FUNCTION__ works in templates, functions and // in initializers at global scope // { dg-do run } // { dg-options "" } extern "C" void __assert_fail (const char *, const char *, unsigned int, const char *) throw() __attribute__((noreturn)); extern "C" void abort (void); extern "C" void exit (int); #define str(expr) #expr #define assert(expr) \ ((expr) ? 0 : (__assert_fail (str(expr), __FILE__, __LINE__, \ __PRETTY_FUNCTION__), 0)) int __attribute__((noinline)) foo (void) { return 1; } template<class T> int bar (T) { return (assert (foo ()), 1); } template<> int bar<int> (int) { return (assert (foo ()), 2); } int a = (assert (foo ()), 1); int b = (assert (foo ()), 2); int main () { double c = 1.0; unsigned char *d = 0; int e = (assert (foo ()), 3); bar (d); bar (e); } namespace N { int f = (assert (foo ()), 4); } void __attribute__((noinline)) __assert_fail (const char *cond, const char *file, unsigned int line, const char *pretty) throw () { abort (); }
google
chromium
has_nothrow_constructor_odr
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/has_nothrow_constructor_odr.C
220
utf_8
553a46b2d6671b148c241847122b9d33
// PR c++/36870 // { dg-do "run" } #include <cassert> struct S { S (); }; bool f (); int main () { assert (__has_nothrow_constructor (S) == f ()); } S::S () { } bool f () { return __has_nothrow_constructor (S); }
google
chromium
dllimport3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/dllimport3.C
527
utf_8
0278b9ac3c1a21dc2da4c9e17a16033b
// { dg-do compile { target i?86-*-cygwin* i?86-*-mingw*} } // PR 10148 Dllimport attribute of object is overriden by later // redefinition without attribute. struct Foo { int a; }; __attribute__((dllimport)) struct Foo f; void Bar(void) { void* dummy = (void*) &f; } struct Foo f; // { dg-warning "referenced with dll linkage" } // Dllimport'd symbols do not have a constant address, so following // assignment would require static_initialization_and_destruction // if attribute is retained. void* dummy = &f;
google
chromium
asmspecValid
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/asmspecValid.C
984
utf_8
5ee066fcb4d2f0a4b7244f6dfe4cf04b
// tests that the asm directive is correctly handled for static fields // in structures and classes. This only applies to C++; such // directives generate errors in C. Assembler directives for local // variables should be tested by the C test suite. // // { dg-do compile } struct Foo { // This should reference a variable called bar static int i __asm__("bar"); }; class Bar { public: static int i __asm__("theRealI"); static int j __asm__("theRealJ"); int boof; }; class Baz : public Bar { public: static char *ptr __asm__ ("theRealString"); }; int main (int argc, char **argv) { struct Foo myFoo; Bar b; myFoo.i = 1; Foo::i = 2; Baz::j = 10; Baz::ptr = 0; b.i = 1; return (b.i); } /* { dg-final {scan-assembler "bar"} } */ /* { dg-final {scan-assembler "theRealString"} } */ /* { dg-final {scan-assembler "theRealI" } } */ /* { dg-final {scan-assembler "theRealJ" } } */
google
chromium
weak3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/weak3.C
305
utf_8
1a7816a666c363e8410710411e40ce26
// PR c++/20961 // Test for #pragma weak and __attribute__((weak)) being used together. // { dg-do compile } // { dg-require-weak "" } // { dg-options "" } // { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?_Z3foov" } } int foo (); #pragma weak foo int __attribute__((weak)) foo () { return 0; }
google
chromium
asm3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/asm3.C
289
utf_8
08c7892fa7d47f47ca5b00bbe4dbaa29
// { dg-do compile } // PR 7015. ICE with asms int two(int in) { register int out; __asm__ ("" : "r" (out) : "r" (in)); // { dg-error "" "" } return out; }
google
chromium
attrib16
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/attrib16.C
256
utf_8
1feb907828c5492b83a6bb325e5a8f9c
// { dg-do compile } // Origin: <rguenth at tat dot physik dot uni-tuebingen dot de> // PR c++/10479: use of non dependent expressions in attributes in templates template <int i> struct foo2 { float bar __attribute__((aligned(__alignof__(double)))); };
google
chromium
sync-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/sync-1.C
874
utf_8
e4a78d4631d98dda8d34b1baf828c158
// Validate that the __sync builtins are overloaded properly. // { dg-do compile } // { dg-options "-Werror" } #define TEST1(TYPE, BUILTIN) \ void t_##TYPE##BUILTIN(TYPE *p) \ { \ __typeof(BUILTIN(p, 1)) *pp; \ pp = p; \ } #define TEST2(BUILTIN) \ TEST1(int, BUILTIN) \ TEST1(long, BUILTIN) TEST2(__sync_fetch_and_add) TEST2(__sync_fetch_and_sub) TEST2(__sync_fetch_and_or) TEST2(__sync_fetch_and_and) TEST2(__sync_fetch_and_xor) TEST2(__sync_fetch_and_nand) TEST2(__sync_add_and_fetch) TEST2(__sync_sub_and_fetch) TEST2(__sync_or_and_fetch) TEST2(__sync_and_and_fetch) TEST2(__sync_xor_and_fetch) TEST2(__sync_nand_and_fetch) TEST2(__sync_lock_test_and_set) #define TEST3(TYPE) \ void t_##TYPE##__sync_val_compare_and_swap(TYPE *p) \ { \ __typeof(__sync_val_compare_and_swap(p, 1, 2)) *pp; \ pp = p; \ } TEST3(int) TEST3(long)
google
chromium
builtin2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/builtin2.C
359
utf_8
4b79f0ca012fab75e5085a3acc4d333d
// PR c++/18514 // Test whether alternate 'asm' name is applied correctly to // builtin imported into namespace std. // { dg-do compile } // { dg-options "" } // { dg-final { scan-assembler "fancy_printf" } } extern "C" int printf(const char*, ...) __asm("_fancy_printf"); namespace std { using ::printf; } namespace std { void foo() { printf("abc"); } }
google
chromium
dllimport10
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/dllimport10.C
250
utf_8
3c9b89ab2016a6038228f5d5b55923ac
// PR c++/5287, c++/11021 // Inherit a virtual method from a dllimport'd base class. // { dg-do compile { target i?86-*-cygwin* i?86-*-mingw*} } struct __attribute__((dllimport)) A { virtual void vfunc(void); }; struct B : public A { }; B aB;
google
chromium
stmtexpr8
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/stmtexpr8.C
317
utf_8
c24c0fb32082543dfc7b57bd392ba008
// PR c++/27115 // { dg-do run } // { dg-options "" } struct A { int i; A (int j) : i(j) {} A (const A &j) : i(j.i) {} A& operator= (const A &j) { i = j.i; return *this; } }; A foo(int j) { return ({ j ? A(1) : A(0); }); } int main() { return foo(1).i-1; } void foo2() { A b = ({ A a(1); a; }); }
google
chromium
label2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/label2.C
121
utf_8
bc46f1e1c4440b0f50439ed472661922
// { dg-options "" } template <typename T> void f() { l: void *p[] = { &&l }; goto *p; } template void f<int>();
google
chromium
cleanup-11
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/cleanup-11.C
2,428
utf_8
2bf8b32daf9c23f251208697719631a4
/* { dg-do run { target hppa*-*-hpux* *-*-linux* powerpc*-*-darwin* *-*-darwin[912]* } } */ /* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */ /* Verify that cleanups work with exception handling through realtime signal frames on alternate stack. */ #include <unwind.h> #include <stdlib.h> #include <signal.h> #include <unistd.h> #include <string.h> static _Unwind_Reason_Code force_unwind_stop (int version, _Unwind_Action actions, _Unwind_Exception_Class exc_class, struct _Unwind_Exception *exc_obj, struct _Unwind_Context *context, void *stop_parameter) { if (actions & _UA_END_OF_STACK) abort (); return _URC_NO_REASON; } static void force_unwind () { struct _Unwind_Exception *exc = (struct _Unwind_Exception*) malloc (sizeof (*exc)); memset (&exc->exception_class, 0, sizeof (exc->exception_class)); exc->exception_cleanup = 0; #ifndef __USING_SJLJ_EXCEPTIONS__ _Unwind_ForcedUnwind (exc, force_unwind_stop, 0); #else _Unwind_SjLj_ForcedUnwind (exc, force_unwind_stop, 0); #endif abort (); } int count; char *null; static void counter (void *p __attribute__((unused))) { ++count; } static void handler (void *p __attribute__((unused))) { if (count != 2) abort (); exit (0); } static int __attribute__((noinline)) fn5 () { char dummy __attribute__((cleanup (counter))); force_unwind (); return 0; } static void fn4 (int sig, siginfo_t *info, void *ctx) { char dummy __attribute__((cleanup (counter))); fn5 (); null = NULL; } static void fn3 () { abort (); } static int __attribute__((noinline)) fn2 () { *null = 0; fn3 (); return 0; } static int __attribute__((noinline)) fn1 () { stack_t ss; struct sigaction s; ss.ss_size = 4 * sysconf (_SC_PAGESIZE); if (ss.ss_size < SIGSTKSZ) ss.ss_size = SIGSTKSZ; ss.ss_sp = malloc (ss.ss_size); if (ss.ss_sp == NULL) exit (1); ss.ss_flags = 0; if (sigaltstack (&ss, NULL) < 0) exit (1); sigemptyset (&s.sa_mask); s.sa_sigaction = fn4; s.sa_flags = SA_RESETHAND | SA_ONSTACK | SA_SIGINFO; sigaction (SIGSEGV, &s, NULL); sigaction (SIGBUS, &s, NULL); fn2 (); return 0; } static int __attribute__((noinline)) fn0 () { char dummy __attribute__((cleanup (handler))); fn1 (); null = 0; return 0; } int main() { fn0 (); abort (); }
google
chromium
attrib9
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/attrib9.C
350
utf_8
db629587302d47a98b453a1702e900c9
class __attribute__((unused)) C; struct __attribute__((unused)) S; union __attribute__((unused)) U; enum e {}; enum __attribute__((unused)) e; // { dg-warning "already defined" } struct __attribute((unused)) B *p; // { dg-warning "attributes" } template <class T> struct A { }; struct __attribute((unused)) A<int>; // { dg-warning "attributes" }
google
chromium
dllimport5
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/dllimport5.C
681
utf_8
7bb028b3290ebbfb132c053c38ca17bd
// { dg-do compile { target i?86-*-cygwin* i?86-*-mingw*} } // Report error if static symbol definition has dllimport attribute. __attribute__((dllimport)) int impvar; // OK, implicit "extern" static __attribute__((dllimport)) int static_impvar; // { dg-error "external linkage" } static __attribute__((dllexport)) int static_expvar; // { dg-error "external linkage" } static __attribute__((dllimport)) void static_impfun(void); // { dg-error "external linkage" } void foo() { __attribute__((dllimport)) int foovar; // OK, implicit "extern" foovar++; } void bar() { __attribute__((dllexport)) int barvar; // { dg-error "external linkage" } barvar++; }
google
chromium
altivec-7
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/altivec-7.C
1,456
utf_8
e63a3f726a9a2696be3fd48744dbe24b
/* Test for AltiVec type overloading and name mangling. */ /* { dg-do compile { target powerpc*-*-* } } */ /* { dg-require-effective-target powerpc_altivec_ok } */ /* { dg-options "-maltivec" } */ #include <altivec.h> void foo(vector unsigned char) { } void foo(vector signed char) { } void foo(vector bool char) { } void foo(vector unsigned short) { } void foo(vector signed short) { } void foo(vector bool short) { } void foo(vector unsigned int) { } void foo(vector signed int) { } void foo(vector bool int) { } void foo(vector float) { } void foo(vector pixel) { } void foo(int) { } void foo(unsigned int) { } void foo(float) { } /* { dg-final { scan-assembler "_Z3fooU8__vectorh" } } */ /* { dg-final { scan-assembler "_Z3fooU8__vectora" } } */ /* { dg-final { scan-assembler "_Z3fooU8__vectorU6__boolc" } } */ /* { dg-final { scan-assembler "_Z3fooU8__vectort" } } */ /* { dg-final { scan-assembler "_Z3fooU8__vectors" } } */ /* { dg-final { scan-assembler "_Z3fooU8__vectorU6__bools" } } */ /* { dg-final { scan-assembler "_Z3fooU8__vectorj" } } */ /* { dg-final { scan-assembler "_Z3fooU8__vectori" } } */ /* { dg-final { scan-assembler "_Z3fooU8__vectorU6__booli" } } */ /* { dg-final { scan-assembler "_Z3fooU8__vectorf" } } */ /* { dg-final { scan-assembler "_Z3fooU8__vectoru7__pixel" } } */ /* { dg-final { scan-assembler "_Z3fooi" } } */ /* { dg-final { scan-assembler "_Z3fooj" } } */ /* { dg-final { scan-assembler "_Z3foof" } } */
google
chromium
utf16-2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/utf16-2.C
769
utf_8
71db346237651bdbae8361a57bfc4a21
/* Test the support for char16_t* string literals. */ /* { dg-do run } */ /* { dg-options "-std=c++0x -Wall -Werror" } */ extern "C" void abort (void); const static char16_t *s0 = u"ab"; const static char16_t *s1 = u"a\u0024"; const static char16_t *s2 = u"a\u2029"; const static char16_t *s3 = u"a\U00064321"; #define A 0x0061 #define B 0x0062 #define D 0x0024 #define X 0x2029 #define Y1 0xD950 #define Y2 0xDF21 int main () { if (s0[0] != A || s0[1] != B || s0[2] != 0x0000) abort (); if (s1[0] != A || s1[1] != D || s0[2] != 0x0000) abort (); if (s2[0] != A || s2[1] != X || s0[2] != 0x0000) abort (); if (s3[0] != A || s3[1] != Y1 || s3[2] != Y2 || s3[3] != 0x0000) abort (); }
google
chromium
typeof6
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/typeof6.C
206
utf_8
cac7810767ae23faa6823a798e9c3cea
// { dg-options "" } template <class T> void test1() { int x = 0; const typeof(x) & t1 = x+0; } void test2() { int x = 0; const typeof(x) & t1 = x+0; } int main() { test1<int>(); test2 (); }
google
chromium
utf32-3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/utf32-3.C
1,288
utf_8
f0ce7d14c6af3b42645a73bd7a9fd205
/* Test concatenation of char32_t* string literals. */ /* { dg-do run } */ /* { dg-options "-std=c++0x -Wall -Werror" } */ extern "C" void abort (void); const static char32_t *s0 = U"a" U"b"; const static char32_t *s1 = U"a" "b"; const static char32_t *s2 = "a" U"b"; const static char32_t *s3 = U"a" "\u2029"; const static char32_t *s4 = "\u2029" U"b"; const static char32_t *s5 = U"a" "\U00064321"; const static char32_t *s6 = "\U00064321" U"b"; #define A 0x00000061 #define B 0x00000062 #define X 0x00002029 #define Y 0x00064321 int main () { if (sizeof ((U"a" U"b")[0]) != sizeof (char32_t)) abort (); if (sizeof ((U"a" "b")[0]) != sizeof (char32_t)) abort (); if (sizeof (( "a" U"b")[0]) != sizeof (char32_t)) abort (); if (s0[0] != A || s0[1] != B || s0[2] != 0x00000000) abort (); if (s1[0] != A || s1[1] != B || s1[2] != 0x00000000) abort (); if (s2[0] != A || s2[1] != B || s2[2] != 0x00000000) abort (); if (s3[0] != A || s3[1] != X || s3[2] != 0x00000000) abort (); if (s4[0] != X || s4[1] != B || s4[2] != 0x00000000) abort (); if (s5[0] != A || s5[1] != Y || s5[2] != 0x00000000) abort (); if (s6[0] != Y || s6[1] != B || s6[2] != 0x00000000) abort (); }
google
chromium
builtin4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/builtin4.C
226
utf_8
d0e4a0673fb68ac42869b8c996361788
// Verify that builtin is used when declared in global namespace // { dg-do compile } // { dg-options "-Wall" } extern "C" int printf(const char*,...); void foo() { printf("%d"); // { dg-warning "too few arguments" } }
google
chromium
complit8
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/complit8.C
215
utf_8
881ad6e29d36b40720a2247918f5770b
// PR c++/27270 // { dg-options "" } template<typename Entry> struct Array { Entry *array[32]; Array () : array ( (Entry*[1]) { 0, 0 } ) // { dg-error "initializers|incompatible" } {} }; Array<void*> a;
google
chromium
has_nothrow_copy_odr
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/has_nothrow_copy_odr.C
222
utf_8
b1d7423271f2f5a03ea9952092b7bef4
// PR c++/36870 // { dg-do "run" } #include <cassert> struct S { S (const S&); }; bool f (); int main () { assert (__has_nothrow_copy (S) == f ()); } S::S (const S&) { } bool f () { return __has_nothrow_copy (S); }
google
chromium
attrib29
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/attrib29.C
353
utf_8
f78a1283d2d4da5ad85040e153e6ee99
// PR c++/33506 // { dg-do compile } extern int f1 (char *) __attribute__ ((warn_unused_result)); extern int f2 (char *) throw () __attribute__ ((warn_unused_result)); extern int f2 (char *) throw (); extern int f3 (char *) __attribute__ ((nonnull (1))); extern int f4 (char *) throw () __attribute__ ((nonnull (1))); extern int f4 (char *) throw ();
google
chromium
is_pod_incomplete
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/is_pod_incomplete.C
100
utf_8
f316c6cb603f1746eab7e3d67e84b5c4
// PR c++/32158 template<typename T> struct A { A() { } }; int t[__is_pod(A<int>)?-1:1];
google
chromium
vector4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/vector4.C
162
utf_8
1d6b45dce331a414b31b64c5104ab383
/* { dg-options "" } */ /* { dg-do compile } */ // Testing if we can do a new of a vector // PR C++/28450 void* q = new int __attribute__((vector_size(8))) ();
google
chromium
has_nothrow_copy-5
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/has_nothrow_copy-5.C
173
utf_8
7d401270b58402e08a0f2291490e247b
// PR c++/36872 // { dg-do "run" } #include <cassert> struct S { S (const S&) throw (); S (int) throw (int); }; int main () { assert (__has_nothrow_copy (S)); }
google
chromium
altivec-cell-4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/altivec-cell-4.C
1,092
utf_8
a187c6adacfe593dd505a2340e53e439
/* { dg-do run { target { powerpc*-*-* && vmx_hw } } } */ /* { dg-do compile { target { powerpc*-*-* && { ! vmx_hw } } } } */ /* { dg-require-effective-target powerpc_altivec_ok } */ /* { dg-options "-maltivec" } */ /* Test the vec_splats and vec_promote VMX intrinsics. */ #include <altivec.h> extern "C" void abort (void); vector int a[] = {{0, 0, 0, 0}, {1,0,0,0}, {1,2,0,0},{1,2,3,0},{1,2,3,4},{5,2,3,4},{5,6,3,4}}; vector int c = {0,6,3,4}; vector int d = {0,0,3,4}; int main1(int t) __attribute__((noinline)); int main1(int t) { int i; vector int b = vec_splats(0); for(i = 0;i<sizeof(a)/sizeof(a[0])-1;i++) { if (__builtin_memcmp (&b, &a[i], sizeof(vector int))) abort (); b = vec_insert(i+1, b, i); } if (__builtin_memcmp (&b, &a[i], sizeof(vector int))) abort (); b = vec_insert(0, b, 0); if (__builtin_memcmp (&b, &c, sizeof(vector int))) abort (); b = vec_insert(0, b, 1); if (__builtin_memcmp (&b, &d, sizeof(vector int))) abort (); return 0; } int main(void) { return main1 (0); }
google
chromium
attrib28
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/attrib28.C
149
utf_8
b125f534d4b8de943b8618985ccee9eb
// PR c++/28558 // { dg-options "" } struct A { A(int) { } }; int main() { A a = (A __attribute__((unused)))0; // { dg-warning "attribute" } }
google
chromium
fnname3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/fnname3.C
1,216
utf_8
9e62aa095a73cd8f1f5e3c31669594cd
// Test whether __func__ works for constructors and destructors. // { dg-do run } struct uk9i { uk9i(); ~uk9i(); static const char* fname; static bool obj_exists; }; uk9i::uk9i() { obj_exists = true; fname = __func__; } uk9i::~uk9i() { obj_exists = false; fname = __func__; } const char* uk9i::fname = 0; bool uk9i::obj_exists = false; int main() { bool ok = true; ok = ok && uk9i::fname == 0; ok = ok && !uk9i::obj_exists; { uk9i tmp; ok = ok && uk9i::obj_exists; ok = ok && uk9i::fname != 0; if (ok) { ok = ok && uk9i::fname[0] == 'u'; ok = ok && uk9i::fname[1] == 'k'; ok = ok && uk9i::fname[2] == '9'; ok = ok && uk9i::fname[3] == 'i'; ok = ok && uk9i::fname[4] == '\0'; } } ok = ok && !uk9i::obj_exists; ok = ok && uk9i::fname != 0; if (ok) { ok = ok && uk9i::fname[0] == '~'; ok = ok && uk9i::fname[1] == 'u'; ok = ok && uk9i::fname[2] == 'k'; ok = ok && uk9i::fname[3] == '9'; ok = ok && uk9i::fname[4] == 'i'; ok = ok && uk9i::fname[5] == '\0'; } return ok ? 0 : 1; }
google
chromium
asmspec1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/asmspec1.C
162
utf_8
591afa4c1c3abd17556ced758e905f6b
// PR c++/28343 // { dg-do compile } struct A { int i __asm__(int); // { dg-error "before" } static int j __asm__(int); // { dg-error "before" } };
google
chromium
vla8
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/vla8.C
165
utf_8
527f30cd7292076034b829d15a5232ca
// PR c++/42387 // { dg-options "" } template<class PF> struct AvlTreeIter { int Num(); AvlTreeIter() { new (void* [Num()]); } }; AvlTreeIter<int> a;
google
chromium
utf16-3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/utf16-3.C
1,295
utf_8
88060cfdc7c006f72fb8b6f665dfbcc8
/* Test concatenation of char16_t* string literals. */ /* { dg-do run } */ /* { dg-options "-std=c++0x -Wall -Werror" } */ extern "C" void abort (void); const static char16_t *s0 = u"a" u"b"; const static char16_t *s1 = u"a" "b"; const static char16_t *s2 = "a" u"b"; const static char16_t *s3 = u"a" "\u2029"; const static char16_t *s4 = "\u2029" u"b"; const static char16_t *s5 = u"a" "\U00064321"; const static char16_t *s6 = "\U00064321" u"b"; #define A 0x0061 #define B 0x0062 #define X 0x2029 #define Y1 0xD950 #define Y2 0xDF21 int main () { if (sizeof ((u"a" u"b")[0]) != sizeof (char16_t)) abort (); if (sizeof ((u"a" "b")[0]) != sizeof (char16_t)) abort (); if (sizeof (( "a" u"b")[0]) != sizeof (char16_t)) abort (); if (s0[0] != A || s0[1] != B || s0[2] != 0x0000) abort (); if (s1[0] != A || s1[1] != B || s1[2] != 0x0000) abort (); if (s2[0] != A || s2[1] != B || s2[2] != 0x0000) abort (); if (s3[0] != A || s3[1] != X || s3[2] != 0x0000) abort (); if (s4[0] != X || s4[1] != B || s4[2] != 0x0000) abort (); if (s5[0] != A || s5[1] != Y1 || s5[2] != Y2 || s5[3] != 0x0000) abort (); if (s6[0] != Y1 || s6[1] != Y2 || s6[2] != B || s6[3] != 0x0000) abort (); }
google
chromium
altivec-13
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/altivec-13.C
1,748
utf_8
8269af4690723c041adba936c4db6226
/* Check that vec_step can be used with const vector types. This test is derived from parts of gcc.dg/vmx/8-02.c from Motorola's AltiVec testsuite. */ /* { dg-do compile { target powerpc*-*-* } } */ /* { dg-require-effective-target powerpc_altivec_ok } */ /* { dg-options "-maltivec" } */ #include <altivec.h> extern vector unsigned char vuc; extern vector signed char vsc; extern vector bool char vbc; extern vector unsigned short vus; extern vector signed short vss; extern vector bool short vbs; extern vector unsigned int vui; extern vector signed int vsi; extern vector bool int vbi; extern vector pixel vp; extern vector float vf; extern const vector unsigned char cvuc; extern const vector signed char cvsc; extern const vector bool char cvbc; extern const vector unsigned short cvus; extern const vector signed short cvss; extern const vector bool short cvbs; extern const vector unsigned int cvui; extern const vector signed int cvsi; extern const vector bool int cvbi; extern const vector pixel cvp; extern const vector float cvf; void foo (void) { int i_vuc = vec_step (vuc); int i_vsc = vec_step (vsc); int i_vbc = vec_step (vbc); int i_vus = vec_step (vus); int i_vss = vec_step (vss); int i_vbs = vec_step (vbs); int i_vui = vec_step (vui); int i_vsi = vec_step (vsi); int i_vbi = vec_step (vbi); int i_vp = vec_step (vp); int i_vf = vec_step (vf); int i_cvuc = vec_step (cvuc); int i_cvsc = vec_step (cvsc); int i_cvbc = vec_step (cvbc); int i_cvus = vec_step (cvus); int i_cvss = vec_step (cvss); int i_cvbs = vec_step (cvbs); int i_cvui = vec_step (cvui); int i_cvsi = vec_step (cvsi); int i_cvbi = vec_step (cvbi); int i_cvp = vec_step (cvp); int i_cvf = vec_step (cvf); }
google
chromium
typeof5
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/typeof5.C
133
utf_8
894af6b53e421663726a15c3ffb4145c
// { dg-options "" } int foo; template <class T> struct Base {}; template <class T> struct Derived : public Base<typeof(foo)> {};