Commit Graph

2046 Commits

Author SHA1 Message Date
NAKAMURA Takumi d704cb755f clang/test/CodeGen/c11atomics.c: Fix testcase for -Asserts since r186054.
llvm-svn: 186055
2013-07-11 03:45:54 +00:00
Eli Friedman be4504df26 Simplify atomic load/store IRGen.
Also fixes a couple minor bugs along the way; see testcases.

llvm-svn: 186049
2013-07-11 01:32:21 +00:00
Adrian Prantl 7278788ffe Reapply an improved version of r180816/180817.
Do not generate VLAs as complex variables any more, as they are now
correctly represented as breg+0 locations in the backend.

(Paired commit with LLVM: r185966)

rdar://problem/13658587

llvm-svn: 185967
2013-07-09 20:29:03 +00:00
NAKAMURA Takumi 9250b05696 clang/test/CodeGen/2008-01-25-ByValReadNone.c: Add explicit -triple x86_64-unknown-unknown.
It would emit @llvm.memcpy with "-triple x86_64-(mingw32|win32)" and had been failing since Nick's r185735.

  ; Function Attrs: nounwind
  declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1) #1

llvm-svn: 185796
2013-07-08 06:38:51 +00:00
Nick Lewycky 02df2062c6 Update test for change in r185735.
llvm-svn: 185736
2013-07-06 00:30:27 +00:00
Rafael Espindola 925213b0fa Add 'not' to commands that are expected to fail.
This is at least good documentation, but also opens the possibility of
using pipefail.

llvm-svn: 185652
2013-07-04 16:16:58 +00:00
Rafael Espindola 76e202c7b8 Looks like {{.*}} doesn't match the empty string. Fix test.
llvm-svn: 185650
2013-07-04 15:29:20 +00:00
Rafael Espindola 7ac579a3f8 Relax pattern to accept a signext on ppc64.
llvm-svn: 185649
2013-07-04 15:25:05 +00:00
Rafael Espindola be8a91b771 Replace 'grep foo | count 0' with 'not grep foo'.
This avoids depending on pipefail not being used.

llvm-svn: 185648
2013-07-04 15:22:16 +00:00
Rafael Espindola 0cf7c93849 Remove test for the old debug format which was XFAILed since 2009.
llvm-svn: 185647
2013-07-04 15:14:31 +00:00
Rafael Espindola 87627034a1 Add missing expected-warning.
llvm-svn: 185644
2013-07-04 15:04:25 +00:00
Rafael Espindola 550f263dcf Remove unused -verify.
llvm-svn: 185641
2013-07-04 14:51:11 +00:00
Rafael Espindola e703c0194c clang -cc1 has no -fno-unit-at-a-time or -funit-at-a-time. Fix test.
llvm-svn: 185639
2013-07-04 14:42:44 +00:00
Rafael Espindola a5695db67d Use a clang -cc1 option instead of -m32 and remove tcl quotes.
llvm-svn: 185637
2013-07-04 14:36:22 +00:00
Rafael Espindola 1011024e37 Remove tcl quotes.
llvm-svn: 185636
2013-07-04 14:30:41 +00:00
Rafael Espindola 450eb99c89 Convert test to FileCheck.
llvm-svn: 185635
2013-07-04 14:28:33 +00:00
Rafael Espindola 5dac06ff4b Remove old test.
It was trivially passing because of the tcl quotes and we have better datalayout
tests.

llvm-svn: 185630
2013-07-04 14:20:52 +00:00
Rafael Espindola d1d617593b Remove old test.
It was not clear what was being tested and the test was trivially passing
by getting grep confused with tcl quotes.

llvm-svn: 185629
2013-07-04 14:18:32 +00:00
Rafael Espindola 53e40e4b06 Clang has no nested function support. Delete this test.
llvm-svn: 185628
2013-07-04 14:13:53 +00:00
Eli Bendersky 9b64ec18c1 Add target hook CodeGen queries when generating builtin pow*.
Without fmath-errno, Clang currently generates calls to @llvm.pow.* intrinsics
when it sees pow*(). This may not be suitable for all targets (for
example le32/PNaCl), so the attached patch adds a target hook that CodeGen
queries. The target can state its preference for having or not having the
intrinsic generated. Non-PNaCl behavior remains unchanged;
PNaCl-specific test added.

llvm-svn: 185568
2013-07-03 19:19:12 +00:00
Serge Pavlov f432f85777 Test case for PR7887 - failed with asm("")
llvm-svn: 185543
2013-07-03 15:32:48 +00:00
Serge Pavlov b4bbae0703 Fixed test options.
llvm-svn: 185493
2013-07-03 01:43:57 +00:00
Manman Ren 38db092083 Debug Info: set default to gdwarf-2 for Darwin.
Darwin systems currently do not support dwarf version 3 or above. When we are
ready, we can bump the default to gdwarf-4 for Darwin.

For other systems, the default is dwarf version 3, if everything goes smoothly,
we can bump the version to 4.

rdar://13591116

llvm-svn: 185483
2013-07-02 23:15:25 +00:00
Richard Trieu 1466faf8a6 Redirect the output of a test to a temporary file to prevent messing up
the test environment.

llvm-svn: 185470
2013-07-02 20:49:10 +00:00
Serge Pavlov fb73ec834a Fix to PR15826 - clang hits assert in clang::ASTContext::getASTRecordLayout.
llvm-svn: 185446
2013-07-02 17:31:56 +00:00
Michael Gottesman a7b73d4534 Revert "Revert r184787: "Added arm_neon intrinsic tests.""
This reverts commit r184817. The failure Chandler was seeing was most likely the
bug that Bob Wilson fixed in r184870 (which was a bug caught by these tests).

To be safe, I just checked again on x86-64 mac os x/linux that this test passed
(which it did).

llvm-svn: 185110
2013-06-27 21:52:01 +00:00
Eli Friedman 2782dacfbc Rewrite record layout for ms_struct structs.
The old implementation of ms_struct in RecordLayoutBuilder was a
complete mess: it depended on complicated conditionals which didn't
really reflect the underlying logic, and placed a burden on users of
the resulting RecordLayout. This commit rips out almost all of the
old code, and replaces it with simple checks in
RecordLayoutBuilder::LayoutBitField.

This commit also fixes <rdar://problem/14252115>, a bug where class
inheritance would cause us to lay out bitfields incorrectly.

llvm-svn: 185018
2013-06-26 20:50:34 +00:00
Chandler Carruth 3bab90a400 Revert r184787: "Added arm_neon intrinsic tests."
This test doesn't actually pass when run with llvm-lit for me or in
a bot that actually always tries to run it.

llvm-svn: 184817
2013-06-25 02:18:39 +00:00
Michael Gottesman a35103a8cf Added arm_neon intrinsic tests.
This is a large test and thus it will only run if you pass in --param
run_long_tests=trueto LIT. This is intended so that this test can run on
buildbots and not when one runs make check.

llvm-svn: 184787
2013-06-24 21:25:42 +00:00
David Blaikie a24c397ee1 DebugInfo: Merge a bad debug info enum test into a good one
The assembly generation testing has been moved to an LLVM test case.

llvm-svn: 184693
2013-06-24 06:47:30 +00:00
Justin Holewinski bcb9055083 [NVPTX] Fix inline asm test case to use LLVM IR instead of PTX so it works even when the NVPTX target is not built
llvm-svn: 184601
2013-06-21 22:39:56 +00:00
Justin Holewinski 7ceab3a892 [NVPTX] Add NVPTX register constraints
llvm-svn: 184578
2013-06-21 18:51:24 +00:00
David Blaikie 03039fe9ba DebugInfo: handle the DI asm printing change to reword '[fwd]' as '[decl]' and add '[def]' for non-decl tag types
This is to make test cases looking for definitions more legible by
making the definition explicit rather than just the absence of '[fwd]'.
This allowed the debug-info-record tests to be rephrased - and in the
interests of reducing the number of individual test cases/invocations we
have, I merged them into one file, separated them with namespaces (&
then moved them to C++ because namespaces are great). If they need to
remain 'C' only tests, they can be moved back. (I didn't group them with
'debug-info-class.cpp' because these tests only apply to
-fno-limit-debug-info)

I removed the pieces of code that would cause these tests to pass under
-flimit-debug-info to ensure the tests remain relevant to their fixes
should we ever improve -flimit-debug-info to catch that kind of code.

This commit is version locked with the corresponding change to
DebugInfo.h in LLVM. Except some transient buildbot fallout.

llvm-svn: 184524
2013-06-21 03:41:46 +00:00
Michael Gottesman 930ecdb77b [checked-arithmetic builtins] Added builtins to enable users to perform checked-arithmetic in c.
This will enable users in security critical applications to perform
checked-arithmetic in a fast safe manner that is amenable to c.

Tests/an update to Language Extensions is included as well.

rdar://13421498.

llvm-svn: 184497
2013-06-20 23:28:10 +00:00
Adrian Prantl dba725c0be Debug Info: Attempt to resolve forward declarations if we are not emitting
limited debug info.

This is another small addendum to r184252.

rdar://problem/14101097

llvm-svn: 184473
2013-06-20 21:17:24 +00:00
Manman Ren 9691f7fa35 Debug Info: support for gdwarf-2 gdwarf-3 gdwarf-4
These options will add a module flag with name "Dwarf Version".
The behavior flag is currently set to Warning, so when two values disagree,
a warning will be emitted.

llvm-svn: 184276
2013-06-19 01:46:49 +00:00
Adrian Prantl 1f56b2a4f1 Add some comments to r184252.
rdar://problem/14101097

llvm-svn: 184259
2013-06-18 23:32:21 +00:00
Adrian Prantl c1a3fe7f9b Emit forward decls for structs with declarations only when we are
limiting debug info.

FIXME: There is still work left to do here, the testcase should work even with -flimit-debug-info.

rdar://problem/14101097

llvm-svn: 184252
2013-06-18 23:01:56 +00:00
Michael Gottesman 1534399059 [multiprecision-builtins] Added missing builtin __builtin_{add,sub}cb for {add,sub} with carry for bytes.
I have had several people ask me about why this builtin was not available in
clang (since it seems like a logical conclusion). This patch implements said
builtins.

Relevant tests are included as well. I also updated the Clang language extension reference.

rdar://14192664.

llvm-svn: 184227
2013-06-18 20:40:40 +00:00
John McCall 1fe2a8c87e Add support for -fpcc-struct-return. Patch by Arthur O'Dwyer!
llvm-svn: 184166
2013-06-18 02:46:29 +00:00
Adrian Prantl de5fde0b05 Remove an ugly hack that was meant to eliminate the breakpoint ambiguity
between a block assignment and the entry of the block function. In reality
this wouldn't work anyway because blocks are predominantly created
on-the-fly inside of an ObjC method invocation.
The proper fix for the ambiguity is to use -gcolumn-info to differentiate
the breakpoints.

This is expected to break some block-related darwin-gdb tests.

rdar://problem/14039866

llvm-svn: 184157
2013-06-18 00:27:36 +00:00
Rafael Espindola 3d4276e3cf Use atomic instructions on Bitrig armv6. Patch by Patrick Wildt.
llvm-svn: 184113
2013-06-17 20:00:15 +00:00
Manman Ren 9bb34d66b3 X86 intrinsics: cmpge|gt|nge|ngt_ss|_sd
These intrinsics should return the comparision result in the low bits and keep 
the high bits of the first source operand.

When calling to builtin functions, the source operands are swapped and the high
bits of the second source operand are kept. To fix the issue, an extra
shufflevector is used.

rdar://14153896

llvm-svn: 184110
2013-06-17 19:42:49 +00:00
Serge Pavlov f7c1a2152a Clean up empty struct/union recognition.
Make use of getTypeSizeInChars to detect structs/unions of zero size. It allows
more accurate detection of types of zero size. It however has a side effect -
sequence of used types may change, that is why the test 'override-layout' was
modified.

llvm-svn: 184088
2013-06-17 17:18:51 +00:00
Ed Schouten 60afa2d923 Emit native implementations of atomic operations on FreeBSD/armv6.
Just like on Linux, FreeBSD/armv6 assumes the system supports
ldrex/strex unconditionally. It is also used by the kernel. We can
therefore enable support for it, like we do on Linux.

While there, change one of the unit tests to explicitly test against
armv5 instead of armv7, as it actually tests whether libcalls are
emitted.

llvm-svn: 184040
2013-06-15 09:40:14 +00:00
Eli Friedman c68dbeffe3 Fix buildbot breakage on PPC64.
llvm-svn: 183847
2013-06-12 17:31:32 +00:00
Eli Friedman f045007f11 Add support for complex compound assignments where the LHS is a scalar.
Fixes <rdar://problem/11224126> and PR12790.

llvm-svn: 183821
2013-06-12 01:40:06 +00:00
Eli Friedman 96fd264cc0 Make va_arg and argument passing to varargs functions work correctly with
AVX vectors when AVX is turned on.

Fixes <rdar://problem/10513611>.

llvm-svn: 183813
2013-06-12 00:13:45 +00:00
Eli Friedman 1f16b743d9 Correctly handle designated initializers which modify an array initialized
with a string.  This case is sort of tricky because we can't modify the
StringLiteral used to represent such initializers.
We are forced to decompose the string into individual characters.

Fixes <rdar://problem/10465114>.

llvm-svn: 183791
2013-06-11 21:48:11 +00:00
Eli Friedman 2761350730 Fix a very silly mistake in r183590.
llvm-svn: 183720
2013-06-11 01:59:28 +00:00