Windows: Fix various test failures.
This commit is contained in:
parent
705e2b2a7e
commit
bf3c8052d8
@ -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}}
|
||||
|
||||
|
@ -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>(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>(double)
|
||||
// CHECK: Maybe you need to load the corresponding shared library?
|
||||
|
||||
// ROOT-7295
|
||||
#include <vector>
|
||||
|
@ -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;
|
||||
|
@ -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)) {
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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<float> {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 <unordered_set>
|
||||
std::unordered_multiset<float> {1} // ROOT-7310
|
||||
std::unordered_multiset<float> {1}
|
||||
// FIXME: BROKEN_ON_LINUX-CHECK: (std::unordered_multiset<float>) { 1.00000f }
|
||||
|
||||
// ROOT-7426
|
||||
#include <string>
|
||||
@ -67,8 +73,16 @@ a // CHECK: (std::vector<std::string> &) { "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 <functional>
|
||||
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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user