Add testcases.

This commit is contained in:
Vassil Vassilev 2013-07-21 16:10:53 +03:00 committed by sftnight
parent 9ee3398603
commit 5b2655d120
4 changed files with 17 additions and 0 deletions

View File

@ -2,6 +2,7 @@ set(CLING_TEST_DIRECTORIES
"ErrorRecovery"
"Extensions"
"LibraryCall"
"NullDeref"
"Prompt"
"Recursion"
"SourceCall")

7
test/NullDeref/Load.C Normal file
View 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
View 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
View File

@ -0,0 +1,3 @@
load_lib llvm.exp
RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,C,cpp}]]