| // RUN: %clang_analyze_cc1 -triple x86_64-unknown-freebsd %s |
| #include "Inputs/system-header-simulator.h" |
| void *malloc(size_t, void *, int); |
| list = malloc(sizeof(*list) * 10, NULL, M_ZERO); |
| for (i = 0; i < 10; i++) { |
| free(list); // no-warning |
| list = malloc(sizeof(*list) * 10, NULL, 0); |
| for (i = 0; i < 10; i++) { |
| t = list[i]; // expected-warning{{undefined}} |
| void test_indeterminate(int flags) { |
| list = malloc(sizeof(*list) * 10, NULL, flags); |
| for (i = 0; i < 10; i++) { |
| t = list[i]; // expected-warning{{undefined}} |