[AArch64/arm] PR testsuite/85326 Avoid C++ tests when C++ compiler not present
[official-gcc.git] / gcc / testsuite / g++.dg / init / new24.C
blob6f5613be7f6a26c21f0f939cf82b4968f8eceaf4
1 // PR c++/33025
2 // { dg-do compile }
3 // { dg-options "-O2" }
5 typedef __SIZE_TYPE__ size_t;
6 inline void *operator new (size_t, void *p) throw () { return p; }
7 extern "C" void abort ();
9 int
10 main()
12   const unsigned num = 10;
13   unsigned *data = new unsigned[num];
14   unsigned *ptr = new (data) unsigned (num);
15   static unsigned data2[10];
16   unsigned *ptr2 = new (&data2[0]) unsigned (10);
17   return 0;