gcc/testsuite/gcc.dg/tree-ssa/pr83648.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O2 -fdump-tree-local-pure-const-details -fdelete-null-pointer-checks" } */ |
| 3 | /* { dg-skip-if "" keeps_null_pointer_checks } */ |
| 4 | |
| 5 | void *g(unsigned n) |
| 6 | { |
| 7 | return n ? __builtin_malloc (n) : 0; |
| 8 | } |
| 9 | |
| 10 | void *h() |
| 11 | { |
| 12 | return 0; |
| 13 | } |
| 14 | |
| 15 | /* { dg-final { scan-tree-dump "Function found to be malloc: g" "local-pure-const1" } } */ |
| 16 | /* { dg-final { scan-tree-dump-not "Function found to be malloc: h" "local-pure-const1" } } */ |