OSDN Git Service

* g++.old-deja/g++.other/builtins1.C: New test.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.other / builtins3.C
1 // Test whether this builtin minimally works in G++.
2 // Origin: Kaveh Ghazi Jan 16, 2001
3 // Copyright (C) 2001 Free Software Foundation.
4 //
5 // Special g++ Options: -O2
6
7 namespace std 
8 {
9   extern "C" void abort (void);
10   extern "C" void *alloca (__SIZE_TYPE__);
11 }
12
13 int main ()
14 {
15   using namespace std;
16   void *foo;
17   
18   foo = alloca (32);
19   if (!foo)
20     abort ();
21
22   foo = std::alloca (32);
23   if (!foo)
24     abort ();
25
26   foo = ::__builtin_alloca (32);
27   if (!foo)
28     abort ();
29
30   return 0;
31 }
32
33 extern "C"
34 {
35   static void * ::alloca (__SIZE_TYPE__)
36   {
37     std::abort ();
38   }
39 }