Commit Graph

61 Commits

Author SHA1 Message Date
NAKAMURA Takumi 556d713c70 clang/test/Driver: Introduce the feature "clang-driver", set if gcc driver is not used.
It is not set at targetting cygming. See PR12920.

llvm-svn: 169824
2012-12-11 07:06:09 +00:00
NAKAMURA Takumi eb360a0d4f clang/test/lit.cfg: Disable dev-fd-fs on cygwin for now.
open("/dev/fd/1-foobar") fails with EEXIST on cygwin.

llvm-svn: 168676
2012-11-27 05:25:41 +00:00
NAKAMURA Takumi a95099ebd3 Revert r168132, "clang/test/lit.cfg: Suppress the feature 'dev-fd-fs' for now." I missed Daniel's r168095 by my accident.
llvm-svn: 168134
2012-11-16 03:50:55 +00:00
NAKAMURA Takumi 0e551c191c clang/test/lit.cfg: Suppress the feature 'dev-fd-fs' for now.
None of my buildhost (centos6 x86-64 and cygwin) is passing. Investigating.

llvm-svn: 168132
2012-11-16 03:28:51 +00:00
Daniel Dunbar 523855929b tests: Add a test for reading from named pipes.
- Realized I could use the /dev/fd filesystem to make a simple portable test.

llvm-svn: 168079
2012-11-15 20:06:10 +00:00
Argyrios Kyrtzidis d6bdafc858 [lit] For the "case-insensitive-filesystem" make sure to create the test temporary file
in the test output directory.

llvm-svn: 167193
2012-11-01 00:59:15 +00:00
Argyrios Kyrtzidis d7c16b2543 [PCH] Remove the stat cache from the PCH file.
The stat cache became essentially useless ever since we started
validating all file entries in the PCH.
But the motivating reason for removing it now is that it also affected
correctness in this situation:

-You have a header without include guards (using "#pragma once" or #import)
-When creating the PCH:
  -The same header is referenced in an #include with different filename cases.
  -In the PCH, of course, we record only one file entry for the header file
  -But we cache in the PCH file the stat info for both filename cases

-Then the source files are updated and the header file is updated in a way that
 its size and modification time are the same but its inode changes

-When using the PCH:
  -We validate the headers, we check that header file and we create a file entry with its current inode
  -There's another #include with a filename with different case than the previously created file entry
  -In order to get its stat info we go through the cached stat info of the PCH and we receive the old inode
  -because of the different inodes, we think they are different files so we go ahead and include its contents.

Removing the stat cache will potentially break clients that are attempting to use the stat cache
as a way of avoiding having the actual input files available. If that use case is important, patches are welcome
to bring it back in a way that will actually work correctly (i.e., emit a PCH that is self-contained, coping with
literal strings, line/column computations, etc.).

This fixes rdar://5502805

llvm-svn: 167172
2012-10-31 20:59:50 +00:00
Rafael Espindola 84619411eb In the past "production" clang builds would not be used for c++, and
we had the -ccc-clang-cxx and -ccc-no-clang-cxx options to force them
on or off for testing.

Clang c++ support is now production quality and these options are dead.

llvm-svn: 166986
2012-10-30 00:13:16 +00:00
Daniel Dunbar fc6bd5cbda tests: Stop mangling '-vg' into the triple, we don't use this currently.
- Also, lit is going to get a valgrind feature, instead.

llvm-svn: 166301
2012-10-19 20:11:46 +00:00
Alexander Potapenko b4f819086a Disable source fortification on Darwin with AddressSanitizer.
ASan doesn't play well with -D_FORTIFY_SOURCE, which is enabled by default starting at OS X 10.7

llvm-svn: 164299
2012-09-20 10:10:01 +00:00
NAKAMURA Takumi fcd16e36c8 clang/test: [PR8833] Introduce the feature "LP64" to suppress LLP64-incompatible tests.
I think some of them could be rewritten to fit also LLP64.

llvm-svn: 163699
2012-09-12 10:45:40 +00:00
NAKAMURA Takumi 6bbc981d37 clang/test/lit.cfg: Fix a typo in comment.
llvm-svn: 163696
2012-09-12 10:38:03 +00:00
Dmitri Gribenko 740c0fbe0e 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!

llvm-svn: 161431
2012-08-07 17:54:38 +00:00
NAKAMURA Takumi b59973e6cd clang/test/Misc/diag-template-diffing-color.cpp: Introduce the feature 'ansi-escape-sequences'.
llvm-svn: 160043
2012-07-11 11:44:00 +00:00
NAKAMURA Takumi c4d558a43e test/lit.cfg: Please pass %INCLUDE% to clang.exe on Win32. MS-compatible clang may refer to %INCLUDE%. It fixes r154188.
llvm-svn: 154240
2012-04-07 01:02:53 +00:00
Jordy Rose 0e09facb85 Clear environment variables that might affect Clang before running tests.
llvm-svn: 154188
2012-04-06 18:14:01 +00:00
Jim Grosbach 576452b830 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

llvm-svn: 150273
2012-02-10 20:37:10 +00:00
NAKAMURA Takumi cd9c3d6647 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.

llvm-svn: 145231
2011-11-28 05:09:42 +00:00
Chandler Carruth a62ba81682 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.

llvm-svn: 143917
2011-11-07 09:17:31 +00:00
Chandler Carruth 34146d8ca7 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.

llvm-svn: 143842
2011-11-05 23:29:28 +00:00
Chandler Carruth 2837f667e0 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.

llvm-svn: 143823
2011-11-05 20:55:50 +00:00
Chandler Carruth afd2441f60 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.

llvm-svn: 143807
2011-11-05 10:41:42 +00:00
Chandler Carruth c0b1b86ff4 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.

llvm-svn: 143804
2011-11-05 10:15:27 +00:00
Andrew Trick 3df2824c59 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

llvm-svn: 138672
2011-08-26 22:46:31 +00:00
NAKAMURA Takumi fbd46b0736 test/lit.cfg: Enable "crash-recovery" tests on Win32 hosts. CrashRecoveryContext supports Win32 since r138199.
FIXME: Shall we eliminate the feature "crash-recovery"?
llvm-svn: 138201
2011-08-20 07:09:20 +00:00
Galina Kistanova b38fd263bd Added registered targets for in-test dependency declarations.
llvm-svn: 132571
2011-06-03 18:36:30 +00:00
NAKAMURA Takumi 70f5be634a test/lit.cfg: bash is available on MSYS.
llvm-svn: 127080
2011-03-05 11:16:06 +00:00
NAKAMURA Takumi f5ea88b8ab test: Add the feature "shell". Frontend/dependency-gen.c would be executable with shell.
The feature "shell" is implemented in llvm/test.

llvm-svn: 126646
2011-02-28 09:41:07 +00:00
Peter Collingbourne de32b20bdd Reject forbidden storage class specifiers in OpenCL. Patch by George Russell!
llvm-svn: 125399
2011-02-11 19:59:54 +00:00
NAKAMURA Takumi 1e8200d7ba test: CMake: Be aware of LLVM_LIT_TOOLS_DIR.
llvm-svn: 125178
2011-02-09 04:19:57 +00:00
David Greene 7b29345ff3 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.

llvm-svn: 122753
2011-01-03 17:28:52 +00:00
Peter Collingbourne 8f6218bfa0 test: add .cu extension
llvm-svn: 120553
2010-12-01 04:22:41 +00:00
Nico Weber a384e9a5f4 Let lit give helpful advice if 'make test' was not run yet.
llvm-svn: 114869
2010-09-27 20:40:32 +00:00
Devang Patel 068b5b3d61 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.

llvm-svn: 113780
2010-09-13 20:46:23 +00:00
Daniel Dunbar b44eb0b900 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).

llvm-svn: 111970
2010-08-24 21:39:55 +00:00
Daniel Dunbar 8452ef0798 tests: Use %clangxx when using driver for C++, in case C++ support is disabled.
llvm-svn: 107153
2010-06-29 16:52:24 +00:00
Daniel Dunbar 9b9a46c3f2 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.

llvm-svn: 99089
2010-03-20 21:13:08 +00:00
John McCall 2c7c0424b2 Revert r97727 at ddunbar's request; we want to solve this some other way.
llvm-svn: 97971
2010-03-08 20:01:09 +00:00
John McCall b07d8b56d2 Steal the TARGET lit condition from the LLVM test suite.
llvm-svn: 97727
2010-03-04 09:38:07 +00:00
Daniel Dunbar 1c32596e56 tests: Tweak %clangxx definition to something which should be more portable.
llvm-svn: 96593
2010-02-18 18:10:26 +00:00
Daniel Dunbar 78c974fcba tests: Add '%clangxx' substitution, for 'clang++'
llvm-svn: 96510
2010-02-17 20:31:01 +00:00
Daniel Dunbar 5618e98f33 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).

llvm-svn: 91460
2009-12-15 22:01:24 +00:00
Daniel Dunbar 8fbe78f6fc 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).

llvm-svn: 91446
2009-12-15 20:14:24 +00:00
Daniel Dunbar 01bf3397a0 Tests: Stop looking for clang-cc, we don't need it.
llvm-svn: 91183
2009-12-11 23:35:10 +00:00
Daniel Dunbar 8c5024a63f 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).
llvm-svn: 91173
2009-12-11 22:52:03 +00:00
Daniel Dunbar d90e0a113e Drop require_and_and argument.
llvm-svn: 86433
2009-11-08 01:47:35 +00:00
Daniel Dunbar 8b57697954 Eliminate &&s in tests.
- 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&& *$#\1#g' $i | FileUpdate $i; done', for the curious.

llvm-svn: 86430
2009-11-08 01:45:36 +00:00
Daniel Dunbar 8466a0d944 Tweak a FIXME.
llvm-svn: 86420
2009-11-07 23:53:17 +00:00
Daniel Dunbar d3f630f4d5 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).

llvm-svn: 86139
2009-11-05 16:36:19 +00:00
Daniel Dunbar a87097a6ac Add the lib path to LD_LIBRARY_PATH, so finding .so works (more) portably.
llvm-svn: 82853
2009-09-26 07:36:09 +00:00