From f2168f6491b9c246caebce08a819da7cfaa826a4 Mon Sep 17 00:00:00 2001 From: Frederich Munch Date: Thu, 6 Jul 2017 12:36:01 -0400 Subject: [PATCH 1/2] Windows: Fix declaration for C99 and re-enable Gnu.C test. This reverts commit 5947e13cb99052b6f7a5b501244ee2be9be9d080. --- lib/Interpreter/Interpreter.cpp | 7 +++++-- test/Driver/Gnu.C | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/Interpreter/Interpreter.cpp b/lib/Interpreter/Interpreter.cpp index 50965d7156..00e71679c5 100644 --- a/lib/Interpreter/Interpreter.cpp +++ b/lib/Interpreter/Interpreter.cpp @@ -433,9 +433,12 @@ namespace cling { #else const char* Spec = "__clrcall"; #endif + const bool ParamNames = LangOpts.C99; Strm << Linkage << " " << Spec << " int (*__dllonexit(" - << "int (" << Spec << " *f)(void**, void**), void**, void**))" - "(void**, void**)"; + << "int (" << Spec << " *f)(void**, void**)," + << "void**" << (ParamNames ? " a" : "") << "," + << "void**" << (ParamNames ? " b" : "") + << "))(void**, void**)"; if (EmitDefinitions) Strm << " { __cxa_atexit((void(*)(void*))f, 0, __dso_handle);" " return f; }\n"; diff --git a/test/Driver/Gnu.C b/test/Driver/Gnu.C index 47c0c084a2..2f0b149f1e 100644 --- a/test/Driver/Gnu.C +++ b/test/Driver/Gnu.C @@ -10,7 +10,6 @@ // RUN: cat %s | %cling -D__STRICT_ANSI__ -std=gnu++11 -Xclang -verify 2>&1 | FileCheck %s // RUN: cat %s | %cling -D__STRICT_ANSI__ -std=gnu++14 -Xclang -verify 2>&1 | FileCheck %s // RUN: cat %s | %cling -D__STRICT_ANSI__ -std=gnu++1z -Xclang -verify 2>&1 | FileCheck %s -// REQUIRES: not_system-windows #ifdef __cplusplus extern "C" int printf(const char*, ...); From fe4990ee580dd7231e441f16952c35c1ce5d9a00 Mon Sep 17 00:00:00 2001 From: Frederich Munch Date: Fri, 7 Jul 2017 09:57:01 -0400 Subject: [PATCH 2/2] Windows: Remove C++11 test which Visual Studio cannot handle. --- test/Driver/Gnu.C | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/Driver/Gnu.C b/test/Driver/Gnu.C index 2f0b149f1e..fc2f73b463 100644 --- a/test/Driver/Gnu.C +++ b/test/Driver/Gnu.C @@ -7,10 +7,12 @@ //------------------------------------------------------------------------------ // RUN: cat %s | %cling -std=gnu99 -x c -Xclang -verify 2>&1 | FileCheck %s -// RUN: cat %s | %cling -D__STRICT_ANSI__ -std=gnu++11 -Xclang -verify 2>&1 | FileCheck %s // RUN: cat %s | %cling -D__STRICT_ANSI__ -std=gnu++14 -Xclang -verify 2>&1 | FileCheck %s // RUN: cat %s | %cling -D__STRICT_ANSI__ -std=gnu++1z -Xclang -verify 2>&1 | FileCheck %s +// RUN: cat %s | %cling --noruntime -D__STRICT_ANSI__ -std=gnu++11 -Xclang -verify 2>&1 | FileCheck %s +// --noruntime is for Windows which cannot include VSudio C++ headers in C++11 + #ifdef __cplusplus extern "C" int printf(const char*, ...); #else