Граф коммитов

49 Коммитов

Автор SHA1 Сообщение Дата
Dmitri Gribenko f303d4cb10 libclang API for comment-to-xml conversion.
The implementation also includes a Relax NG schema and tests for the schema
itself.  The schema is used in c-index-test to verify that XML documents we
produce are valid.  In order to do the validation, we add an optional libxml2
dependency for c-index-test.

Credits for CMake part go to Doug Gregor.  Credits for Autoconf part go to Eric
Christopher.  Thanks!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161431 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-07 17:54:38 +00:00
NAKAMURA Takumi 0ca4be3c9a clang/test/Misc/diag-template-diffing-color.cpp: Introduce the feature 'ansi-escape-sequences'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160043 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-11 11:44:00 +00:00
NAKAMURA Takumi 79c5f95f24 test/lit.cfg: Please pass %INCLUDE% to clang.exe on Win32. MS-compatible clang may refer to %INCLUDE%. It fixes r154188.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154240 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-07 01:02:53 +00:00
Jordy Rose 40f45ee42b Clear environment variables that might affect Clang before running tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154188 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-06 18:14:01 +00:00
Jim Grosbach fc30829694 Have the driver pass CPU and target feature information to cc1as.
When creating the MCSubtargetInfo, the assembler driver uses the CPU and
feature string to construct a more accurate model of what instructions
are and are not legal.

rdar://10840476


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150273 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 20:37:10 +00:00
NAKAMURA Takumi 6079676900 test/lit.cfg: Enhance getRegisteredTargets() to retrieve +Asserts.
- s/getRegisteredTargets/get_llc_props/g
  - get_llc_props() returns dict {"set_of_targets", "enable_assertions"}
  - Enable the feature "asserts".
    test/Driver/darwin-verify-debug.c had expected it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145231 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-28 05:09:42 +00:00
Chandler Carruth 07643086c6 Rip out one of the features I added for the driver-include-management.
We don't actually need a separate flag for non-sysrooted paths as the
driver has to manage the sysroot anyways. The driver is not infrequently
adding paths to the header search based on their existence on the
filesystem. For that, it has to add the sysroot anyways, we should pass
it on down to CC1 already joined. More importantly, the driver cannot in
all cases distinguish between sysrooted paths and paths that are
relative to the Clang binary's installation directory. Essentially, we
always need to ignore the system root for these internal header search
options. It turns out in most of the places we were already providing
the system root in the driver, and then another one in CC1 so this fixes
several bugs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143917 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-07 09:17:31 +00:00
Chandler Carruth df0a4c374b Switch Lit to directly query the driver for the builtin inclue path.
Thanks to Peter for pointing out how easy this is to do. I'm now much
happier with this solution.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143842 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-05 23:29:28 +00:00
Chandler Carruth b40fd3fd30 Teach lit to ask the Clang it is running what version string to use
rather than presuming that it is 3.0. This is extra important as the
version should be 3.1, but CMake hasn't caught up with the times.
That'll be fixed in a separate commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143823 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-05 20:55:50 +00:00
Chandler Carruth 292da56eda Compute the path properly on different platforms. Specifically, compute
it the exact same way that the Clang code computes this path.

Hopefully with this, the MSVC bots will actually come back to life.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143807 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-05 10:41:42 +00:00
Chandler Carruth 044a790ca3 Teach Lit to pass the CC1 invocation the builtin include directory. This
is a pretty gross hack, but I don't have any significantly cleaner ideas
for this. There are several things obviously gross about it:

1) Lit shouldn't know that Clang needs this. This really that bad, as
   Lit already knows about CC1 and other internal details.
2) This hard codes the '3.0' version number, which is pretty lame.
3) This hard codes every other aspect of the resource dir structure
   which is less lame than the version number, but still not great.

However, it should bring the MSVC tests back to life, and it should
unblock the rest of the move from Frontend to Driver, so I think it's
worth a bit of grossness that is isolated in our testing infrastructure
while we figure out the best long term approach. I have the following
ideas, some of which only solve part of the problem (and thus might need
to be combined with other ideas):

a) Create a symlink or other convenience path instead of a version
   number.
b) Run 'clang' directly in the lit.cfg, look at its resource dir, and use
   that.
c) Switch all the tests to use the driver instead of CC1.
d) Hack the frontend to synthesize builtin include directories when none
   are provided by the driver.

I don't like (d) because it feels very hackish and likely to break. We
can only solve a small part of the problem with (a). I wanted to vote
for (c), but lots of the tests in this bucket are really heavily using
internal-only flags like -verify and -triple. I'm loath to complicate
them with the full driver layer. Also, switching them to the driver adds
more than just builtin headers, but all of the rest of the system
headers!

This leaves me with (b). If others like (b), I'll switch to it, but it
felt a bit icky. Nothing concrete, and the other options look
significantly worse, but I felt icky enough that I wanted to start with
a more brain-dead patch to stop the bleeding, and gauge others' feelings
here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143804 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-05 10:15:27 +00:00
Andrew Trick 6da28e24c9 FreeBSD (apparently) does not support crash-recovery tests.
These tests have been failing since the beginning of buildbot time:
crash-recovery-code-complete.c
crash-recovery-reparse.c
crash-recovery.c


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138672 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-26 22:46:31 +00:00
NAKAMURA Takumi e1ffb15356 test/lit.cfg: Enable "crash-recovery" tests on Win32 hosts. CrashRecoveryContext supports Win32 since r138199.
FIXME: Shall we eliminate the feature "crash-recovery"?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138201 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-20 07:09:20 +00:00
Galina Kistanova ee22697a56 Added registered targets for in-test dependency declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132571 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-03 18:36:30 +00:00
NAKAMURA Takumi 9085e6f97a test/lit.cfg: bash is available on MSYS.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127080 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-05 11:16:06 +00:00
NAKAMURA Takumi ef34d774d8 test: Add the feature "shell". Frontend/dependency-gen.c would be executable with shell.
The feature "shell" is implemented in llvm/test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126646 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 09:41:07 +00:00
Peter Collingbourne e2f82f7138 Reject forbidden storage class specifiers in OpenCL. Patch by George Russell!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125399 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-11 19:59:54 +00:00
NAKAMURA Takumi 98af1ac994 test: CMake: Be aware of LLVM_LIT_TOOLS_DIR.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125178 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 04:19:57 +00:00
David Greene 431feb579d Support lit fixes for PR8199
Replace "clang++" with "clang\+\+" because we have to escape regexp
special characters now.  This is in preparation for changes to lit to
fix PR8199.  Tests will fail until the lit part gets committed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122753 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-03 17:28:52 +00:00
Peter Collingbourne 4f9e97138d test: add .cu extension
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120553 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 04:22:41 +00:00
Nico Weber b4a88efcab Let lit give helpful advice if 'make test' was not run yet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114869 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 20:40:32 +00:00
Devang Patel 8c6b9135fc Recognize .ll as input files.
Handle %test_debuginfo on a RUN command line.

This set up now allows one to write small test cases to check debug info.
e.g.

; RUN: %clang -O0 -g %s -c -o %t.o
; RUN: %clang %t.o -o %t.out  
; RUN: %test_debuginfo %s %t.out

define i32 @f1(i32 %i) nounwind ssp {
; DEBUGGER: break f1                                                               
; DEBUGGER: r                                                                      
; DEBUGGER: p i                                                                    
; CHECK: $1 = 42                                                                   
entry:
  %i.addr = alloca i32, align 4
...
...
}

It is also possible now to write test cases in c/c++.
The plan is to store these debug info testcases in a separate place.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113780 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 20:46:23 +00:00
Daniel Dunbar db918646c0 tests: Use REQUIRES: instead of XFAIL: for crash recovery tests; running them on
Windows breaks things (because it pops up dialogs) since we don't have crash
recovery support there (yet).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111970 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 21:39:55 +00:00
Daniel Dunbar 9fde9c424f tests: Use %clangxx when using driver for C++, in case C++ support is disabled.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107153 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 16:52:24 +00:00
Daniel Dunbar e1fa09661a tests: Mangle '-vg' onto the end of the triple when running under valgrind, so
we can use the standard XFAIL and XTARGET to conditional tests based on
valgrind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99089 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 21:13:08 +00:00
John McCall 43533c9fa0 Revert r97727 at ddunbar's request; we want to solve this some other way.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97971 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 20:01:09 +00:00
John McCall 0ea271c352 Steal the TARGET lit condition from the LLVM test suite.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97727 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 09:38:07 +00:00
Daniel Dunbar 66430964e6 tests: Tweak %clangxx definition to something which should be more portable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96593 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 18:10:26 +00:00
Daniel Dunbar 679d605407 tests: Add '%clangxx' substitution, for 'clang++'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96510 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 20:31:01 +00:00
Daniel Dunbar 80737ad5e0 Update tests to use %clang instead of 'clang', and forcibly disable use of '
clang ' or ' clang -cc1 ' or ' clang-cc ' in test lines (by substituting them to
garbage).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91460 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 22:01:24 +00:00
Daniel Dunbar a5728872c7 Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
- This is designed to make it obvious that %clang_cc1 is a "test variable"
   which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
   can be useful to redefine what gets run as 'clang -cc1' (for example, to set
   a default target).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91446 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 20:14:24 +00:00
Daniel Dunbar e9c2f0fefd Tests: Stop looking for clang-cc, we don't need it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91183 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 23:35:10 +00:00
Daniel Dunbar 98d3ea6c39 Tests: Change substitution to automagically use 'clang -cc1' instead of 'clang-cc'. I still plan to eventually rewrite the tests to clarify the magic (I will probably actually rewrite them to %clang so it is more obvious this is a variable that gets substituted).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91173 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 22:52:03 +00:00
Daniel Dunbar bc20ef3150 Drop require_and_and argument.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86433 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08 01:47:35 +00:00
Daniel Dunbar 4fcfde4d5c Eliminate &&s in tests.
- 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&& *$#\1#g' $i | FileUpdate $i; done', for the curious.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86430 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08 01:45:36 +00:00
Daniel Dunbar 23354213c3 Tweak a FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86420 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-07 23:53:17 +00:00
Daniel Dunbar b258d8f961 Add clang_site_config user variable, so that extra tests (e.g., utils/C++Syntax)
can always find the main clang site config (when invoked via CMake/Makefiles, at
least).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86139 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-05 16:36:19 +00:00
Daniel Dunbar 9e10cc7a4c Add the lib path to LD_LIBRARY_PATH, so finding .so works (more) portably.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82853 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 07:36:09 +00:00
Daniel Dunbar ee45d6dc89 We no longer need anything from the llvm/test/Scripts dir.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82687 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 06:31:08 +00:00
Daniel Dunbar b850ddd2ce Always execute tests internally on Windows.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82542 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 10:08:03 +00:00
Daniel Dunbar 5e01e3cae6 Remove old test runner, this has moved to LLVM/utils/lit and all known clients
have been updated.
 - Please let me know of any problems.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82524 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 05:16:02 +00:00
Daniel Dunbar 1b720a90f2 Include LLVM {src,obj} root in lit.site.cfg, to support non-standard layouts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82401 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 19:04:35 +00:00
Daniel Dunbar 7af18d359f Tweak clang testing.
- Move CMake to using the new test runner.

 - Switch Makefiles to use the lit.site.cfg.in template.

 - Remove explicit --path arguments, instead this gets written into the site
   configuration. This means running lit from the command line should use the
   exact same configuration as is used in 'make test', assuming it can find the
   site configuration file. You still need to run 'make test' (or the cmake
   build target equivalent) at least once.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82160 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-17 19:55:53 +00:00
Daniel Dunbar 280aa75eb0 tests: Stash clang/clang-cc and LLVM src/obj paths for use elsewhere.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81989 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 01:39:52 +00:00
Daniel Dunbar 58033318b1 Teach LIT2 how to run Clang tests in the objdir for srcdir != objdir builds.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81472 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 23:00:15 +00:00
Daniel Dunbar 724827ff93 Support running tests using the new 'lit', via 'make test LIT2=1'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81225 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 16:39:23 +00:00
Daniel Dunbar 6827f3ff9f lit: Set requireAndAnd config variable (currently unused).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81099 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 01:31:12 +00:00
Daniel Dunbar c1e1d7c9b3 Add missing test suffixes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77666 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 05:57:11 +00:00
Daniel Dunbar 1db467f120 MultiTestRunner: Simplify, cleanup, and rename!
- MultiTestRunner will eventually be renamed to 'lit', for LLVM integrated
   tester/testing. This has the pros of being pronouncable and short.

 - "Project" level configuration lives in 'lit.cfg', which is also what lit uses
   to find the root testing directory in some cases. This can be overridden for
   use in project files which want to precisely specify where things are.

 - TestRunner.py is not longer able to be invoked directly.
 
 - Moved some code to Util.py.

 - Introduced a configuration object.

 - Cleaned up --help, removed a few not-very-useful options.

 - Tried not to break anything that works. :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77665 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 05:54:17 +00:00