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
|
stmtexpr6
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/stmtexpr6.C
| 207 |
utf_8
|
d104145185fba3180b02bfff96944804
|
// { dg-do run }
// { dg-options "" }
int a[128];
int main() {
// Check that array-to-pointer conversion occurs in a
// statement-expression.
if (sizeof (({ a; })) != sizeof (int *))
return 1;
}
|
google
|
chromium
|
asm1
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/asm1.C
| 986 |
utf_8
|
d377fb4f9ef6d1ed2029c1551ddf7e3b
|
// Check that the 3.1 named operand syntax can be used in template functions.
struct arg1 {
int value;
static const int info = 99;
};
struct arg2 {
int value;
static const int info = 11;
};
template<int j>
int foo (void)
{
int i;
asm ("# foo on %[third] %[second] %[fourth] %[first]"
: [first] "=r" (i)
: [second] "i" (j),
[third] "i" (j + 2),
[fourth] "i" (100));
return i;
}
template<class TYPE>
TYPE bar (TYPE t)
{
asm ("# bar on %[first] %[second] %[third]"
: [first] "=r" (t.value)
: [second] "i[first]" (t.value),
[third] "i" (t.info));
return t;
}
template<class TYPE>
struct S {
static void frob (TYPE t)
{
asm ("# frob on %[arg]" :: [arg] "i" (t.info));
}
};
void test ()
{
arg1 x;
arg2 y;
foo<42> ();
bar (x);
bar (y);
S<arg1>::frob (x);
}
// { dg-final { scan-assembler "foo on" } }
// { dg-final { scan-assembler "bar on" } }
// { dg-final { scan-assembler "frob on" } }
|
google
|
chromium
|
attrib6
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/attrib6.C
| 339 |
utf_8
|
76284b29c6fce52f56ddbcc04acd3a97
|
//
// Test that the nothrow attribute is working correctly.
//
// Written by Richard Henderson, 26 May 2002.
// { dg-do link }
extern void foo() __attribute__((nothrow));
extern void link_error();
int main()
{
try {
foo();
} catch (...) {
link_error();
}
}
void foo() { }
|
google
|
chromium
|
altivec-2
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/altivec-2.C
| 515 |
utf_8
|
beb7314f5c356790a9a69fcdbb977f7b
|
/* { dg-do compile { target powerpc*-*-* } } */
/* { dg-require-effective-target powerpc_altivec_ok } */
/* { dg-options "-maltivec -Wall" } */
/* This test checks if AltiVec builtins accept const-qualified
arguments. */
#include <altivec.h>
int main (int argc, const char * argv[])
{
int i = 0;
const float cf = 1.0;
vector float v;
const vector float cv = (vector float){1.0, 2.0, 3.0, 4.0};
vec_dst(&cv, i, 0);
v = vec_ld(0, &cv);
v = vec_lde(0, &cf);
vec_lvsl(0, &cf);
return 0;
}
|
google
|
chromium
|
label8
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/label8.C
| 204 |
utf_8
|
2028776db2296e4738fb6927ced8ac18
|
// PR c++/32121
// { dg-do compile }
int f (void)
{
__label__ a, b;
__label__ c;
a:;
b:;
c:;
{
__label__ d;
d:;
if (0)
{
__label__ e;
__label__ f;
f:;
e:;
}
}
}
|
google
|
chromium
|
utf-cxx0x
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/utf-cxx0x.C
| 338 |
utf_8
|
fcea970f9eed217bb14dbbf80a19c539
|
/* Test parsing of u and U prefixes when also used as macros. */
/* { dg-do compile } */
/* { dg-options "-std=c++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
|
no-asm-2
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/no-asm-2.C
| 406 |
utf_8
|
74e645db0d8a1393088286f041e696d6
|
// { dg-do compile }
// { dg-options "-fno-asm" }
// Verify that the keyword asm and the GNU extension typeof are not
// recognized as keywords when using -fno-asm. Having -fno-asm affect
// a standard C++ keyword seems strange, but that is existing
// behaviour. If that behaviour changes, this test should change.
int asm; // { dg-bogus "before .asm." }
int typeof; // { dg-bogus "before .typeof." }
|
google
|
chromium
|
utf-cxx98
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/utf-cxx98.C
| 850 |
utf_8
|
39aea07a1c0e30a41606517858ab5ac0
|
/* Expected errors for char16_t/char32_t in c++98. */
/* Ensure u and U prefixes are parsed as separate tokens in c++98. */
/* { dg-do compile } */
/* { dg-options "-std=c++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
|
pr17577
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/pr17577.C
| 150 |
utf_8
|
210171cdbd9571de1bfd894e6c809efa
|
// Test for PR c++/17577.
/* { dg-do compile } */
#include "pr17577.h"
#pragma implementation "pr17577.h" /* { dg-warning "appears after file" } */
|
google
|
chromium
|
attrib13
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/attrib13.C
| 189 |
utf_8
|
3c5631b027ef64c7af2375ff8239a83f
|
// PR c++/13854
extern char *rindex (__const char *__s, int __c) throw () __attribute__ ((__pure__));
extern char *rindex (__const char *__s, int __c) throw () __attribute__ ((__pure__));
|
google
|
chromium
|
complex5
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/complex5.C
| 136 |
utf_8
|
053ce94c0ccf34dd5d9b0e28fb917d9b
|
/* PR c++/21210 */
/* { dg-do compile } */
/* { dg-options "-O2" } */
typedef float __complex__ fcomplex;
fcomplex cplx = fcomplex(0);
|
google
|
chromium
|
complit1
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/complit1.C
| 189 |
utf_8
|
5163e6d885c069c6cf53f4a8afd5e3c8
|
// PR c++/11063
// { dg-options "" }
class Foo
{
private:
const int val_[2];
public:
Foo(int, int);
};
Foo::Foo(int v0, int v1)
: val_((int[]) {v0, v1}) // { dg-error "" "" }
{
}
|
google
|
chromium
|
complex2
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/complex2.C
| 53 |
utf_8
|
756c2a4b372550f3325f3e64e36de6a3
|
// PR c++/31388
// { dg-options "" }
bool b = !0i;
|
google
|
chromium
|
java-1
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/java-1.C
| 498 |
utf_8
|
6093ddc315b5e30bc17b5cc5bfdca3c7
|
// { dg-do compile { target { ! { powerpc-ibm-aix* } } } }
// { dg-options "" }
// Test extern "java" and some throwing of the objects.
extern "Java"
namespace java
{
namespace lang
{
class Throwable;
class Class;
}
}
typedef class java::lang::Throwable* jthrowable;
typedef class java::lang::Class* jclass;
class java::lang::Throwable {
public:
static jclass class$;
};
int
_Jv_FindClassFromSignature ( )
try
{
}
catch (java::lang::Throwable *ncdfe) {}
|
google
|
chromium
|
cleanup-1
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/cleanup-1.C
| 1,294 |
utf_8
|
49a56da77ffbc29f9b3049a402b22e55
|
/* { dg-do compile } */
/* { dg-options "-Wall" } */
/* Validate expected warnings and errors. */
#define U __attribute__((unused))
#define C(x) __attribute__((cleanup(x)))
static int f1(void *x U) { return 0; }
static void f2() { } /* { dg-error "too many arguments" } */
static void f3(void) { } /* { dg-error "too many arguments" } */
static void f4(void *x U) { }
static void f5(int *x U) { }
static void f6(double *x U) { }
static void f7(const int *x U) { }
static void f8(const int *x U, int y U) { } /* { dg-error "too few arguments" } */
static void f9(int x U) { }
void test(void)
{
int o1 C(f1);
int o2 C(f2); /* { dg-error "at this point" } */
int o3 C(f3); /* { dg-error "at this point" } */
int o4 C(f4);
int o5 C(f5);
int o6 C(f6); /* { dg-error "cannot convert" } */
int o7 C(f7);
int o8 C(f8); /* { dg-error "at this point" } */
int o9 C(f9); /* { dg-error "conversion" } */
int o10 U C(undef); /* { dg-error "not a function" } */
int o11 U C(o1); /* { dg-error "not a function" } */
int o12 U C("f1"); /* { dg-error "not an identifier" } */
static int o13 U C(f1); /* { dg-warning "attribute ignored" } */
}
int o14 C(f1); /* { dg-warning "attribute ignored" } */
void t15(int o U C(f1)) {} /* { dg-warning "attribute ignored" } */
|
google
|
chromium
|
align1
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/align1.C
| 501 |
utf_8
|
8086207ba3911ed58a971e642fbfdd29
|
// Test that __attribute__ ((aligned)) is preserved.
// The alignment used to be 64 but Cygwin does not
// support an alignment greater than 16 and COFF
// not support an alignment greater than 4.
extern "C" int printf (const char *, ...);
typedef float at[4][4] __attribute__ ((aligned));
float dummy[4][4][15];
static volatile at a1[15];
float f1 __attribute__ ((aligned));
int
main (void)
{
printf ("%d %d\n", __alignof (a1), __alignof (f1));
return (__alignof (a1) < __alignof (f1));
}
|
google
|
chromium
|
altivec-10
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/altivec-10.C
| 706 |
utf_8
|
285ca4465aa5835371c2ac366d888737
|
/* { dg-do compile { target powerpc*-*-* } } */
/* { dg-require-effective-target powerpc_altivec_ok } */
/* { dg-options "-save-temps -maltivec" } */
#include <altivec.h>
#define vector_float vector float
#define vector_float_foo vector float foo
#define vector_float_bar_eq vector float bar =
/* NB: Keep the following split across three lines. */
vector
int
a1 = { 100, 200, 300, 400 };
vector_float f1 = { 1.0, 2.0, 3.0, 4.0 };
vector_float_foo = { 3.0, 4.0, 5.0, 6.0 };
vector_float_bar_eq { 8.0, 7.0, 6.0, 5.0 };
/* { dg-final { cleanup-saved-temps } } */
|
google
|
chromium
|
utf-mangle
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/utf-mangle.C
| 451 |
utf_8
|
e162aed6c35e0fca8944455ebdfca829
|
// Test the support for char16_t character constants.
// { dg-do compile }
// { dg-options "-std=c++0x" }
void f0 (char16_t c) {}
void f1 (char32_t c) {}
void f2 (char16_t *s) {}
void f3 (char32_t *s) {}
// { dg-final { scan-assembler "_Z2f0Ds:" } }
// { dg-final { scan-assembler "_Z2f1Di:" } }
// { dg-final { scan-assembler "_Z2f2PDs:" } }
// { dg-final { scan-assembler "_Z2f3PDi:" } }
|
google
|
chromium
|
builtin8
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/builtin8.C
| 238 |
utf_8
|
f5cd77399383b76230ff688140e0b73d
|
// PR c++/19628
// Verify that __builtin_constant_p may appear in a constant-expression.
// { dg-do compile }
template <int I>
int f(int x[__builtin_constant_p(I)])
{
return x[0];
}
int g()
{
int a[1] = { 7 };
return f<32>(a);
}
|
google
|
chromium
|
has_nothrow_copy-4
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/has_nothrow_copy-4.C
| 173 |
utf_8
|
832fc3c19de74df41cdc6698eda29f71
|
// PR c++/36872
// { dg-do "run" }
#include <cassert>
struct S {
S (const S&) throw ();
S (...) throw (int);
};
int main ()
{
assert (__has_nothrow_copy (S));
}
|
google
|
chromium
|
complex3
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/complex3.C
| 364 |
utf_8
|
fc4c3dfc15df590705add4def1833513
|
// PR c++/31780
// { dg-do run }
// { dg-options "" }
// Test that we can implicitly convert to _Complex, but that it's worse
// than a scalar arithmetic conversion.
extern "C" void exit (int);
int r = 0;
void f (_Complex int) { ++r; }
void f (double) { }
void g (_Complex int) { }
int main()
{
f (1);
g (1);
return r;
}
void bar()
{
r ? 0i : 0;
}
|
google
|
chromium
|
gnu-inline-class-static
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/gnu-inline-class-static.C
| 566 |
utf_8
|
3b39aa1a4010d4127a39b9443b421c4c
|
/* { 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" } } */
#undef IN_CLASS
#define IN_CLASS gnu_test_static
struct IN_CLASS {
static int func1(void);
static int func2(void);
static int func3(void);
static int func4(void);
static int func5(void);
};
#include "gnu-inline-global.C"
|
google
|
chromium
|
instantiate2
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/instantiate2.C
| 435 |
utf_8
|
34f12a4e88c7d91723528bbca194ce29
|
// Test that 'static template' instantiates statics.
// { dg-do compile }
// { dg-options "-fno-implicit-templates" }
template <class T> struct A {
static T t;
};
template <class T> T A<T>::t = 0;
static template struct A<int>;
// { dg-final { scan-assembler "\n_?_ZN1AIiE1tE(:|\n|\t)" } }
void test_int() { A<int>::t = 42; }
// { dg-final { scan-assembler-not "\n_?_ZN1AIcE1tE(:|\n|\t)" } }
void test_char() { A<char>::t = 42; }
|
google
|
chromium
|
is_class
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/is_class.C
| 1,096 |
utf_8
|
9dab67ccf47bd21c44d8bdd55160818b
|
// { 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_class(T); }
template<typename T>
class My
{
public:
bool
f()
{ return !!__is_class(T); }
};
template<typename T>
class My2
{
public:
static const bool trait = __is_class(T);
};
template<typename T>
const bool My2<T>::trait;
template<typename T, bool b = __is_class(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_class(T) && f<T>() \
&& My<T>().f() && My2<T>::trait && My3<T>().f())
#define NTEST(T) (!__is_class(T) && !f<T>() \
&& !My<T>().f() && !My2<T>::trait && !My3<T>().f())
int main()
{
assert (NTEST (int));
assert (NTEST (void));
assert (PTEST (A));
assert (PTEST (B));
assert (NTEST (U));
return 0;
}
|
google
|
chromium
|
has_nothrow_copy-2
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/has_nothrow_copy-2.C
| 263 |
utf_8
|
565040c36d2b6ca5597d3c9e47c67b9b
|
// PR c++/36871
// { dg-do "run" }
#include <cassert>
struct A { template <class T> A (T) throw (int); };
struct B { B (B&) throw (); template <class T> B (T) throw (int); };
int main ()
{
assert (__has_nothrow_copy (A));
assert (__has_nothrow_copy (B));
}
|
google
|
chromium
|
attrib19
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/attrib19.C
| 133 |
utf_8
|
156cb04363d25c08db71f92c962b39d7
|
// PR c++/19739
void Dummy() __attribute__(( , ));
void Dummy() {}
int main (int argc, char **argv)
{
Dummy();
return 0;
}
|
google
|
chromium
|
attrib2
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/attrib2.C
| 169 |
utf_8
|
7b769337b45c87f3c5f62ad1dc100502
|
// Test that an early attribute doesn't confuse uses of a class.
// { dg-do compile }
struct __attribute__ ((packed)) A
{
void f () const;
};
void
A::f () const
{
}
|
google
|
chromium
|
interface3b
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/interface3/interface3b.C
| 187 |
utf_8
|
955cb5adc4b67e74b78b47b9627b3c42
|
// PR c++/26195
// { dg-do link }
// { dg-additional-sources "interface3b2.cc" }
// { dg-options "-fno-inline" }
#pragma implementation "dir2/interface3.cc"
#include "dir1/interface3.h"
|
google
|
chromium
|
interface3a
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/interface3/interface3a.C
| 191 |
utf_8
|
eb64fad1b252e9235c6b09d561b8ef2c
|
// PR c++/26195
// { dg-do link }
// { dg-additional-sources "interface3a2.cc" }
// { dg-options "-I. -fno-inline" }
#pragma implementation "dir1/interface3.cc"
#include "dir1/interface3.h"
|
google
|
chromium
|
typeinfo2
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/typeinfo2.C
| 330 |
utf_8
|
433eef96f06d882d10d4a620b7972e48
|
// PR c++/35368
// { dg-require-visibility "" }
#pragma GCC visibility push (hidden)
struct A
{
A();
virtual ~A() { }
};
A::A()
{
}
void foo(A *a)
{
delete a;
}
// { dg-final { scan-not-hidden "_ZTVN10__cxxabiv117__class_type_infoE" } }
// { dg-final { scan-hidden "_ZTI1A" } }
// { dg-final { scan-hidden "_ZTV1A" } }
|
google
|
chromium
|
warn3
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/warn3.C
| 568 |
utf_8
|
88245367fabb2ec1176181616f29c129
|
// Tests for various visibility mismatch situations.
// { dg-require-visibility "" }
// { dg-final { scan-not-hidden "_ZN1A1fEv" } }
struct __attribute ((visibility ("hidden"))) A
{
// This is OK, A::f gets default visibility.
__attribute ((visibility ("default"))) void f ();
};
void A::f() { }
// This gets a warning because B objects might rely
// on hidden symbols from A.
struct B
{ // { dg-warning "visibility" }
A a;
};
// This one has explicit visibility, so it doesn't get a warning.
struct __attribute ((visibility ("default"))) C
{
A a;
};
|
google
|
chromium
|
visibility-3
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/visibility-3.C
| 204 |
utf_8
|
b9dc9fa8adc27f38cdd6d69f47df7504
|
/* Test visibility attribute on forward declaration of global variable */
/* { dg-require-visibility "" }
/* { dg-final { scan-hidden "xyzzy" } } */
int
__attribute__((visibility ("hidden")))
xyzzy = 5;
|
google
|
chromium
|
visibility-10
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/visibility-10.C
| 734 |
utf_8
|
7f98e383bb2386437d2d7b37cf32a6b8
|
// { dg-require-visibility "" }
// { dg-require-dll "" }
extern void __attribute__((dllimport, visibility("hidden")))
f1(); // { dg-error "visibility" }
extern void __attribute__((visibility("hidden"), dllimport))
f2(); // { dg-error "visibility" }
extern void __attribute__((dllexport, visibility("hidden")))
f3(); // { dg-error "visibility" }
extern void __attribute__((visibility("hidden"), dllexport))
f4(); // { dg-error "visibility" }
extern void __attribute__((visibility("default"), dllimport))
f5();
extern void __attribute__((dllimport, visibility("default")))
f6();
extern void __attribute__((visibility("default"), dllexport))
f7();
extern void __attribute__((dllexport, visibility("default")))
f8();
|
google
|
chromium
|
template3
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/template3.C
| 859 |
utf_8
|
fb3ad5f97cd55ecbfba7cb114a0aeaf1
|
// PR c++/17470
// Test that we can give visibility to explicit template instantiations
// { dg-require-visibility "" }
// { dg-final { scan-hidden "_ZN1AIlE1fEl" } }
// { dg-final { scan-hidden "_ZN1AIiE1fEi" } }
// { dg-final { scan-not-hidden "_ZN1AIcE1fEc" } }
// { dg-final { scan-hidden "_Z8identityIdET_S0_" } }
// { dg-final { scan-not-hidden "_Z8identityIiET_S0_" } }
template <class T> T identity(T t) { return t; }
template __attribute__((visibility("hidden"))) double identity(double);
template int identity(int);
template <class T> struct A { void f (T); };
template <class T> void A<T>::f (T) { }
template struct __attribute ((visibility ("hidden"))) A<int>;
template<> struct __attribute ((visibility ("hidden"))) A<long> { void f(long); };
// inherits hidden visibility from its class
void A<long>::f (long) { }
template struct A<char>;
|
google
|
chromium
|
anon10
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/anon10.C
| 581 |
utf_8
|
a584d24c7f0c42d5d7b9adeaab7e6e35
|
// http://bugzilla.redhat.com/411871
// { dg-do compile }
extern "C" int printf (const char *, ...);
struct E
{
template <typename T> E (const volatile T&);
template <typename T> E (T&);
char x[64];
};
template<typename T> struct D
{
static E foo (E, ...);
static int foo (T, int);
};
template<typename T, typename U> struct C
{
static T ca;
static const int value = sizeof (D<U>::foo (ca, 0)) == sizeof (int);
};
struct A
{
int a;
};
namespace
{
struct B
{
int a;
};
}
int bar (void)
{
C<A, int> a;
C<B, int> b;
return a.value + b.value;
}
|
google
|
chromium
|
warn4
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/warn4.C
| 330 |
utf_8
|
dc76fc17bcb2fe7dfe39be101a9bd6b5
|
// Warn if we try to give an instantiation visibility after it's already
// been instantiated.
// { dg-require-visibility "" }
template <class T> struct A { void f (T); };
template <class T> void A<T>::f (T) { }
A<double> ad;
template struct __attribute ((visibility ("hidden"))) A<double>; // { dg-warning "already defined" }
|
google
|
chromium
|
template6
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/template6.C
| 390 |
utf_8
|
00cfc060a9c05e18b0256ee03319fad5
|
// Test for explicit visibility taking precedence
// { dg-require-visibility "" }
// { dg-final { scan-not-hidden "_ZN1AIiE1fEv" } }
template <class T> struct A
{
// This attribute takes precedence over...
__attribute ((visibility ("default"))) void f ();
};
template <class T>
void A<T>::f ()
{ }
// ...this attribute.
template struct __attribute ((visibility ("hidden"))) A<int>;
|
google
|
chromium
|
visibility-4
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/visibility-4.C
| 224 |
utf_8
|
9915a08c47035d39990d7918773f9236
|
/* Test visibility attribute on forward declaration of global variable */
/* { dg-require-visibility "" }
/* { dg-final { scan-hidden "xyzzy" } } */
extern int __attribute__ ((visibility ("hidden")))
xyzzy;
int xyzzy = 5;
|
google
|
chromium
|
anon5
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/anon5.C
| 155 |
utf_8
|
78ae1691e214193d8b3ffd248e757842
|
// PR c++/32596
// { dg-do compile }
namespace
{
template<class T> inline void char_less(void) { }
template<> inline void char_less<char>(void) { }
}
|
google
|
chromium
|
arm3
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/arm3.C
| 1,091 |
utf_8
|
f345cf40b6aa519d41d014b430e0ee2f
|
// { dg-do compile { target arm*-*-*eabi* } }
// { dg-require-dll "" }
// { dg-options "-fvisibility=hidden" }
/* From ARM C++ ABI \S 3.2.5.5:
A class should be exported unless explicitly tagged otherwise.
This admonition applies even on DLL-based systems where hidden
visibility is the default. We want -fvisibility=hidden to behave
identically to the situation where hidden visibility is the
hard-wired default. So, both A and B are exported classes.
Furthermore:
If CAG symbol Y names one of the impedimenta associated with an
exported class X:
...
* Otherwise, if X has no key function:
- Y is exported from ... each DLL that refers to X and uses Y.
So, the type-info and virtual-table symbols associated with A and B
must be exported. */
// { dg-final { scan-not-hidden "_ZTI1A" } }
// { dg-final { scan-not-hidden "_ZTS1A" } }
// { dg-final { scan-not-hidden "_ZTV1B" } }
// { dg-final { scan-not-hidden "_ZTI1B" } }
// { dg-final { scan-not-hidden "_ZTS1B" } }
struct A {};
struct B : virtual public A {};
B b;
|
google
|
chromium
|
class1
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/class1.C
| 516 |
utf_8
|
6ac6f80a3ee897e672f5acbff682b908
|
// PR c++/26905
// Init should not be hidden, so calling it should use the PLT.
// { dg-options "-fpic" }
// { dg-do compile { target i?86-*-* x86_64-*-* } }
// { dg-skip-if "" { *-*-darwin* } { "*" } { "" } }
// { dg-require-visibility "" }
#pragma GCC visibility push(hidden)
struct __attribute__ ((visibility ("default"))) nsINIParser
{
static void Init();
};
__attribute__ ((visibility ("default")))
void
CheckCompatibility(void)
{
nsINIParser::Init();
}
|
google
|
chromium
|
template4
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/template4.C
| 1,555 |
utf_8
|
f5ac27fd889272cadd85a3d10b84b964
|
// Test for explicit visibility on template vs. #pragma vis at explicit
// instantiation/specialization point for plain function templates.
// { dg-require-visibility "" }
// { dg-final { scan-hidden "_Z3fooIdEvT_" } }
// { dg-final { scan-hidden "_Z3fooIlEvT_" } }
// { dg-final { scan-hidden "_Z3fooIcEvT_" } }
// { dg-final { scan-hidden "_Z3fooIiEvT_" } }
// { dg-final { scan-not-hidden "_Z3fooIfEvT_" } }
// { dg-final { scan-not-hidden "_Z3fooIsEvT_" } }
// { dg-final { scan-hidden "_Z3barIdEvT_" } }
// { dg-final { scan-hidden "_Z3barIlEvT_" } }
// { dg-final { scan-hidden "_Z3barIiEvT_" } }
// { dg-final { scan-hidden "_Z3barIcEvT_" } }
// { dg-final { scan-not-hidden "_Z3barIfEvT_" } }
// { dg-final { scan-not-hidden "_Z3barIsEvT_" } }
#pragma GCC visibility push(hidden)
template <class T> void bar(T) { }
#pragma GCC visibility pop
template void bar (long);
template<> void bar (double) { }
template __attribute ((visibility ("default"))) void bar (short);
template<> __attribute ((visibility ("default"))) void bar (float) { }
#pragma GCC visibility push(default)
template<> void bar(char) { }
template void bar(int);
#pragma GCC visibility pop
template <class T> __attribute ((visibility ("hidden"))) void foo(T) { }
template void foo (long);
template<> void foo (double) { }
template __attribute ((visibility ("default"))) void foo (short);
template<> __attribute ((visibility ("default"))) void foo (float) { }
#pragma GCC visibility push(default)
template<> void foo(char) { }
template void foo(int);
#pragma GCC visibility pop
|
google
|
chromium
|
symbian2
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/symbian2.C
| 345 |
utf_8
|
b5a114efbd6581d9e2dba525c8afe61a
|
// { dg-do compile { target arm*-*-symbianelf* } }
// Class data should not be exported.
// { dg-final { scan-hidden "_ZTI1A" } }
// { dg-final { scan-hidden "_ZTS1A" } }
// { dg-final { scan-hidden "_ZTV1B" } }
// { dg-final { scan-hidden "_ZTI1B" } }
// { dg-final { scan-hidden "_ZTS1B" } }
struct A {};
struct B : virtual public A {};
B b;
|
google
|
chromium
|
anon9
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/anon9.C
| 146 |
utf_8
|
42860d01e474344b2b2c19b124253c3c
|
// PR c++/34238
// { dg-do compile }
namespace
{
template <typename T = int> struct A
{
static const bool a = true;
};
}
struct A<> a;
|
google
|
chromium
|
anon8
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/anon8.C
| 500 |
utf_8
|
ff6b9da6f0d898a0576910dc60586fdc
|
// PR c++/34213
// { dg-do compile }
template <void (*fn) ()>
void call ()
{
fn ();
}
namespace
{
struct B1
{
static void fn1 () {}
static void fn4 ();
};
void fn3 () {}
void B1::fn4 () {}
static void fn5 () {}
}
int main ()
{
struct B2
{
static void fn2 () {}
};
call<&B1::fn1> ();
call<&B2::fn2> (); // { dg-error "not external linkage|no matching" }
call<&fn3> ();
call<&B1::fn4> ();
call<&fn5> (); // { dg-error "not external linkage|no matching" }
}
|
google
|
chromium
|
guard1
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/guard1.C
| 485 |
utf_8
|
e803713a7240f84bdbab19c61f163d46
|
// { dg-options "-fvisibility=hidden" }
// { dg-require-visibility "" }
// { dg-final { scan-not-hidden "_ZGVZN5otherclEvE4s_cd" } }
extern "C" int printf (const char *, ...);
#define DLLEXPORT __attribute__ ((visibility("default")))
struct class_data
{
int apple;
class_data() { printf("non trivial ctor\n"); }
};
struct DLLEXPORT other
{
class_data* operator ()()
{
static class_data s_cd;
return &s_cd;
}
};
int main()
{
other aFoo;
aFoo();
return 0;
}
|
google
|
chromium
|
pragma
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/pragma.C
| 295 |
utf_8
|
56d8136e642cb24cb4da8e83e4f943f7
|
/* Test that #pragma GCC visibility affects class members. */
/* { dg-do compile } */
/* { dg-require-visibility "" } */
/* { dg-final { scan-hidden "_ZN3Foo6methodEv" } } */
#pragma GCC visibility push(hidden)
class Foo
{
void method();
};
#pragma GCC visibility pop
void Foo::method() { }
|
google
|
chromium
|
fvisibility-override1
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/fvisibility-override1.C
| 329 |
utf_8
|
05621e547003978809101724b30f453e
|
/* Test that -fvisibility does not override class member specific settings. */
/* { dg-do compile } */
/* { dg-require-visibility "" } */
/* { dg-options "-fvisibility=hidden" } */
/* { dg-final { scan-not-hidden "methodEv" } } */
class __attribute__ ((visibility ("default"))) Foo
{
void method();
};
void Foo::method() { }
|
google
|
chromium
|
visibility-11
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/visibility-11.C
| 254 |
utf_8
|
810e1cafeb22e936dfd0834c4e0f0b42
|
// PR target/39175
// { dg-do compile }
// { dg-require-visibility "" }
// { dg-options "-O2 -fvisibility=hidden -fpic" { target fpic } }
__attribute__((noinline)) int
foo (int x)
{
return x;
}
int foo (int x);
int
bar (int x)
{
return foo (x);
}
|
google
|
chromium
|
visibility-8
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/visibility-8.C
| 1,316 |
utf_8
|
1e3d15af5ef5d1e7ce91f6fb5b2ce876
|
// Test that a definition marked with dllexport has default
// visibility.
// { dg-require-visibility "" }
// { dg-require-dll "" }
// { dg-options "-fvisibility=hidden" }
// { dg-final { scan-not-hidden "_ZN1A1fEv" } }
// { dg-final { scan-not-hidden "_Z1gv" } }
// { dg-final { scan-not-hidden "_Z1hv" } }
// { dg-final { scan-not-hidden "_ZN1BC1Ev" } }
// { dg-final { scan-not-hidden "_ZN1BC2Ev" } }
// { dg-final { scan-not-hidden "_ZN1BD0Ev" } }
// { dg-final { scan-not-hidden "_ZN1BD1Ev" } }
// { dg-final { scan-not-hidden "_ZN1BD2Ev" } }
// { dg-final { scan-not-hidden "_ZN1B1iEv" } }
// { dg-final { scan-not-hidden "_ZN1B1jEv" } }
// { dg-final { scan-not-hidden "_ZN1A1a" } }
// { dg-final { scan-not-hidden "_ZN1B1b" } }
// { dg-final { scan-not-hidden "k" } }
// { dg-final { scan-not-hidden "l" } }
struct __declspec(dllexport) A {
void f();
static int a;
};
void A::f() {}
int A::a;
__declspec(dllexport) void g() {}
__declspec(dllexport) void h();
void h() {}
struct B {
B();
__declspec(dllexport) virtual ~B();
void i();
__declspec(dllexport) void j();
__declspec(dllexport) static int b;
};
__declspec(dllexport) B::B() {}
B::~B() {}
__declspec(dllexport) void B::i() {}
void B::j() {}
int B::b;
__declspec(dllexport) int k;
__declspec(dllexport) extern int l;
int l;
|
google
|
chromium
|
typeinfo3
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/typeinfo3.C
| 796 |
utf_8
|
e47d06dbe235e9ad9f7950da814d16ef
|
// PR c++/35368
// { dg-require-visibility "" }
#pragma GCC visibility push (hidden)
#include <typeinfo>
const std::type_info& info1 = typeid(int []);
const std::type_info& info2 = typeid(int);
enum E { e = 0 };
const std::type_info& info3 = typeid(E);
struct S { S (); };
const std::type_info& info4 = typeid(S);
const std::type_info& info5 = typeid(int *);
// { dg-final { scan-not-hidden "_ZTVN10__cxxabiv117__array_type_infoE" } }
// { dg-final { scan-not-hidden "_ZTVN10__cxxabiv116__enum_type_infoE" } }
// { dg-final { scan-hidden "_ZTI1S" } }
// { dg-final { scan-hidden "_ZTS1S" } }
// { dg-final { scan-hidden "info1" } }
// { dg-final { scan-hidden "info2" } }
// { dg-final { scan-hidden "info3" } }
// { dg-final { scan-hidden "info4" } }
// { dg-final { scan-hidden "info5" } }
|
google
|
chromium
|
visibility-7
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/visibility-7.C
| 375 |
utf_8
|
47a67b29187cc189e64d6b11782f0dba
|
/* Test warning from conflicting visibility specifications. */
/* { dg-require-visibility "protected" } */
/* { dg-final { scan-hidden "xyzzy" } } */
extern int
__attribute__((visibility ("hidden")))
xyzzy; /* { dg-warning "previous declaration here" "" } */
int
__attribute__((visibility ("protected")))
xyzzy = 5; /* { dg-warning "visibility attribute ignored" "" } */
|
google
|
chromium
|
pragma-override1
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/pragma-override1.C
| 384 |
utf_8
|
a8d59950cbc8ed898d19dfae9f599221
|
/* Test that #pragma GCC visibility does not override class member specific settings. */
/* { dg-do compile } */
/* { dg-require-visibility "internal" } */
/* { dg-final { scan-assembler "\\.internal.*Foo.methodEv" } } */
#pragma GCC visibility push(hidden)
class __attribute__ ((visibility ("internal"))) Foo
{
void method();
};
#pragma GCC visibility pop
void Foo::method() { }
|
google
|
chromium
|
noPLT
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/noPLT.C
| 377 |
utf_8
|
f281064d572b9d936c2688733534f68b
|
/* Test that -fvisibility=hidden prevents PLT. */
/* { dg-do compile { target fpic } } */
/* { dg-require-visibility "" } */
class Foo
{
public:
void method();
};
void Foo::method() { }
int main(void)
{
Foo f;
f.method();
return 0;
}
|
google
|
chromium
|
fvisibility-inlines-hidden-2
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/fvisibility-inlines-hidden-2.C
| 369 |
utf_8
|
9f6874b06aea35e844ab40f0f69550c5
|
/* Test that -fvisibility-inlines-hidden doesn't affect static variables. */
/* { dg-do compile } */
/* { dg-require-visibility "" } */
/* { dg-options "-fvisibility-inlines-hidden" } */
/* { dg-final { scan-not-hidden "_ZZN3foo7my_funcEvE1x" } } */
struct foo
{
int my_func() {
static int x;
return x++;
}
};
int t()
{
foo f;
return f.my_func();
}
|
google
|
chromium
|
symbian1
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/symbian1.C
| 523 |
utf_8
|
871b12330fdac390784bb00c45740be6
|
// { dg-do compile { target arm*-*-symbianelf* } }
// Class data should not be exported.
// { dg-final { scan-hidden "_ZTV2K3" } }
// But the constructor and destructor should be exported.
// { dg-final { scan-not-hidden "_ZN2K3C2Ev" } }
// { dg-final { scan-not-hidden "_ZN2K3D0Ev" } }
class __declspec(notshared) K3 {
public:
__declspec(dllimport) K3();
__declspec(dllimport) virtual ~K3();
virtual int m1();
};
__declspec(dllexport)
K3::K3(){}
__declspec(dllexport)
K3::~K3(){}
int K3::m1() { return 1; }
|
google
|
chromium
|
visibility-5
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/visibility-5.C
| 255 |
utf_8
|
29732097fb76e25fb0f4f81cb768aa61
|
/* Test visibility attribute on definition of a function that has
already had a forward declaration. */
/* { dg-require-visibility "" }
/* { dg-final { scan-hidden "_Z3foov" } } */
void foo();
void
__attribute__((visibility ("hidden")))
foo()
{ }
|
google
|
chromium
|
fvisibility-inlines-hidden
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/fvisibility-inlines-hidden.C
| 330 |
utf_8
|
18d8a1310b12aec50bcac70a4583e44d
|
/* Test that -fvisibility-inlines-hidden affects class members. */
/* { dg-do compile } */
/* { dg-require-visibility "" } */
/* { dg-options "-fvisibility-inlines-hidden" } */
/* { dg-final { scan-hidden "_ZN3Foo6methodEv" } } */
class Foo
{
public:
void method() { }
};
int main(void)
{
Foo f;
f.method();
return 0;
}
|
google
|
chromium
|
overload-1
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/overload-1.C
| 263 |
utf_8
|
088ee3648d1129db2680023bfe6d21ea
|
/* Test that visibility of function parameters propagates to an undecorated
function. */
/* { dg-require-visibility "" }
/* { dg-final { scan-hidden "_Z3fooP8a_struct" } } */
struct __attribute__((visibility("hidden"))) a_struct;
void foo(a_struct * p)
{ }
|
google
|
chromium
|
fvisibility-inlines-hidden-3
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/fvisibility-inlines-hidden-3.C
| 576 |
utf_8
|
5c8d17e33f840c89b8d56a22d680b9d1
|
/* { dg-do compile } */
/* { dg-require-visibility "" } */
/* { dg-options "-fvisibility-inlines-hidden" } */
/* { dg-final { scan-not-hidden "_ZN1IIiE3fooEv" } } */
/* { dg-final { scan-not-hidden "_ZN1OIiE3fooEv" } } */
/* { dg-final { scan-hidden "_ZN1S3fooEv" } } */
template <class T>
struct O {
static inline void foo() { }
};
template void O<int>::foo();
template <class T>
struct I {
static inline void foo() { }
};
extern template void I<int>::foo();
struct S {
static inline void foo() { }
};
void bar() {
I<int>::foo();
O<int>::foo();
S::foo();
}
|
google
|
chromium
|
anon6
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/anon6.C
| 540 |
utf_8
|
2b43cd0224b885985e8b61dcb08b9f0c
|
// PR c++/33094
// { dg-final { scan-assembler "1BIiE1cE" } }
// { dg-final { scan-assembler-not "globl.*1BIiE1cE" } }
// { dg-final { scan-assembler-not "1CIiE1cE" } }
// Test that B<int>::c is emitted as an internal symbol, and C<int>::c is
// not emitted.
namespace
{
template <typename T>
class A
{
virtual T f1() { return c; }
static const T c = 0;
};
template <typename T>
class B
{
static const T c = 0;
};
template <typename T> const T B<T>::c;
template class A<int>;
template class B<int>;
}
|
google
|
chromium
|
template2
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/template2.C
| 540 |
utf_8
|
7e94246b97c378892a5f1475a28f3a44
|
// PR c++/27000
// Implicitly instantiated templates should not be affected by
// #pragma visibility.
/* { dg-do compile } */
/* { dg-require-visibility "" } */
/* { dg-final { scan-not-hidden "_ZN1SIiED1Ev" } } */
/* { dg-final { scan-not-hidden "_ZN1SIiEC1ERKi" } } */
template <class T>
struct S
{
S (const T &);
~S ();
T t;
};
template <class T>
S<T>::S (const T &x)
{
t = x;
}
template <class T>
S<T>::~S ()
{
}
#pragma GCC visibility push(hidden)
struct U
{
S<int> s;
U () : s (6) { }
} u;
#pragma GCC visibility pop
|
google
|
chromium
|
staticdatamem
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/staticdatamem.C
| 396 |
utf_8
|
6014ef7f9e80dffce855a18d78bf2212
|
// PR c++/18925
// { dg-do compile { target ia64-*-linux* } }
// { dg-options "-fPIC -fvisibility=hidden" }
// { dg-final { scan-assembler-not "gprel" } }
class __attribute__ ((visibility("default"))) Type
{
private:
static long _staticTypeCount;
public:
Type() { _staticTypeCount++; }
~Type();
};
long Type::_staticTypeCount = 0;
Type::~Type()
{
_staticTypeCount--;
}
|
google
|
chromium
|
fvisibility
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/fvisibility.C
| 265 |
utf_8
|
3a72a00418a387a4b941484f8782c6dd
|
/* Test that -fvisibility affects class members. */
/* { dg-do compile } */
/* { dg-require-visibility "" } */
/* { dg-options "-fvisibility=hidden" } */
/* { dg-final { scan-hidden "_ZN3Foo6methodEv" } } */
class Foo
{
void method();
};
void Foo::method() { }
|
google
|
chromium
|
anon3
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/anon3.C
| 250 |
utf_8
|
251258dca8835128a261b3557e780874
|
// PR c++/31187
// Bug: the repeated declaration was confusing the compiler into
// thinking that foo1 had language internal linkage.
class foo { };
namespace
{
extern foo foo1;
foo foo1;
}
template< foo * >
class bar { };
bar< &foo1 > bar1;
|
google
|
chromium
|
anon2
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/anon2.C
| 183 |
utf_8
|
f4d13decfaa5840017b392ae099bdac9
|
// Test for propagation of anonymous namespace internal linkage
// { dg-do compile }
// { dg-final { scan-assembler-not "globl.*_Z1fv" } }
namespace
{
struct A { };
}
A f () { }
|
google
|
chromium
|
anon1
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/anon1.C
| 174 |
utf_8
|
a7cd8c7f7fec871a0af30c9bd8122ba5
|
// PR c++/21581
// Test for anonymous namespace internal linkage
// { dg-do compile }
// { dg-final { scan-assembler-not "globl.*_ZN.*1fEv" } }
namespace
{
int f() { }
}
|
google
|
chromium
|
visibility-9
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/visibility-9.C
| 539 |
utf_8
|
52a68707f7a31ec98e42c99f237d00db
|
// Test that dllimport'd functions have default visibility.
// { dg-require-visibility "" }
// { dg-require-dll "" }
// { dg-options "-fvisibility=hidden" }
// { dg-final { scan-not-hidden "_Z2f1v" } }
// { dg-final { scan-not-hidden "_ZN1S2f3Ev" } }
extern void __attribute__((dllimport)) f1();
void f2() {
f1();
}
struct __attribute__((visibility("hidden")) S1 {
__attribute__((dllimport)) void f3();
};
void f4() {
S1 s1;
s1.f3();
}
struct S2 {
__attribute__((dllimport)) void f5();
};
void f6() {
S2 s2;
s2.f5();
}
|
google
|
chromium
|
pragma-override2
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/pragma-override2.C
| 384 |
utf_8
|
e4bb4a5f15deb500cb7920bd0a441fd2
|
/* Test that #pragma GCC visibility does not override class member specific settings. */
/* { dg-do compile } */
/* { dg-require-visibility "internal" } */
/* { dg-final { scan-assembler "\\.internal.*Foo.methodEv" } } */
#pragma GCC visibility push(hidden)
class Foo
{
__attribute__ ((visibility ("internal"))) void method();
};
#pragma GCC visibility pop
void Foo::method() { }
|
google
|
chromium
|
warn2
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/warn2.C
| 332 |
utf_8
|
6b99f789e2db87165df711f0051569d4
|
// Complain when a class is specified with greater visibility than one of
// its members' types or bases.
// { dg-require-visibility "" }
namespace N __attribute ((__visibility__ ("hidden")))
{
struct A { };
}
struct B
{ // { dg-warning "visibility" }
N::A a;
};
struct C: public N::A { }; // { dg-warning "visibility" }
|
google
|
chromium
|
template1
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/template1.C
| 1,137 |
utf_8
|
bdf427338b64f10a5d155e082663891c
|
// PR c++/19134
// -fvisibility-inlines-hidden doesn't apply to non-inline specializations
// { dg-require-visibility "" }
// { dg-options "-fvisibility-inlines-hidden" }
// { dg-final { scan-not-hidden "_ZN1AIiE3fooEv" } }
// { dg-final { scan-not-hidden "_ZN1AIiE3barEv" } }
// { dg-final { scan-hidden "_ZN1AIlE3fooEv" } }
// { dg-final { scan-hidden "_ZN1AIlE3barEv" } }
// { dg-final { scan-hidden "_ZN1AIcE3barEv" } }
template<class T>
struct A {
void foo() {};
__attribute ((visibility ("hidden"))) void bar();
};
// This has default visibility.
template<> void A<int>::foo() {}
// This has hidden visibility because of -fvisibility-inlines-hidden.
template<> inline void A<long>::foo() {}
// Force the inline out.
void f () { A<long> a; a.foo(); }
// This has default visibility.
template<> __attribute ((visibility ("default"))) void A<int>::bar() {}
// This inherits hidden visibility from its template.
template<> void A<long>::bar() { }
// This also has hidden visibility; #pragma vis doesn't affect class members.
#pragma GCC visibility push(default)
template<> void A<char>::bar() { }
#pragma GCC visibility pop
|
google
|
chromium
|
namespace1
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/namespace1.C
| 583 |
utf_8
|
47546be923a94711f1c67844ab30b6b5
|
// PR c++/21764
// Test for namespace visibility attribute semantics.
// { dg-require-visibility "" }
// { dg-final { scan-hidden "_ZN3foo1fEv" } }
// { dg-final { scan-hidden "_ZN3foo1gEv" } }
// { dg-final { scan-hidden "_ZN3foo1A1mEv" } }
// { dg-final { scan-hidden "_ZN3foo1tIiEEvv" } }
// { dg-final { scan-not-hidden "_ZN3foo1hEv" } }
namespace foo __attribute ((visibility ("hidden")))
{
int f() { }
void g();
template <typename T> void t() { }
class A
{
void m ();
};
}
namespace foo
{
void h() {}
}
void foo::g() { t<int> (); }
void foo::A::m() { }
|
google
|
chromium
|
memfuncts
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/memfuncts.C
| 279 |
utf_8
|
d7e8086561549b3830b812ca5fcd9dd6
|
/* Test that setting visibility for class member functions works. */
/* { dg-do compile } */
/* { dg-require-visibility "" } */
/* { dg-final { scan-hidden "_ZN3Foo6methodEv" } } */
class __attribute__ ((visibility ("hidden"))) Foo
{
void method();
};
void Foo::method() { }
|
google
|
chromium
|
prop1
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/prop1.C
| 423 |
utf_8
|
14ca1521630ef80a83c404dfb225885d
|
// Test for propagation of visibility through template arguments
// { dg-do compile }
// { dg-require-visibility "" }
// { dg-final { scan-hidden "_Z1fIN1N1AEEvT_" } }
// { dg-final { scan-hidden "_Z1hIXadL_ZN1N1iEEEEvv" } }
namespace N __attribute ((__visibility__ ("hidden")))
{
struct A { };
int i;
}
template <class T> void f (T) { }
template <int *I> void h() { }
void g()
{
N::A a;
f(a);
h<&N::i>();
}
|
google
|
chromium
|
new1
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/new1.C
| 206 |
utf_8
|
9a8d2d6de4dd65f8d370f81892ab674c
|
// { dg-require-visibility "" }
// { dg-options "-fvisibility=hidden" }
// { dg-final { scan-not-hidden "_Znwj" } }
void f() {
new int;
}
void *g();
void *operator new(__SIZE_TYPE__) {
return g();
}
|
google
|
chromium
|
visibility-6
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/visibility-6.C
| 262 |
utf_8
|
f810d8d490c2163100b8092bb733b17d
|
/* Test visibility attribute on definition of global variable that has
already had a forward declaration. */
/* { dg-require-visibility "" }
/* { dg-final { scan-hidden "xyzzy" } } */
extern int xyzzy;
int
__attribute__((visibility ("hidden")))
xyzzy = 5;
|
google
|
chromium
|
assign1
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/assign1.C
| 384 |
utf_8
|
8f362e9514ed23f575b695f7bbed54e6
|
/* { dg-do compile } */
/* { dg-require-visibility "" } */
/* { dg-final { scan-hidden "_ZN1DaSERKS_" } } */
struct B {
B& operator=(const B&);
};
struct __attribute__((visibility("hidden"))) D : public B {
// The implicit assignment operator should be hidden.
};
__attribute__((visibility("hidden"))) D d1;
__attribute__((visibility("hidden"))) D d2;
void f() {
d1 = d2;
}
|
google
|
chromium
|
redecl1
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/redecl1.C
| 352 |
utf_8
|
6fabf6d57deb8f7c060e33c41787a854
|
// Test that we complain about redeclaration with different visibility
struct __attribute((visibility("hidden"))) B;
struct __attribute((visibility("default"))) B; // { dg-error "visibility" }
__attribute ((visibility ("hidden"))) void f(); // { dg-warning "previous" }
__attribute ((visibility ("default"))) void f(); // { dg-warning "visibility" }
|
google
|
chromium
|
visibility-1
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/visibility-1.C
| 188 |
utf_8
|
b78959b2914362cd23e2ae31204c2305
|
/* Test visibility attribute on function definition. */
/* { dg-require-visibility "" }
/* { dg-final { scan-hidden "_Z3foov" } } */
void
__attribute__((visibility ("hidden")))
foo()
{ }
|
google
|
chromium
|
arm2
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/arm2.C
| 285 |
utf_8
|
06b4df0aabdec7190ff116eb91fec899
|
// { dg-do compile { target arm*-*-*eabi* arm*-*-symbianelf* } }
// Class data should be exported.
// { dg-final { scan-not-hidden "_ZTV1S" } }
// { dg-final { scan-not-hidden "_ZTI1S" } }
// { dg-final { scan-not-hidden "_ZTS1S" } }
struct S {
virtual void f();
};
void S::f() {}
|
google
|
chromium
|
fvisibility-override2
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/fvisibility-override2.C
| 342 |
utf_8
|
da4518aa692947ef4c1cc1de9617e5d0
|
/* Test that -fvisibility does not override class member specific settings. */
/* { dg-do compile } */
/* { dg-require-visibility "internal" } */
/* { dg-options "-fvisibility=hidden" } */
/* { dg-final { scan-not-hidden "Foo.methodEv" } } */
class Foo
{
__attribute__ ((visibility ("internal"))) void method();
};
void Foo::method() { }
|
google
|
chromium
|
arm1
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/arm1.C
| 749 |
utf_8
|
f0845a29f305c3f9de0874e37218ab32
|
// { dg-do compile { target arm*-*-eabi* arm*-*-symbianelf* } }
// { dg-require-dll "" }
// { dg-options "-fvisibility=hidden" }
// Most class data should be exported.
// { dg-final { scan-not-hidden "_ZTV1S" } }
// { dg-final { scan-not-hidden "_ZTI1S" } }
// { dg-final { scan-not-hidden "_ZTS1S" } }
// { dg-final { scan-not-hidden "_ZTV1U" } }
// { dg-final { scan-not-hidden "_ZTT1U" } }
// { dg-final { scan-not-hidden "_ZTI1U" } }
// { dg-final { scan-not-hidden "_ZTS1U" } }
// The construction vtable should be hidden.
// { dg-final { scan-hidden "_ZTC1U0_1T" } }
struct S {
virtual void f();
};
void S::f() {
}
struct T : public virtual S {
virtual void g();
};
struct U : public virtual T {
virtual void h();
};
void U::h() {}
|
google
|
chromium
|
staticmemfuncts
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/staticmemfuncts.C
| 293 |
utf_8
|
f557224265cdd5e5b63d2ff669e9cabe
|
/* Test that setting visibility for static class member functions works. */
/* { dg-do compile } */
/* { dg-require-visibility "" } */
/* { dg-final { scan-hidden "_ZN3Foo6methodEv" } } */
class __attribute__ ((visibility ("hidden"))) Foo
{
static void method();
};
void Foo::method() { }
|
google
|
chromium
|
namespace2
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/namespace2.C
| 390 |
utf_8
|
eb42889d7ff5930cf589d7b103805b82
|
// PR c++/32470
// { dg-require-visibility "" }
// { dg-options "-fvisibility=hidden" }
// { dg-final { scan-hidden "_ZN4Test4testEv" } }
namespace std __attribute__((__visibility__("default"))) {
template<typename _CharT>
class basic_streambuf
{
friend void getline();
};
extern template class basic_streambuf<char>;
}
class Test
{
void test();
};
void Test::test() { }
|
google
|
chromium
|
local1
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/local1.C
| 458 |
utf_8
|
f6ac3f034af2478f3ae3854a6b304cdb
|
// PR c++/19238
// Test that hidden visibility on an inline function is inherited by static
// local variables and local classes.
// { dg-require-visibility "" }
// { dg-final { scan-hidden "_Z1fv" } }
// { dg-final { scan-hidden "_ZZ1fvE1i" } }
// { dg-final { scan-hidden "_ZZ1fvEN1A1fEv" } }
__attribute ((visibility ("hidden"))) inline int
f()
{
static int i = 2;
struct A
{
void f () { }
} a;
a.f();
return i;
}
int main()
{
f();
}
|
google
|
chromium
|
virtual
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/virtual.C
| 481 |
utf_8
|
73717f63993d617e09ce4b4ee1dc7dcc
|
/* Test that setting visibility for class affects virtual table, VTT and
type_info name and node. */
/* { dg-do compile } */
/* { dg-require-visibility "" } */
/* { dg-final { scan-hidden "ZTV3Foo" } } */
/* { dg-final { scan-hidden "ZTT3Foo" } } */
/* { dg-final { scan-hidden "ZTS3Foo" } } */
/* { dg-final { scan-hidden "ZTI3Foo" } } */
struct A { };
class __attribute__ ((visibility ("hidden"))) Foo: virtual public A
{
virtual void method();
};
void Foo::method() { }
|
google
|
chromium
|
ms-compat-1
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/ms-compat-1.C
| 552 |
utf_8
|
7fbb869ca12df2407fdf22d0ba22baac
|
/* { dg-require-visibility "" } */
/* { dg-options "-fvisibility-ms-compat" } */
/* { dg-final { scan-not-hidden "_ZTI1S" } } */
/* { dg-final { scan-hidden "_ZTI1T" } } */
/* { dg-final { scan-not-hidden "_ZTI1U" } } */
/* { dg-final { scan-not-hidden "_ZN1U6hide_4Ev" } } */
class S {
virtual void hide_2();
} hide_1;
void S::hide_2() {
}
class __attribute__((visibility("hidden"))) T {
virtual void hide_4();
} hide_3;
void T::hide_4() {
}
class __attribute__((visibility("default"))) U {
virtual void hide_4();
};
void U::hide_4() {
}
|
google
|
chromium
|
typeinfo1
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/typeinfo1.C
| 606 |
utf_8
|
90b35e4187c59e0ec19eadda1bd4254b
|
// PR c++/26984
// lazily generated typeinfos should not be affected by #pragma vis, but
// they should be affected by the visibility of the type they describe.
// { dg-require-visibility "" }
// { dg-options "-fvisibility-inlines-hidden" }
// { dg-final { scan-not-hidden "_ZTIPPi" } }
// { dg-final { scan-not-hidden "_ZTSPPi" } }
// { dg-final { scan-hidden "_ZTIP1A" } }
// { dg-final { scan-hidden "_ZTSP1A" } }
#include <typeinfo>
#pragma GCC visibility push(hidden)
const std::type_info* t = &(typeid(int **));
struct A { };
#pragma GCC visibility pop
const std::type_info* t2 = &(typeid(A *));
|
google
|
chromium
|
anon7
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/anon7.C
| 404 |
utf_8
|
ad8b5022bf6c7f64ed5401d01e61af62
|
// PR c++/34094
// { dg-do compile }
namespace
{
struct A {
static int bar ();
static int i; // { dg-error "used, but not defined" "" { xfail *-*-* } }
static int j;
static int k;
static int l;
static const int m = 16;
static const int n = 17;
};
int A::j = 4;
int A::k;
const int A::m;
}
int foo (void)
{
return A::i + A::j + A::k + A::m + A::n + A::bar ();
}
|
google
|
chromium
|
visibility-2
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/visibility-2.C
| 220 |
utf_8
|
e84981f02dd8957761952e315dab0d86
|
/* Test that visibility attribute on declaration extends to definition. */
/* { dg-require-visibility "" }
/* { dg-final { scan-hidden "_Z3foov" } } */
void __attribute__((visibility ("hidden"))) foo();
void foo() { }
|
google
|
chromium
|
anon4
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/visibility/anon4.C
| 283 |
utf_8
|
a9ac9686caa2bc8878f0912bbd23359a
|
// PR c++/31903
// Test for anonymous namespace internal linkage, for typeinfo
// { dg-do compile }
// { dg-final { scan-assembler-not "globl.*_ZTIN*3fooE" } }
#include <typeinfo>
namespace
{
class foo
{
virtual void bar();
};
}
const std::type_info &X = typeid(foo);
|
google
|
chromium
|
debug1
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/debug/debug1.C
| 766 |
utf_8
|
2b6f3bdb657c8865549db08f96a15223
|
// Test whether dwarf2 debug info works with named return value optimization
// { dg-do compile }
struct S
{
virtual ~S();
S (const char *str);
S& operator= (const char *str);
operator const char *() const;
S& operator+= (const char *str);
};
inline S operator+ (const char *s1, const S &s2)
{
S x (s1);
x += s2;
return x;
}
struct U
{
U ();
U& operator= (const char *);
const char *foo() const;
operator const char *() const { return foo(); }
};
template <class T> struct V
{
T v;
};
template <class T> struct W
{
V<T> *w;
W() : w (0) {}
const T& operator* () const { return w->v; }
T& operator* () { return w->v; }
};
struct X {
X();
};
struct Y {
Y (const U &u);
};
X::X()
{
W<U> a;
U b;
b = (*a) + "xx";
Y c (b);
}
|
google
|
chromium
|
pr29906
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/debug/pr29906.C
| 156 |
utf_8
|
fa240b5916a88de396432f0b952489b3
|
// { dg-do compile }
// { dg-options "-g -fno-emit-class-debug-always" }
struct A{
typedef int T;
virtual ~A();
};
struct B:public A{
using A::T;
};
|
google
|
chromium
|
debug3
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/debug/debug3.C
| 878 |
utf_8
|
b5c1d1e26252e6e306ee37c885cc449b
|
// PR optimization/5547
// This testcase caused ICE on IA-32, since DWARF-2 was unable
// to emit location expression for parameter a of operator+.
// { dg-do compile { target fpic } }
// { dg-options "-fpic" }
struct A { char *s; };
inline A operator+ (char a, const A &b)
{
A s;
s.s = new char[12];
s.s[0] = a;
return s;
}
int b (const A &);
void test1 (const A &x, int y)
{
int j = b ("012345"[y] + x);
for (int i = 0; i < y; i++);
}
void test2 (const A &x, int y)
{
int j = b ("012345678"[y + 2] + x);
for (int i = 0; i < y; i++);
}
void test3 (const A &x, int y)
{
int j = b ("012345678"[y - 6] + x);
for (int i = 0; i < y; i++);
}
void test4 (const A &x, int y)
{
int j = b ("012345678"[2 * y - 10] + x);
for (int i = 0; i < y; i++);
}
void test5 (const A &x, int y)
{
int j = b ("012345678"[4 * y] + x);
for (int i = 0; i < y; i++);
}
|
google
|
chromium
|
anonunion1
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/debug/anonunion1.C
| 175 |
utf_8
|
e71a3440857a0df24410cbe91e45c678
|
// PR debug/9039
// Verify that the debugging backends don't get confused by ALIAS_DECLs.
int foo()
{
union
{
int z;
unsigned int w;
};
w = 0;
return 0;
}
|
google
|
chromium
|
enum-2
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/debug/enum-2.C
| 260 |
utf_8
|
7ca1d4c7ad1e18f7eebfa4742477778c
|
/* Verify that used enums are output. */
/* { dg-do compile } */
/* { dg-final { scan-assembler "JTI_MAX" } } */
int var;
enum java_tree_index
{
JTI_MAX
};
template<int X>
void tmpl (void)
{
var = JTI_MAX + X;
}
void
function (void)
{
tmpl<2>();
}
|
google
|
chromium
|
enum-1
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/debug/enum-1.C
| 206 |
utf_8
|
479930fb5faf8196de02f2765efd234d
|
/* Verify that used enums are output. */
/* { dg-do compile } */
/* { dg-final { scan-assembler "JTI_MAX" } } */
int var;
enum java_tree_index
{
JTI_MAX
};
void function (void)
{
var = JTI_MAX;
}
|
google
|
chromium
|
static1
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/debug/static1.C
| 237 |
utf_8
|
c3f392076ad11f8768ef0321b89abd5f
|
// PR c++/24569
template <int dim>
struct S
{
static const int u = 2 * dim;
static const int p[u];
static int f();
};
template <>
inline int S<3>::f () { return 1; }
template <int dim> const int S<dim>::u;
template class S<3>;
|
google
|
chromium
|
const2
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/debug/const2.C
| 377 |
utf_8
|
2e4398a10938bba8e5fd13cd2d12e691
|
// Bug 20505: ICE with -ggdb2
struct b
{
static const int d;
virtual bool IsEmpty() const=0;
int e,c;
};
const int b::d = ((__SIZE_TYPE__)(&((b*)1)->c) - 1);
|
google
|
chromium
|
dwarf2-1
|
.C
|
native_client/nacl-gcc/gcc/testsuite/g++.dg/debug/dwarf2-1.C
| 335 |
utf_8
|
7976c74d25a46d6108c18e4ceb4cef33
|
// { dg-options "-feliminate-dwarf2-dups" }
namespace N
{
struct Base
{
int m;
};
struct Derived : Base
{
using Base::m;
};
}
N::Derived thing;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.