Revert "Roll NDK to r11c and extract it into its own repository."
[android_tools.git] / ndk / tests / device / test-stlport_shared-exception / jni / new3.cpp
blobd950259e72a5e8fdb4b67e5b6a0c22dbf75cbc3b
1 // { dg-do run }
2 // { dg-options "-fcheck-new -pedantic -Wno-long-long" }
3 // PRMS Id: 6037
5 extern "C" void * malloc (__SIZE_TYPE__);
7 int ena = 0;
9 struct A {
10 int i;
11 A () { i = 2; }
12 void * operator new (__SIZE_TYPE__ s)
14 if (ena)
15 return 0;
16 return malloc (s);
20 struct B {
21 int i;
22 B () { i = 2; }
23 void * operator new (__SIZE_TYPE__ s) throw()
25 if (ena)
26 return 0;
27 return malloc (s);
31 int main ()
33 ena = 1;
34 A *ap = new A;
35 B *bp = new B;
37 return ap || bp ;