forked from root-project/root
-
Notifications
You must be signed in to change notification settings - Fork 0
/
If.C
23 lines (16 loc) · 905 Bytes
/
If.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//------------------------------------------------------------------------------
// CLING - the C++ LLVM-based InterpreterG :)
//
// This file is dual-licensed: you can choose to license it under the University
// of Illinois Open Source License or the GNU Lesser General Public License. See
// LICENSE.TXT for details.
//------------------------------------------------------------------------------
// RUN: cat %s | %cling --ptrcheck -Xclang -verify
// XFAIL: powerpc64
//This file checks an if statement for null prt dereference.
#include <stdlib.h>
int* p = 0;
if (*p) { exit(1); } // expected-warning {{null passed to a callee that requires a non-null argument}}
if (true) { *p; exit(1); } // expected-warning {{null passed to a callee that requires a non-null argument}}
if (false) {} else { *p; exit(1); } // expected-warning {{null passed to a callee that requires a non-null argument}}
.q