Add testcases.
This commit is contained in:
parent
9ee3398603
commit
5b2655d120
@ -2,6 +2,7 @@ set(CLING_TEST_DIRECTORIES
|
||||
"ErrorRecovery"
|
||||
"Extensions"
|
||||
"LibraryCall"
|
||||
"NullDeref"
|
||||
"Prompt"
|
||||
"Recursion"
|
||||
"SourceCall")
|
||||
|
7
test/NullDeref/Load.C
Normal file
7
test/NullDeref/Load.C
Normal file
@ -0,0 +1,7 @@
|
||||
// RUN: cat %s | %cling | FileCheck %s
|
||||
|
||||
//This file checks a pointer load operation for null prt dereference.
|
||||
int *p;
|
||||
int x;
|
||||
x = *p; // CHECK: Warning: you are about to dereference null ptr, which probably will lead to seg violation. Do you want to proceed?[y/n]
|
||||
n
|
6
test/NullDeref/Store.C
Normal file
6
test/NullDeref/Store.C
Normal file
@ -0,0 +1,6 @@
|
||||
// RUN: cat %s | %cling | FileCheck %s
|
||||
|
||||
//This file checks a pointer store operation for null prt dereference.
|
||||
int *p;
|
||||
*p = 6; // CHECK: Warning: you are about to dereference null ptr, which probably will lead to seg violation. Do you want to proceed?[y/n]
|
||||
n
|
3
test/NullDeref/dg.exp
Normal file
3
test/NullDeref/dg.exp
Normal file
@ -0,0 +1,3 @@
|
||||
load_lib llvm.exp
|
||||
|
||||
RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,C,cpp}]]
|
Loading…
x
Reference in New Issue
Block a user