Commit Graph

331 Commits

Author SHA1 Message Date
Kevin Enderby fc85b1d1c5 Add missing triple to darwin clang driver test.
llvm-svn: 147179
2011-12-22 21:32:51 +00:00
Kevin Enderby 292dc080e0 Last part of support for generating dwarf for assembly source files. This gets
the clang driver to enable this when assembling a .s file.  rdar://9275556

llvm-svn: 147167
2011-12-22 19:31:58 +00:00
Chandler Carruth 7cf80e3850 Teach the link-step test to verify that we don't pass bad --hash-style
flags on MIPS paltforms.

llvm-svn: 146837
2011-12-17 21:57:25 +00:00
Rafael Espindola 224dd63fff Don't use the frame pointer on linux x86 and x86_64 if optimizing. This
matches gcc's behavior.

Fixes PR8186.

llvm-svn: 146586
2011-12-14 21:02:23 +00:00
Bob Wilson 721d4b858d Enable stack protectors by default for iOS. <rdar://problem/8836680>
llvm-svn: 146552
2011-12-14 06:08:25 +00:00
Hal Finkel 6b89a10b45 add tree test for suse on ppc64 (r146142)
llvm-svn: 146176
2011-12-08 20:36:19 +00:00
Nick Lewycky 32275b9739 Fix test for unrelated changes.
llvm-svn: 145915
2011-12-06 03:46:28 +00:00
Nick Lewycky f4d3f7a0b9 Stack realignment is a tristate. Add -mno-stackrealign to turn off all stack
realignment, even with locals with alignment exceeding the ABI guarantee.

llvm-svn: 145909
2011-12-06 03:33:03 +00:00
Peter Collingbourne 6e6e52b58a Un-XFAIL this test on Darwin, it reportedly passes now.
llvm-svn: 145052
2011-11-21 21:56:51 +00:00
Peter Collingbourne 0e7e3fc130 Delete the depfile if we could not open a header file. We cannot
generate any reasonable depfile if a header is missing.

llvm-svn: 145019
2011-11-21 00:01:14 +00:00
Peter Collingbourne 119cfaa595 Teach the driver about failure result files, which are compilation
output files that are valid regardless of whether the compilation
succeeded or failed (but not if we crash).  Add depfiles to the
failure result file list.

llvm-svn: 145018
2011-11-21 00:01:05 +00:00
Daniel Dunbar e285a7d3f0 tests/Driver/darwin-ld.c: Get rid of the "splatter" test case. We have enough
other coverage that actually properly checks features such that this test is not
really adding value anymore.

llvm-svn: 144868
2011-11-17 00:36:53 +00:00
Benjamin Kramer 116d8879e6 Print a typo correction hint for unknown warning flags.
$ clang -Wololo t.c
warning: unknown warning option '-Wololo'; did you mean '-Wall'? [-Wunknown-warning-option]

llvm-svn: 144591
2011-11-14 23:30:34 +00:00
Matt Beaumont-Gay 8e9aae5999 Don't track depfiles as result files which need to be cleaned up on failure.
This is a partial revert of r143846. While cleaning up after a crash is
probably a good idea, we were also deleting .d files if the compilation failed
due to invalid input, which is not the desired behavior. The test is XFAIL'd
until the cleanup code can be reworked to do the right thing.

llvm-svn: 144590
2011-11-14 23:24:52 +00:00
Chandler Carruth b4aabc88f7 Try to fix an issue on some hosts where the 'lib' in the builtin include
path is actually a multilib.

llvm-svn: 144177
2011-11-09 08:26:57 +00:00
Chandler Carruth 6e46ca2c10 Fix an issue that Duncan discovered on a specific (no longer current)
version of Ubuntu. It has a very broken multiarch configuration, and so
we need special logic to handle it correctly. Fixing and testing this
uncovered a few other trivial issues with the logic that are fixed as
well.

I added tests to cover this as it is hard to notice if you install
recent versions of the OS.

llvm-svn: 144165
2011-11-09 03:46:20 +00:00
NAKAMURA Takumi 04d581665e test/Driver/crash-cleanup.c: Remove "XFAIL: mingw32" corresponding to r143876.
llvm-svn: 143877
2011-11-06 16:59:41 +00:00
NAKAMURA Takumi aee36a196a test/Driver/crash-cleanup.c: Mark as XFAIL: mingw32, for investigating.
"XFAIL: msys" has no effect, due to XFAIL inspects triplet, and msys build does not use *-msys-* but *-mingw32.

llvm-svn: 143868
2011-11-06 09:11:35 +00:00
Peter Collingbourne ae6b2f44c3 XFAIL crash-cleanup.c only on Darwin and msys.
llvm-svn: 143858
2011-11-06 04:32:01 +00:00
Chad Rosier 7533488f62 XFAIL test until Peter has a chance to investigate.
llvm-svn: 143857
2011-11-06 03:42:36 +00:00
Peter Collingbourne 9b515cb0ec Add the depfile as a result file so that it is deleted if we crash,
and prevent the diagnostic preprocessor run from writing a depfile.

llvm-svn: 143846
2011-11-06 00:40:05 +00:00
Chandler Carruth bff1e8d53d Enhance the GCC version parsing and comparison logic to handle some more
edge cases and have better behavior. Specifically, we should actually
prefer the general '4.6' version string over the '4.6.1' string, as
'4.6.2' should be able to replace it without breaking rpaths or any
other place that these paths have been embedded. Debian-based
distributions are already using a path structure with symlinks to
achieve in-place upgrades for patch versions. Now our parsing reflects
this and we select the shorter paths instead of the longer paths.

A separate issue was that we would not parse a leading patch version
number even in the presence of a suffix. The above change makes this
more problematic as it would cause a suffix being added to make us treat
the entire thing as patch-version-agnostic, which it isn't. This changes
the logic to distinguish between '4.4.x' and 4.4.1-x', and retain that
the latter has *some* patch number information. Currently, we always
bias toward the shorter and more canonical version strings. If it
becomes important we can add more Debian like rules to produce sequences
such as '4.4.1b' > '4.4.1' > '4.4.1-rc3' > '4.4.1-rc2' > '4.4.1-pre5',
but I'm very doubtful this will ever matter or be desirable.

I've made the tests for this logic a bit more interesting, and added
some specific tests for logic that is now different.

llvm-svn: 143841
2011-11-05 23:24:30 +00:00
Chad Rosier c2bf338d35 [driver] Don't blindly accept all -g options.
rdar://10383444

llvm-svn: 143732
2011-11-04 19:28:44 +00:00
Bob Wilson d32fba2379 Stop disabling integrated assembler with -static. <rdar://problem/10175391>
The integrated assembler seems to be working pretty well for -static code
now, so remove the hacks to disable it.

llvm-svn: 143304
2011-10-30 00:20:28 +00:00
NAKAMURA Takumi 084e45bc37 test/Driver/debug.c: Mark this as "REQUIRES: shell".
Former RUN line does not make sense on Win32 hosts.
Win32 hosts would not be expected to set appropriate $PWD.

Latter RUN line might be made valid if PathV2::is_absolute("/foo") would be true. Unfortunately, "/foo" should not be treated as absolute path on Win32.

FYI, on mingw32 with MSYS bash (it has 'shell' feature);
Former) $PWD is set as "X:/hogehoge/test/Driver"
Latter) PWD=/foo sets "X:/root/to/msys/foo" to $PWD.

llvm-svn: 142721
2011-10-22 11:28:32 +00:00
Douglas Gregor 3fa37c5be5 XFAIL test on Windows
llvm-svn: 142703
2011-10-21 23:57:02 +00:00
Douglas Gregor c3afe1f8af More speculative test tweaking
llvm-svn: 142701
2011-10-21 23:37:41 +00:00
Douglas Gregor 0a92de06f0 Switch tests from grep to FileCheck
llvm-svn: 142699
2011-10-21 23:20:41 +00:00
Nick Lewycky 197ca87e7e Doug reports that this test is still failing. Try applying Benjamin Kramer's
suggestion!

llvm-svn: 142692
2011-10-21 22:21:24 +00:00
Nick Lewycky 90a47b127b Try to be exceedingly clever and make this test work properly whether it's run
under bash or under cmd.exe.

llvm-svn: 142637
2011-10-21 04:04:49 +00:00
Nick Lewycky 99cc8c01ee Massage this test a little so it works when run inside the Google environment.
llvm-svn: 142635
2011-10-21 03:07:40 +00:00
Nick Lewycky ba743b75cb Take DW_AT_comp_dir from $PWD when it's present and starts with a '/'. This is
closer to what GCC does, except that GCC also checks that the inodes for $PWD
and '.' match.

llvm-svn: 142633
2011-10-21 02:32:14 +00:00
David Blaikie cc5f8f0d9e Switch to the C++11 warning flags in tests.
Patch by Ahmed Charles!

llvm-svn: 142340
2011-10-18 05:54:07 +00:00
Argyrios Kyrtzidis 697729a7de Revert r142311, -mios-simulator-version-min does not work correctly.
llvm-svn: 142322
2011-10-18 00:22:49 +00:00
Argyrios Kyrtzidis 7e16493c9b Remove the hack where we sniff the __IPHONE_OS_VERSION_MIN_REQUIRED define.
We can use -mios-simulator-version-min now. rdar://10218700

llvm-svn: 142311
2011-10-17 23:41:26 +00:00
Bob Wilson 6524dd33be Use Triple.isOSDarwin() instead of comparing against Triple::Darwin.
There are now separate Triple::MacOSX and Triple::IOS values for the OS
so comparing against Triple::Darwin will fail to match those.  Note that
I changed the expected output for the Driver/rewrite-objc.m test, which had
previously not been passing Darwin-specific options with the macosx triple.

llvm-svn: 141944
2011-10-14 05:03:44 +00:00
Richard Smith 172604adb3 Add support for -std=gnu90 and -std=c++03, for compatibility with modern gcc.
llvm-svn: 141922
2011-10-14 00:34:28 +00:00
Richard Smith 60f0263596 Add test for new -std=c++11 and -std=gnu++11 command-line arguments.
llvm-svn: 141891
2011-10-13 21:32:47 +00:00
Douglas Gregor 3d68aa838b The Objective-C rewriter uses the fragile ABI, always.
llvm-svn: 141795
2011-10-12 18:28:53 +00:00
Daniel Dunbar 0f41eee2a0 Driver: Add support for a new -nostdlibinc option.
- This disables the system include directories, but not the compiler builtin
   directories. Useful for projects that want to use things like the intrinsic
   headers, but are otherwise freestanding.

 - I'm willing to reconsider the option naming, I also considered providing an
   explicit -builtinc (which would match -nobuiltininc), but this is more
   consistent with existing options.

llvm-svn: 141692
2011-10-11 18:20:16 +00:00
Chad Rosier 557ee03c8a [driver] Fix test case for Windows due to fallout from r141202+r141205.
llvm-svn: 141322
2011-10-06 22:05:26 +00:00
Chandler Carruth e276b3662b Use the InstalledDir correctly, and test it correctly as well. =/ Should
have noticed this previously, sorry.

llvm-svn: 141167
2011-10-05 06:38:03 +00:00
Chandler Carruth cf59bc5939 Teach Clang to cope with GCC installations that have unusual patch
"versions". Currently, these are just dropped on the floor, A concrete
version number will always win out.

llvm-svn: 141159
2011-10-05 03:09:51 +00:00
Chandler Carruth f7e0ecb65d Implement the feature I was originally driving toward when I started
this saga. Teach the driver to detect a GCC installed along side Clang
using the existing InstalledDir support in the Clang driver. This makes
a lot of Clang's behavior more automatic when it is installed along side
GCC.

Also include the first test cases (more to come, honest) which test both
the install directory behavior, and the version sorting behavior to show
that we're actually searching for the best candidate GCC installation
now.

llvm-svn: 141145
2011-10-05 01:01:57 +00:00
Bob Wilson 8ecdb9b33a Specify -ccc-clang-archs for le32 targets which may not be supported by default.
llvm-svn: 141062
2011-10-04 05:18:19 +00:00
Chandler Carruth adf23a400d Test a multilib setup on a 64-bit host. This is the far more common
configuration, although the test still stubs out more directories than
are necessary or common in order to exercise all of the lookup paths
observed with upstream GCC.

This finishes testing the distribution-independent and
GCC-installation-independent parts of the library path search logic.
More testing is still needed for the triple detection, GCC-installation
detection, and handling distributions with unusual configurations.

llvm-svn: 141000
2011-10-03 09:08:26 +00:00
Chandler Carruth 2356b2c307 Enable generic multilib support on 32bit hosts. Previously this was only
enabled for debian hosts, which is quite odd. I think all restriction on
when Clang attempts to use a multilib installation should go away. Clang
is fundamentally a cross compiler. It behaves more like GCC when built
as a cross compiler, and so it should just use multilib installs when
they are present on the system. However, there is a very specific
exemption for Exherbo, which I can't test on, so I'm leaving that in
place.

With this, check in a generic test tree for multilib on a 32-bit host.
This stubs out many directories that most distributions don't use but
that uptsream GCC supports. This is intended to be an agnostic test that
the driver behaves properly compared with the GCC driver it aims for
compatibility with.

Also, fix a bug in the driver that this testing exposed (see!) where it
was incorrectly testing the target architecture rather than the host
architecture.

If anyone is having trouble with the tree-structure stubs I'm creating
to test this, let me know and I can revisit the design. I chose this
over (for example) a tar-ball in order to make tests run faster at the
small, hopefully amortized VCS cost.

llvm-svn: 140999
2011-10-03 09:00:50 +00:00
Chandler Carruth 35cd702e73 Relax an assertion here a bit. This doesn't really matter, as we won't
include *any* path on crtbegin.o unless we actually find such a file via
one of the search paths. We still strictly check the search paths right
after this, so we'll catch any issues there.

The reason for this is that the driver does some normalization of the
path on the actual object file, and this changes the textual format of
the string on Windows. It no longer matches the textual format of the
sysroot flag.

llvm-svn: 140998
2011-10-03 08:16:09 +00:00
Chandler Carruth 2c5e91e2e5 Test that we include a GCC-triple-prefixed tree. While I don't know of
any distros that use this, building a multilib GCC from mainline will
install linker scripts here.

llvm-svn: 140996
2011-10-03 08:09:02 +00:00
Chandler Carruth 5fdc7cba2a Teach the logic for locating an installed GCC about the system root.
This requires fixing a latent bug -- if we used the default host triple
instead of an autodetected triple to locate GCC's installation, we
didn't go back and fix the GCC triple. Correct that with a pile of
hacks. This entire routine needs a major refactoring which I'm saving
for a subsequent commit. Essentially, the detection of the GCC triple
should be hoisted into the same routine as we locate the GCC
installation: the first is intrinsically tied to the latter. Then the
routine will just return the triple and base directory.

Also start to bring the rest of the library search path logic under
test, including locating crtbegin.o. Still need to test the multilib and
other behaviors, but there are also bugs in the way of that.

llvm-svn: 140995
2011-10-03 08:02:58 +00:00