]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Analysis/inline.c
Update clang to 97654.
[FreeBSD/FreeBSD.git] / test / Analysis / inline.c
1 // RUN: %clang_cc1 -analyze -inline-call -analyzer-store region -analyze-function f2 -verify %s
2
3 int f1() {
4   int y = 1;
5   y++;
6   return y;
7 }
8
9 void f2() {
10   int x = 1;
11   x = f1();
12   if (x == 1) {
13     int *p = 0;
14     *p = 3; // no-warning
15   }
16   if (x == 2) {
17     int *p = 0;
18     *p = 3; // expected-warning{{Dereference of null pointer loaded from variable}}
19   }
20 }