LWG 3035. std::allocator's constructors should be constexpr
[official-gcc.git] / gcc / testsuite / gcc.dg / ipa / propmalloc-2.c
blob95b2fd74a7a2c473c2c18612777ab4b371f6c888
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-ipa-pure-const-details" } */
4 __attribute__((noinline, used, no_icf))
5 static void *foo (__SIZE_TYPE__ n)
7 return __builtin_malloc (n * 10);
10 __attribute__((noinline, used, no_icf))
11 static void *bar(__SIZE_TYPE__ n, int cond)
13 void *p;
14 if (cond)
15 p = foo (n);
16 else
17 p = __builtin_malloc (n);
19 return p;
22 /* { dg-final { scan-ipa-dump "Function foo found to be malloc" "pure-const" } } */
23 /* { dg-final { scan-ipa-dump "Function bar found to be malloc" "pure-const" } } */