]> gcc.gnu.org Git - gcc.git/blob - gcc/testsuite/gcc.dg/ipa/propmalloc-1.c
Skip -fdelete-null-pointer-check tests if target keeps_null_pointer_checks
[gcc.git] / gcc / testsuite / gcc.dg / ipa / propmalloc-1.c
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-ipa-pure-const-details -fdelete-null-pointer-checks" } */
3 /* { dg-skip-if "" keeps_null_pointer_checks } */
4
5 __attribute__((noinline, no_icf, used))
6 static void *f(__SIZE_TYPE__ n)
7 {
8 void *p = __builtin_malloc (n);
9 if (p == 0)
10 __builtin_abort ();
11 return p;
12 }
13
14 __attribute__((noinline, no_icf, used))
15 static void *bar(__SIZE_TYPE__ n)
16 {
17 void *p = f (n);
18 return p;
19 }
20
21 /* { dg-final { scan-ipa-dump "Function f/\[0-9+\]+ found to be malloc" "pure-const" } } */
22 /* { dg-final { scan-ipa-dump "Function bar/\[0-9+\]+ found to be malloc" "pure-const" } } */
This page took 0.037786 seconds and 5 git commands to generate.