Add error recovery and unloading tests.
This commit is contained in:
parent
51d27bf1e5
commit
b41a282ae6
6
test/CodeUnloading/ProtectedClass.h
Normal file
6
test/CodeUnloading/ProtectedClass.h
Normal file
@ -0,0 +1,6 @@
|
||||
#ifndef PROTECTED_TRIVIAL_CLASS
|
||||
#define PROTECTED_TRIVIAL_CLASS
|
||||
class Trivial {
|
||||
|
||||
};
|
||||
#endif // PROTECTED_TRIVIAL_CLASS
|
6
test/CodeUnloading/ProtectedClassHeader.C
Normal file
6
test/CodeUnloading/ProtectedClassHeader.C
Normal file
@ -0,0 +1,6 @@
|
||||
// RUN: cat %s | %cling -I%p
|
||||
.storeState "a"
|
||||
#include "ProtectedClass.h"
|
||||
.U
|
||||
.compareState "a"
|
||||
// CHECK-NOT: Differences
|
5
test/ErrorRecovery/HeaderFileProtector.C
Normal file
5
test/ErrorRecovery/HeaderFileProtector.C
Normal file
@ -0,0 +1,5 @@
|
||||
// RUN: cat %s | %cling -I%p -Xclang -verify 2>&1
|
||||
.storeState "a"
|
||||
#include "HeaderFileProtector.h"
|
||||
.compareState "a"
|
||||
// CHECK-NOT: Differences
|
11
test/ErrorRecovery/HeaderFileProtector.h
Normal file
11
test/ErrorRecovery/HeaderFileProtector.h
Normal file
@ -0,0 +1,11 @@
|
||||
#ifndef HEADER_FILE_PROTECTOR
|
||||
#define HEADER_FILE_PROTECTOR
|
||||
#define NN 5
|
||||
#undef NN
|
||||
#define NN 6
|
||||
#define P 5
|
||||
|
||||
class MyHeaderFileProtectedClass {};
|
||||
#undef P
|
||||
error_here; // expected-error {{C++ requires a type specifier for all declarations}}
|
||||
#endif // HEADER_FILE_PROTECTOR
|
16
test/ErrorRecovery/MacroDef.C
Normal file
16
test/ErrorRecovery/MacroDef.C
Normal file
@ -0,0 +1,16 @@
|
||||
// RUN: cat %s | %cling -I%p -Xclang -verify 2>&1
|
||||
|
||||
.rawInput 1
|
||||
extern "C" int printf(const char* fmt, ...);
|
||||
#define NN 5
|
||||
int printNN() {
|
||||
printf("NN=%d", NN);
|
||||
return 0;
|
||||
}
|
||||
.rawInput 0
|
||||
printNN();
|
||||
.storeState "MacroDef"
|
||||
#include "MacroDef.h"
|
||||
.compareState "MacroDef"
|
||||
// CHECK-NOT: Differences
|
||||
printNN();
|
8
test/ErrorRecovery/MacroDef.h
Normal file
8
test/ErrorRecovery/MacroDef.h
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef HEADER_FILE_PROTECTOR
|
||||
#define HEADER_FILE_PROTECTOR
|
||||
int f() {
|
||||
return NN+1;
|
||||
}
|
||||
int n = f();
|
||||
error_here; // expected-error {{C++ requires a type specifier for all declarations}}
|
||||
#endif // HEADER_FILE_PROTECTOR
|
Loading…
x
Reference in New Issue
Block a user