[RISC-V] Avoid unnecessary extensions when value is already extended
[official-gcc.git] / gcc / testsuite / c-c++-common / analyzer / malloc-in-loop.c
blobe7179f09a1d1d7e385e4dcd97721018ef3a04100
1 /* { dg-skip-if "requires hosted libstdc++ for stdlib malloc" { ! hostedlib } } */
3 #include <stdlib.h>
4 #include "../../gcc.dg/analyzer/analyzer-decls.h"
6 extern void foo (int *);
8 void test (int n)
10 __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
12 for (int i = 0; i < n; i++)
14 int *ptr = (int *)malloc (sizeof (int) * i);
15 foo (ptr);
16 free (ptr);
17 __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
20 __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */