diff --git a/test/ErrorRecovery/ABI.C b/test/ErrorRecovery/ABI.C index 1e18bd85..2cf75620 100644 --- a/test/ErrorRecovery/ABI.C +++ b/test/ErrorRecovery/ABI.C @@ -6,7 +6,7 @@ // LICENSE.TXT for details. //------------------------------------------------------------------------------ -// RUN: cat %s | %cling -nostdinc++ -nobuiltininc -Xclang -verify 2>&1 | FileCheck %s +// RUN: cat %s | %cling %nostdincxx -nobuiltininc -Xclang -verify 2>&1 | FileCheck %s // expected-error {{'new' file not found}} diff --git a/test/ErrorRecovery/SubsequentDecls.C b/test/ErrorRecovery/SubsequentDecls.C index 78546fdf..15c3bb47 100644 --- a/test/ErrorRecovery/SubsequentDecls.C +++ b/test/ErrorRecovery/SubsequentDecls.C @@ -24,7 +24,10 @@ namespace test { int y = 0; } .compareState "testSubsequentDecls" // CHECK-NOT: Differences -TemplatedF((int)2) // expected-diagnostics{{C++ requires a type specifier for all declarations}} expected-diagnostics{{expected ';' after top level declarator}} +TemplatedF((int)2) +// CHECK: IncrementalExecutor::executeFunction: symbol '{{.*}}' unresolved while linking [cling interface function]! +// CHECK: You are probably missing the definition of int {{.*}}TemplatedF(int) +// CHECK: Maybe you need to load the corresponding shared library? template<> int TemplatedF(int i) { return i + 100; } int OverloadedF(int i) { return i + 100;} @@ -37,7 +40,9 @@ TemplatedF(__my_i) // CHECK: (int) 110 TemplatedF((double)3.14) -// CHECK: IncrementalExecutor::executeFunction: symbol '_Z10TemplatedFIdET_S0_' unresolved while linking +// CHECK: IncrementalExecutor::executeFunction: symbol '{{.*}}' unresolved while linking [cling interface function]! +// CHECK: You are probably missing the definition of double {{.*}}TemplatedF(double) +// CHECK: Maybe you need to load the corresponding shared library? // ROOT-7295 #include diff --git a/test/Extensions/Lookup/ControlFlow.C b/test/Extensions/Lookup/ControlFlow.C index f8105927..4ba5dce8 100644 --- a/test/Extensions/Lookup/ControlFlow.C +++ b/test/Extensions/Lookup/ControlFlow.C @@ -40,6 +40,7 @@ if (h->PrintArray(a, 5)) { // runtime result type bool printf("\n%s\n", "Array Printed Successfully!"); } // CHECK: 12345 +// CHECK: Replaced in then. // CHECK: Array Printed Successfully! int b, c = 1; diff --git a/test/Interfaces/compileFunc.C b/test/Interfaces/compileFunc.C index df0b9348..d10c8b86 100644 --- a/test/Interfaces/compileFunc.C +++ b/test/Interfaces/compileFunc.C @@ -50,7 +50,7 @@ void compileFunc() { const char* myBadFuncCode = "extern \"C\" int myBadFunc(int) { \n" - "return What; //expected-error@2 {{use of undeclared identifier 'What'}} \n" + "return NOFUZZY; //expected-error@2 {{use of undeclared identifier 'NOFUZZY'}} \n" "}"; if (!gCling->compileFunction("myBadFunc", myBadFuncCode)) { diff --git a/test/Interfaces/invocationFlags.C b/test/Interfaces/invocationFlags.C index 5308ed4b..053f1f03 100644 --- a/test/Interfaces/invocationFlags.C +++ b/test/Interfaces/invocationFlags.C @@ -6,7 +6,7 @@ // LICENSE.TXT for details. //------------------------------------------------------------------------------ -// RUN: cat %s | %built_cling -Xclang -verify | FileCheck %s +// RUN: cat %s | %built_cling -Xclang -verify 2>&1 | FileCheck %s // Make sure we are correctly parsing the arguments for CIFactory::createCI #include "cling/Interpreter/InvocationOptions.h" diff --git a/test/Interfaces/paths.C b/test/Interfaces/paths.C index 3eed6d32..bf274646 100644 --- a/test/Interfaces/paths.C +++ b/test/Interfaces/paths.C @@ -6,7 +6,7 @@ // LICENSE.TXT for details. //------------------------------------------------------------------------------ -// RUN: cat %s | %cling -DTEST_PATH=\"%p/\" -Xclang -verify 2>&1 | FileCheck %s +// RUN: cat %s | %cling -DTEST_PATH="\"%/p/\"" -Xclang -verify 2>&1 | FileCheck %s #include "cling/Interpreter/Interpreter.h" diff --git a/test/Pragmas/add_env_path.C b/test/Pragmas/add_env_path.C index 15613866..bd75ee3a 100644 --- a/test/Pragmas/add_env_path.C +++ b/test/Pragmas/add_env_path.C @@ -7,8 +7,24 @@ //------------------------------------------------------------------------------ // RUN: mkdir -p %T/subdir && clang -DCLING_EXPORT=%dllexport -shared %S/call_lib.c -o %T/subdir/libtest%shlibext -// RUN: %setenv ENVVAR_LIB="%T/subdir" && %setenv ENVVAR_INC="%S/subdir" -// RUN: cat %s | %cling -I %S -Xclang -verify 2>&1 | FileCheck %s +// RUN: cat %s | %cling -I %S -DENVVAR_LIB="\"%/T/subdir\"" -DENVVAR_INC="\"%/p/subdir\"" -Xclang -verify 2>&1 | FileCheck %s + +extern "C" int cling_testlibrary_function(); + +// For gcc setenv +#ifndef __THROW + #define __THROW +#endif +extern "C" int setenv(const char *name, const char *value, int overwrite) __THROW; +extern "C" int _putenv_s(const char *name, const char *value); +static void setup() { +#ifdef _WIN32 + #define setenv(n, v, o) _putenv_s(n,v) +#endif + ::setenv("ENVVAR_INC", ENVVAR_INC, 1); + ::setenv("ENVVAR_LIB", ENVVAR_LIB, 1); +} +setup(); #pragma cling add_include_path("$ENVVAR_INC") #include "Include_header.h" @@ -17,6 +33,8 @@ include_test() #pragma cling add_library_path("$ENVVAR_LIB") #pragma cling load("libtest") +cling_testlibrary_function() +// CHECK: (int) 66 #pragma cling add_library_path("$NONEXISTINGVARNAME") //expected-no-diagnostics diff --git a/test/Prompt/DontWrap.C b/test/Prompt/DontWrap.C index 5d9b625c..fdc93f18 100644 --- a/test/Prompt/DontWrap.C +++ b/test/Prompt/DontWrap.C @@ -217,7 +217,7 @@ constexpr int cExpr() { return 801; } cExpr() -// CHECK: (int) 8 +// CHECK: (int) 801 int * & cIntStarRef(int*& val) { return val; @@ -226,10 +226,12 @@ int * & cIntStarRef(int*& val) { int * RPtr = &Ref; int *& RefRPtr = RPtr; cIntStarRef(RefRPtr) -// CHECK: (int *) 0x{{[0-9]+}} +// CHECK: (int *) 0x{{[0-9a-f]+}} namespace Issue_113 {} // Keep the blank space after the using clause. using namespace Issue_113; +// CHECK: Nested::~Nested(80) + // expected-no-diagnostics diff --git a/test/Prompt/Regression.C b/test/Prompt/Regression.C index e80e2ff1..508408bf 100644 --- a/test/Prompt/Regression.C +++ b/test/Prompt/Regression.C @@ -45,7 +45,7 @@ int step = 10 // CHECK: (int) 10 step // CHECK: (int) 10 gCling->process("#ifdef __UNDEFINED__\n42\n#endif") -//CHECK: (cling::Interpreter::CompilationResult) (cling::Interpreter::CompilationResult::kSuccess) : (unsigned int) 0 +//CHECK: (cling::Interpreter::CompilationResult) (cling::Interpreter::CompilationResult::kSuccess) : ({{(unsigned )?}}int) 0 // User input variants of above: #ifdef NOTDEFINED diff --git a/test/Prompt/ValuePrinter/Assignments.C b/test/Prompt/ValuePrinter/Assignments.C index 2d5528ca..486dd54b 100644 --- a/test/Prompt/ValuePrinter/Assignments.C +++ b/test/Prompt/ValuePrinter/Assignments.C @@ -47,7 +47,7 @@ e2 // Arrays: -float farr[] = {0.,1.,2.,3.,4.,5.} // CHECK: (float [6]) { 0.00000f, 1.00000f, 2.00000f, 3.00000f, 4.00000f, 5.00000f } +float farr[] = {0.,1.,2.,3.,4.,5.} // CHECK: (float [6]) { 0.{{0+}}f, 1.{{0+}}f, 2.{{0+}}f, 3.{{0+}}f, 4.{{0+}}f, 5.{{0+}}f } std::string sarr[3] = {"A", "B", "C"} // CHECK: (std::string [3]) { "A", "B", "C" } typedef void (*F_t)(int); diff --git a/test/Prompt/ValuePrinter/Regression.C b/test/Prompt/ValuePrinter/Regression.C index 1385ff0f..49265a43 100644 --- a/test/Prompt/ValuePrinter/Regression.C +++ b/test/Prompt/ValuePrinter/Regression.C @@ -6,7 +6,7 @@ // LICENSE.TXT for details. //------------------------------------------------------------------------------ -// RUN: cat %s | %cling | FileCheck %s +// RUN: cat %s | %cling 2>&1 | FileCheck %s // This file should be used as regression test for the value printing subsystem // Reproducers of fixed bugs should be put here @@ -56,8 +56,14 @@ nullptr // CHECK: (nullptr_t) nullptr true // CHECK: (bool) true false // CHECK: (bool) false +unordered_multiset {1} // ROOT-7310 +// expected-error@2 {{use of undeclared identifier 'unordered_multiset'}} +// expected-error@2 {{expected '(' for function-style cast or type construction}} +// expected-error@2 {{initializer list cannot be used on the right hand side of operator '>'}} + #include -std::unordered_multiset {1} // ROOT-7310 +std::unordered_multiset {1} +// FIXME: BROKEN_ON_LINUX-CHECK: (std::unordered_multiset) { 1.00000f } // ROOT-7426 #include @@ -67,8 +73,16 @@ a // CHECK: (std::vector &) { "a", "b", "c" } a[0] // CHECK: ({{.*}} &) "a" // ROOT-7918 -enum H { h = (unsigned long long )-1 }; -h // CHECK: (H) (H::h) : (unsigned long{{( long)?}}) 18446744073709551615 +struct Enumer { +#ifndef _WIN32 + // This variant fails on Windows, and seems conforming behaviour to do so + enum H { h = (unsigned long long )-1 }; +#else + enum H : unsigned long long { h = (unsigned long long )-1 }; +#endif +}; +Enumer::h +// CHECK: (Enumer::H) (Enumer::H::h) : (unsigned long{{( long)?}}) 18446744073709551615 // ROOT-7837 auto bla=[](double *x, double *par, int blub){return x[0]*blub;} // CHECK: ((lambda) &) @0x @@ -76,6 +90,12 @@ auto bla=[](double *x, double *par, int blub){return x[0]*blub;} // CHECK: ((lam #include using namespace std::placeholders; auto fn_moo = std::bind (bla, _1,_2,10) // CHECK: ERROR in cling::executePrintValue(): missing value string. +// expected-error {{use of undeclared identifier 'lambda'}} +// expected-error {{expected expression}} +// expected-error {{type name requires a specifier or qualifier}} +// expected-error {{expected ')'}} +// expected-note {{to match this '('}} + // Make sure cling survives 12 // CHECK: (int) 12 diff --git a/test/Prompt/globalinit.C b/test/Prompt/globalinit.C index 88d1314a..dd370f2b 100644 --- a/test/Prompt/globalinit.C +++ b/test/Prompt/globalinit.C @@ -6,13 +6,20 @@ // LICENSE.TXT for details. //------------------------------------------------------------------------------ -// RUN: %cling %s -I%p | FileCheck %s +// RUN: %cling %s -DTEST_PATH="\"%/p/\"" -Xclang -verify 2>&1 | FileCheck %s +// RUN: %cling %s -I%p -Xclang -verify 2>&1 | FileCheck %s #include "cling/Interpreter/Interpreter.h" -void globalinit() { - gCling->loadFile("globalinit.C.h", false); // CHECK: A::S() - gCling->loadFile("globalinit.C2.h", false); // CHECK: B::S() +#ifndef TEST_PATH + #define TEST_PATH "" +#endif + +void globalinit(const std::string Path = TEST_PATH) { + gCling->loadFile(Path + "globalinit.C.h", false); // CHECK: A::S() + gCling->loadFile(Path + "globalinit.C2.h", false); // CHECK: B::S() } // CHECK: B::~S() // CHECK: A::~S() + +// expected-no-diagnostics