diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2014-02-13 16:51:38 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2014-02-13 16:51:38 +0000 |
commit | cf7344d4ce5c85580fc04b5e5caed6e69591d011 (patch) | |
tree | 6a452bdb6c8c36d5cf2f54338a5117bbe96ecf25 /unittests | |
parent | a621dcd8cea2dae44ed206e05835471192718e10 (diff) |
libclang: fix a bug in processing invalid arguments, introduced in r201249,
pointed out by Daniel Jasper in r201329
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201346 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/CMakeLists.txt | 1 | ||||
-rw-r--r-- | unittests/Makefile | 2 | ||||
-rw-r--r-- | unittests/libclang/CMakeLists.txt | 7 | ||||
-rw-r--r-- | unittests/libclang/LibclangTest.cpp | 17 | ||||
-rw-r--r-- | unittests/libclang/Makefile | 25 |
5 files changed, 51 insertions, 1 deletions
diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index f00008e040..9cb0800540 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -22,3 +22,4 @@ if(CLANG_ENABLE_REWRITER) add_subdirectory(Format) add_subdirectory(Sema) endif() +add_subdirectory(libclang) diff --git a/unittests/Makefile b/unittests/Makefile index e4fbe584da..9b95a6eda2 100644 --- a/unittests/Makefile +++ b/unittests/Makefile @@ -14,7 +14,7 @@ ifndef CLANG_LEVEL IS_UNITTEST_LEVEL := 1 CLANG_LEVEL := .. -PARALLEL_DIRS = Basic Lex Driver +PARALLEL_DIRS = Basic Lex Driver libclang include $(CLANG_LEVEL)/../..//Makefile.config diff --git a/unittests/libclang/CMakeLists.txt b/unittests/libclang/CMakeLists.txt new file mode 100644 index 0000000000..1cdc45e2d2 --- /dev/null +++ b/unittests/libclang/CMakeLists.txt @@ -0,0 +1,7 @@ +add_clang_unittest(libclangTests + LibclangTest.cpp + ) + +target_link_libraries(libclangTests + libclang + ) diff --git a/unittests/libclang/LibclangTest.cpp b/unittests/libclang/LibclangTest.cpp new file mode 100644 index 0000000000..7048af9584 --- /dev/null +++ b/unittests/libclang/LibclangTest.cpp @@ -0,0 +1,17 @@ +//===- unittests/libclang/LibclangTest.cpp --- libclang tests -------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "clang-c/Index.h" +#include "gtest/gtest.h" + +TEST(libclang, TestInvalidArgs) { + EXPECT_EQ(CXError_InvalidArguments, + clang_parseTranslationUnit2(0, 0, 0, 0, 0, 0, 0, 0)); +} + diff --git a/unittests/libclang/Makefile b/unittests/libclang/Makefile new file mode 100644 index 0000000000..e96c925858 --- /dev/null +++ b/unittests/libclang/Makefile @@ -0,0 +1,25 @@ +##===- unittests/libclang/Makefile -------------------------*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## + +CLANG_LEVEL = ../.. +TESTNAME = libclang +include $(CLANG_LEVEL)/../../Makefile.config +LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc option + +# Note that 'USEDLIBS' must include all of the core clang libraries +# when -static is given to linker on cygming. +USEDLIBS = clang.a \ + clangIndex.a clangFormat.a clangRewriteCore.a \ + clangFrontend.a clangDriver.a \ + clangTooling.a \ + clangSerialization.a clangParse.a clangSema.a \ + clangAnalysis.a clangEdit.a clangAST.a clangLex.a \ + clangBasic.a + +include $(CLANG_LEVEL)/unittests/Makefile |