aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2001-05-25 01:30:57 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2001-05-25 01:30:57 +0000
commitf5aada264731ac00bd7afaa254cb0ed1b6b62917 (patch)
tree6ae5ab95d76a66131b71f92d89e3a72cc74ae46a
parent0b1161fcb24c573c53bc27b8b935c73e1d855c8b (diff)
downloadgcc-f5aada264731ac00bd7afaa254cb0ed1b6b62917.zip
gcc-f5aada264731ac00bd7afaa254cb0ed1b6b62917.tar.gz
gcc-f5aada264731ac00bd7afaa254cb0ed1b6b62917.tar.bz2
G++ no longer defines builtins that do not begin with __builtin.
* g++.old-deja/g++.abi/bitfields.C: Update accordingly. * g++.old-deja/g++.brendand/misc13.C: Likewise. * g++.old-deja/g++.law/builtin1.C: Likewise. * g++.old-deja/g++.law/cvt2.C: Likewise. * g++.old-deja/g++.mike/net5.C: Likewise. * g++.old-deja/g++.other/builtins1.C: Likewise. * g++.old-deja/g++.other/builtins2.C: Likewise. * g++.old-deja/g++.other/builtins3.C: Likewise. * g++.old-deja/g++.other/builtins4.C: Likewise. * g++.old-deja/g++.other/inline8.C: Likewise. * g++.old-deja/g++.robertl/eb39.C: Likewise. From-SVN: r42554
-rw-r--r--gcc/testsuite/ChangeLog15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/bitfields.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/vtable2.C1
-rw-r--r--gcc/testsuite/g++.old-deja/g++.brendan/misc13.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/builtin1.C3
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/cvt2.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net5.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/builtins1.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/builtins2.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/builtins3.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/builtins4.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline21.C39
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline8.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb39.C2
14 files changed, 68 insertions, 98 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 8f74ba3..5dc9c2d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,18 @@
+2001-05-24 Mark Mitchell <mark@codesourcery.com>
+
+ G++ no longer defines builtins that do not begin with __builtin.
+ * g++.old-deja/g++.abi/bitfields.C: Update accordingly.
+ * g++.old-deja/g++.brendand/misc13.C: Likewise.
+ * g++.old-deja/g++.law/builtin1.C: Likewise.
+ * g++.old-deja/g++.law/cvt2.C: Likewise.
+ * g++.old-deja/g++.mike/net5.C: Likewise.
+ * g++.old-deja/g++.other/builtins1.C: Likewise.
+ * g++.old-deja/g++.other/builtins2.C: Likewise.
+ * g++.old-deja/g++.other/builtins3.C: Likewise.
+ * g++.old-deja/g++.other/builtins4.C: Likewise.
+ * g++.old-deja/g++.other/inline8.C: Likewise.
+ * g++.old-deja/g++.robertl/eb39.C: Likewise.
+
2001-05-24 Nathan Sidwell <nathan@codesourcery.com>
* g++.old-deja/g++.pt/using1.C: Adjust.
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/bitfields.C b/gcc/testsuite/g++.old-deja/g++.abi/bitfields.C
index 75b6571..57d06b3 100644
--- a/gcc/testsuite/g++.old-deja/g++.abi/bitfields.C
+++ b/gcc/testsuite/g++.old-deja/g++.abi/bitfields.C
@@ -55,7 +55,7 @@ check_bits (char *buf,
#define CHECK_FIELD(AGGREGATE, FIELD, START_BIT, NUM_BITS, RVAL) \
do { \
AGGREGATE a__; \
- memset (& a__, 0, sizeof (a__)); \
+ std::memset (& a__, 0, sizeof (a__)); \
a__.FIELD = -1; \
if (! check_bits ((char *) & a__, sizeof (a__), START_BIT, NUM_BITS)) \
return RVAL; \
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/vtable2.C b/gcc/testsuite/g++.old-deja/g++.abi/vtable2.C
index b719c70..5fe1e14 100644
--- a/gcc/testsuite/g++.old-deja/g++.abi/vtable2.C
+++ b/gcc/testsuite/g++.old-deja/g++.abi/vtable2.C
@@ -1,4 +1,5 @@
// Origin: Mark Mitchell <mark@codesourcery.com>
+// Special g++ Options: -fno-strict-aliasing
#if defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/misc13.C b/gcc/testsuite/g++.old-deja/g++.brendan/misc13.C
deleted file mode 100644
index c2c8bc5..0000000
--- a/gcc/testsuite/g++.old-deja/g++.brendan/misc13.C
+++ /dev/null
@@ -1,11 +0,0 @@
-// Build don't link:
-// GROUPS passed miscellaneous-bugs
-// This should only give warnings from duplicate_decls; it should not get
-// errors from push_overloaded_decl as well.
-
-namespace std {
-extern "C"
-{
- long unsigned int strlen(char*);// ERROR - warning// ERROR - warning.*
-}
-}
diff --git a/gcc/testsuite/g++.old-deja/g++.law/builtin1.C b/gcc/testsuite/g++.old-deja/g++.law/builtin1.C
index 86a91e7..c285c29 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/builtin1.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/builtin1.C
@@ -8,10 +8,9 @@
// the use of __builtin_alloca, and thus ends up being unresolved.
// Special g++ Options:
-extern "C" void* alloca( __SIZE_TYPE__ );
extern "C" int printf (const char *, ...);
void* junk() {
- return std::alloca(10);
+ return __builtin_alloca(10);
}
main() { printf ("PASS\n");}
diff --git a/gcc/testsuite/g++.old-deja/g++.law/cvt2.C b/gcc/testsuite/g++.old-deja/g++.law/cvt2.C
index b7439f5..7db6b2b 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/cvt2.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/cvt2.C
@@ -8,8 +8,8 @@
class cvec {
public:
~cvec(){ delete s; }
- cvec(const char*x) { s = new char[strlen(x)+1]; strcpy(s, x); }
- cvec(const cvec& c) { s = new char[strlen(c.s)+1]; strcpy(s, c.s); }
+ cvec(const char*x) { s = new char[std::strlen(x)+1]; std::strcpy(s, x); }
+ cvec(const cvec& c) { s = new char[std::strlen(c.s)+1]; std::strcpy(s, c.s); }
operator const char*() { return s; }
private:
char *s;
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net5.C b/gcc/testsuite/g++.old-deja/g++.mike/net5.C
deleted file mode 100644
index 665c0ba..0000000
--- a/gcc/testsuite/g++.old-deja/g++.mike/net5.C
+++ /dev/null
@@ -1,10 +0,0 @@
-// Build don't link:
-// Special g++ Options:
-
-namespace std {
-volatile void abort(); // WARNING - mismatch
-}
-
-volatile void oink() {
- std::abort() ;
-} // gets bogus error -
diff --git a/gcc/testsuite/g++.old-deja/g++.other/builtins1.C b/gcc/testsuite/g++.old-deja/g++.other/builtins1.C
index b6cea1e..4a1630b 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/builtins1.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/builtins1.C
@@ -7,27 +7,14 @@
namespace std
{
extern "C" void abort (void);
- extern "C" __SIZE_TYPE__ strlen (const char *);
}
int main ()
{
using namespace std;
- if (strlen ("hello") != 5)
- abort ();
- if (std::strlen ("hello") != 5)
- abort ();
if (::__builtin_strlen ("hello") != 5)
abort ();
return 0;
}
-
-extern "C"
-{
- static __SIZE_TYPE__ ::strlen (const char *)
- {
- std::abort ();
- }
-}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/builtins2.C b/gcc/testsuite/g++.old-deja/g++.other/builtins2.C
index 48e53f1..9c55b76 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/builtins2.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/builtins2.C
@@ -7,8 +7,6 @@
namespace std
{
extern "C" void abort (void);
- extern "C" char *strcpy (char *, const char *);
- extern "C" int memcmp (const void *, const void *, __SIZE_TYPE__);
}
int main ()
@@ -16,25 +14,9 @@ int main ()
using namespace std;
char f[16];
- if (strcpy (f, "hello world") != f
- || memcmp (f, "hello world", sizeof ("hello world")))
- abort ();
-
- if (std::strcpy (f, "bye world") != f
- || memcmp (f, "bye world", sizeof ("bye world")))
- abort ();
-
if (::__builtin_strcpy (f, "hello world") != f
- || memcmp (f, "hello world", sizeof ("hello world")))
+ || __builtin_memcmp (f, "hello world", sizeof ("hello world")))
abort ();
return 0;
}
-
-extern "C"
-{
- static char * ::strcpy (char *, const char *)
- {
- std::abort ();
- }
-}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/builtins3.C b/gcc/testsuite/g++.old-deja/g++.other/builtins3.C
index 4a67b28..e075d3f 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/builtins3.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/builtins3.C
@@ -7,7 +7,6 @@
namespace std
{
extern "C" void abort (void);
- extern "C" void *alloca (__SIZE_TYPE__);
}
int main ()
@@ -15,14 +14,6 @@ int main ()
using namespace std;
void *foo;
- foo = alloca (32);
- if (!foo)
- abort ();
-
- foo = std::alloca (32);
- if (!foo)
- abort ();
-
foo = ::__builtin_alloca (32);
if (!foo)
abort ();
@@ -30,10 +21,3 @@ int main ()
return 0;
}
-extern "C"
-{
- static void * ::alloca (__SIZE_TYPE__)
- {
- std::abort ();
- }
-}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/builtins4.C b/gcc/testsuite/g++.old-deja/g++.other/builtins4.C
index 7118910..235bb13 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/builtins4.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/builtins4.C
@@ -7,21 +7,12 @@
namespace std
{
extern "C" void abort (void);
- extern "C" int printf (const char *, ...);
}
int main ()
{
using namespace std;
- printf ("hello world\n");
- printf ("\n");
- printf ("%s\n", "hello world");
- printf ("%c", '\n');
- std::printf ("hello world\n");
- std::printf ("\n");
- std::printf ("%s\n", "hello world");
- std::printf ("%c", '\n');
::__builtin_printf ("hello world\n");
::__builtin_printf ("\n");
::__builtin_printf ("%s\n", "hello world");
@@ -30,10 +21,3 @@ int main ()
return 0;
}
-extern "C"
-{
- static int ::printf (const char *, ...)
- {
- std::abort ();
- }
-}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline21.C b/gcc/testsuite/g++.old-deja/g++.other/inline21.C
new file mode 100644
index 0000000..1f3dd0e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline21.C
@@ -0,0 +1,39 @@
+// Special g++ Options: -O2
+// Origin: suckfish@ihug.co.nz
+
+// DECLARATIONS
+
+struct Record {
+ Record (int bb) :
+ b (bb)
+ { }
+ int extra; // Having an extra member in record is crucial.
+ int b;
+};
+
+struct Container {
+ Record record;
+ // The const on the next line is crucial.
+ Container ( const Record b) : record(b) {}
+};
+
+
+// TEST FOR CORRECT BEHAVIOUR
+
+int myArray[3];
+int * intp = myArray;
+
+void use_pair (const Container & c)
+{
+ *intp++ = c.record.b;
+}
+
+extern "C" int printf (const char *,...);
+
+int main()
+{
+ use_pair (Container (1234));
+
+ if (myArray[0] != 1234)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline8.C b/gcc/testsuite/g++.old-deja/g++.other/inline8.C
index a5b540b..17965d9 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/inline8.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline8.C
@@ -23,23 +23,23 @@ public:
NAMES_ITEM::NAMES_ITEM (const NAMES_ITEM& item2)
{
- size_t length=strlen(item2.name);
+ size_t length=std::strlen(item2.name);
name=new char[length+1];
- memcpy(name,item2.name,length+1);
+ std::memcpy(name,item2.name,length+1);
}
NAMES_ITEM::NAMES_ITEM (const char* name2)
{
- size_t length=strlen(name2);
+ size_t length=std::strlen(name2);
name=new char[length+1];
- memcpy(name,name2,length+1);
+ std::memcpy(name,name2,length+1);
}
NAMES_ITEM::~NAMES_ITEM ()
{
- if (strcmp (name, "one") != 0)
+ if (std::strcmp (name, "one") != 0)
abort ();
name=0;
@@ -47,12 +47,12 @@ NAMES_ITEM::~NAMES_ITEM ()
bool NAMES_ITEM::operator==(const NAMES_ITEM& n) const
{
- return (strcmp(name,n.name) == 0);
+ return (std::strcmp(name,n.name) == 0);
}
bool operator<(const NAMES_ITEM& n1, const NAMES_ITEM& n2)
{
- return (strcmp(n1.name,n2.name) < 0);
+ return (std::strcmp(n1.name,n2.name) < 0);
}
typedef map<NAMES_ITEM,size_t,less<NAMES_ITEM> > lookup_t;
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb39.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb39.C
index f243fac..98bee9c 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb39.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb39.C
@@ -11,7 +11,7 @@ extern bool foo2 (ostream &out, istream &in);
bool
foo1 (ostream &out, const char *in)
{
- string tmp(in, strlen(in));
+ string tmp(in, std::strlen(in));
stringbuf sb (tmp);
istream fmt (&sb);
return foo2 (out, fmt);