Fix broken by constrution test.

This commit is contained in:
Vassil Vassilev 2014-05-22 15:16:49 +02:00 committed by sftnight
parent 73752eff5e
commit 6d8b154f7f
2 changed files with 8 additions and 16 deletions

View File

@ -8,6 +8,7 @@
extern "C" int printf(const char* fmt, ...);
class MyClass {
struct MyClass {
MyClass() { printf("MyClass ctor called!\n"); }
~MyClass() { printf("MyClass dtor called!\n"); }
};

View File

@ -6,27 +6,18 @@
// LICENSE.TXT for details.
//------------------------------------------------------------------------------
// RUN: cat %s | %cling -Xclang -verify 2>&1 | FileCheck %s
// XFAIL: *
// RUN: cat %s | %cling -I%p -Xclang -verify 2>&1 | FileCheck %s
// The main issue is that expected - error is not propagated to the source file and
// the expected diagnostics get misplaced.
.storeState "testMetaProcessor"
.x CannotDotX.h() // expected-error@2 {{use of undeclared identifier 'CannotDotX'}}
// CHECK: Error in cling::MetaProcessor: execute file failed.
.x CannotDotX.h()
// CHECK: Error in cling::MetaProcessor: execute file failed.
// expected-error@3 3 {{redefinition of 'MyClass'}}
// expected-error@4 3 {{expected member name or ';' after declaration specifiers}}
// expected-note@3 3 {{previous definition is here}}
// expected-error@2 {{use of undeclared identifier 'CannotDotX'}}
// Here we cannot revert MyClass from CannotDotX.h
.L CannotDotX.h
// CHECK: Error in cling::MetaProcessor: load file failed.
MyClass m;
// CHECK: MyClass ctor called
.L CannotDotX.h
// CHECK: Error in cling::MetaProcessor: load file failed.
.compareState "testMetaProcessor"
// CHECK-NOT: File with AST differencies stored in: testMetaProcessorAST.diff
// CHECK: MyClass dtor called
.q