Douglas Gregor
35696d1a88
Try harder to get X7 defined
...
llvm-svn: 149072
2012-01-26 18:38:13 +00:00
Douglas Gregor
e6e5406122
Force layout of more of the unions and structures in this test
...
llvm-svn: 149066
2012-01-26 17:23:00 +00:00
Chandler Carruth
d0a41fead3
Suppress any warnings from this test. They aren't interesting, and they
...
end up in the same output file as the layout stuff. There may even be
a race condition which is causing this output to confuse the FileCheck
in some cases. I actually don't know how on earth the parsing of the
layout file even works given that there are diagnostics in the middle of
it. ;]
llvm-svn: 149058
2012-01-26 09:28:50 +00:00
Douglas Gregor
e9fc377a44
Extend the ExternalASTSource interface to allow the AST source to
...
provide the layout of records, rather than letting Clang compute
the layout itself. LLDB provides the motivation for this feature:
because various layout-altering attributes (packed, aligned, etc.)
don't get reliably get placed into DWARF, the record layouts computed
by LLDB from the reconstructed records differ from the actual layouts,
and badness occurs. This interface lets the DWARF data drive layout,
so we don't need the attributes preserved to get the answer write.
The testing methodology for this change is fun. I've introduced a
variant of -fdump-record-layouts called -fdump-record-layouts-simple
that always has the simple C format and provides size/alignment/field
offsets. There is also a -cc1 option -foverride-record-layout=<file>
to take the output of -fdump-record-layouts-simple and parse it to
produce a set of overridden layouts, which is introduced into the AST
via a testing-only ExternalASTSource (called
LayoutOverrideSource). Each test contains a number of records to lay
out, which use various layout-changing attributes, and then dumps the
layouts. We then run the test again, using the preprocessor to
eliminate the layout-changing attributes entirely (which would give us
different layouts for the records), but supplying the
previously-computed record layouts. Finally, we diff the layouts
produced from the two runs to be sure that they are identical.
Note that this code makes the assumption that we don't *have* to
provide the offsets of bases or virtual bases to get the layout right,
because the alignment attributes don't affect it. I believe this
assumption holds, but if it does not, we can extend
LayoutOverrideSource to also provide base offset information.
Fixes the Clang side of <rdar://problem/10169539>.
llvm-svn: 149055
2012-01-26 07:55:45 +00:00
Eli Friedman
a98d1f8ca6
Add some ABI tweaks for i386-pc-win32 triple so that we return structs in an MSVC-compatible way. Patch by Joe Groff.
...
llvm-svn: 148992
2012-01-25 22:46:34 +00:00
NAKAMURA Takumi
509b7af017
test/CodeGen/avx-builtins.c: Fix more for -Asserts.
...
llvm-svn: 148944
2012-01-25 09:11:21 +00:00
Craig Topper
80df922f2f
Re-enable test that was broken by r148919
...
llvm-svn: 148932
2012-01-25 06:23:23 +00:00
Chris Lattner
f07b612313
disable this test for now.
...
llvm-svn: 148928
2012-01-25 05:38:06 +00:00
Chris Lattner
29969cd86a
fix broken testcase.
...
llvm-svn: 148925
2012-01-25 05:29:46 +00:00
Craig Topper
9e9301a83a
Represent 256-bit unaligned loads natively and remove the builtins. Similar change was made for 128-bit versions a while back.
...
llvm-svn: 148919
2012-01-25 04:26:17 +00:00
Kostya Serebryany
588d6abf7d
The following patch adds __attribute__((no_address_safety_analysis)) which will allow to disable
...
address safety analysis (such as e.g. AddressSanitizer or SAFECode) for a specific function.
When building with AddressSanitizer, add AddressSafety function attribute to every generated function
except for those that have __attribute__((no_address_safety_analysis)).
With this patch we will be able to
1. disable AddressSanitizer for a particular function
2. disable AddressSanitizer-hostile optimizations (such as some cases of load widening) when AddressSanitizer is on.
llvm-svn: 148842
2012-01-24 19:25:38 +00:00
Seth Cantrell
a7956f92df
add tests for wide character encodings
...
and fix typo
llvm-svn: 148603
2012-01-21 00:16:11 +00:00
Sebastian Pop
422377cfd3
rename -ccc-host-triple into -target
...
llvm-svn: 148582
2012-01-20 22:01:23 +00:00
Seth Cantrell
6255c257e9
Add and update tests for character literals
...
llvm-svn: 148392
2012-01-18 12:27:10 +00:00
Nick Lewycky
e2367d2508
Add testcase for r148375!
...
llvm-svn: 148378
2012-01-18 04:28:31 +00:00
Tanya Lattner
81ce08c983
Add new line.
...
llvm-svn: 148255
2012-01-16 21:15:33 +00:00
Tanya Lattner
20248226a9
Add support for OpenCL 1.1 logical operations.
...
llvm-svn: 148254
2012-01-16 21:02:28 +00:00
David Chisnall
fa35df628a
Some improvements to the handling of C11 atomic types:
...
- Add atomic-to/from-nonatomic cast types
- Emit atomic operations for arithmetic on atomic types
- Emit non-atomic stores for initialisation of atomic types, but atomic stores and loads for every other store / load
- Add a __atomic_init() intrinsic which does a non-atomic store to an _Atomic() type. This is needed for the corresponding C11 stdatomic.h function.
- Enables the relevant __has_feature() checks. The feature isn't 100% complete yet, but it's done enough that we want people testing it.
Still to do:
- Make the arithmetic operations on atomic types (e.g. Atomic(int) foo = 1; foo++;) use the correct LLVM intrinsic if one exists, not a loop with a cmpxchg.
- Add a signal fence builtin
- Properly set the fenv state in atomic operations on floating point values
- Correctly handle things like _Atomic(_Complex double) which are too large for an atomic cmpxchg on some platforms (this requires working out what 'correctly' means in this context)
- Fix the many remaining corner cases
llvm-svn: 148242
2012-01-16 17:27:18 +00:00
Richard Smith
dafff94759
constexpr irgen: Add irgen support for APValue::Struct, APValue::Union,
...
APValue::Array and APValue::MemberPointer. All APValue values can now be emitted
as constants.
Add new CGCXXABI entry point for emitting an APValue MemberPointer. The other
entrypoints dealing with constant member pointers are no longer necessary and
will be removed in a later change.
Switch codegen from using EvaluateAsRValue/EvaluateAsLValue to
VarDecl::evaluateValue. This performs caching and deals with the nasty cases in
C++11 where a non-const object's initializer can refer indirectly to
previously-initialized fields within the same object.
Building the intermediate APValue object incurs a measurable performance hit on
pathological testcases with huge initializer lists, so we continue to build IR
directly from the Expr nodes for array and record types outside of C++11.
llvm-svn: 148178
2012-01-14 04:30:29 +00:00
Eli Friedman
d749c6bf2e
Revert r148138; it's causing test failures.
...
llvm-svn: 148141
2012-01-13 21:33:06 +00:00
Sebastian Pop
9a8d528ddf
rename -ccc-host-triple into -target
...
llvm-svn: 148138
2012-01-13 20:37:02 +00:00
Akira Hatanaka
acf9896ca1
Fix test case committed in r147986.
...
llvm-svn: 147993
2012-01-12 01:27:24 +00:00
Akira Hatanaka
32604a9708
Take into account the pointer to an aggregate that is passed as a hidden
...
argument when Offset is initialized.
llvm-svn: 147986
2012-01-12 01:10:09 +00:00
NAKAMURA Takumi
68a75e879d
clang/test/CodeGen/vla-4.c: Relax expression for -Asserts.
...
llvm-svn: 147934
2012-01-11 08:34:52 +00:00
Abramo Bagnara
fa95ed4074
Fixed VLA code generation.
...
llvm-svn: 147933
2012-01-11 08:19:46 +00:00
Akira Hatanaka
428f5b2008
Add field IsIEEE in FloatingLiteral to distinguish between different 128-bit
...
floating point formats.
llvm-svn: 147887
2012-01-10 22:40:09 +00:00
Bill Wendling
86131f2c8d
The `-fwritable-strings' flag doesn't make the backing store strings of all
...
CFStrings writable.
The strings (both Unicode and ASCII) should reside in a read-only section. E.g.,
__TEXT,__cstring instead of __DATA,__data. This is done by making the global
variable created for the strings constant despite the value of that flag.
<rdar://problem/10657500>
llvm-svn: 147845
2012-01-10 08:46:39 +00:00
Akira Hatanaka
1632af603d
Insert padding before unaligned long double arguments.
...
llvm-svn: 147791
2012-01-09 19:31:25 +00:00
Abramo Bagnara
1cd8368eb2
Fixed TypeofExpr AST and code generation.
...
llvm-svn: 147730
2012-01-07 10:52:36 +00:00
Akira Hatanaka
f64e1adcbb
Add field PaddingType to ABIArgInfo which specifies the type of padding that
...
is inserted before the real argument. Padding is needed to ensure the backend
reads from or writes to the correct argument slots when the original alignment
of a byval structure is unavailable due to flattening.
llvm-svn: 147699
2012-01-07 00:25:33 +00:00
Eli Friedman
df88c54f8d
Revert r147655; it's breaking the compiler_rt build on OSX.
...
llvm-svn: 147677
2012-01-06 20:03:09 +00:00
David Chisnall
9217435a33
If we are compiling with -fno-builtin then don't do constant folding of
...
builtins.
This fixes PR11711.
llvm-svn: 147655
2012-01-06 12:20:19 +00:00
Chris Lattner
3ad9042456
fix test on -Asserts builds.
...
llvm-svn: 147558
2012-01-04 22:51:21 +00:00
Chris Lattner
36bc4f41bc
implement rdar://10639962 by keeping track of increased alignment
...
information even in subscripting operations.
llvm-svn: 147557
2012-01-04 22:35:55 +00:00
Craig Topper
b4ceb6fd52
Add FMA4 intrinsics.
...
llvm-svn: 147372
2011-12-30 09:15:03 +00:00
Craig Topper
1de8348db7
Add popcnt feature flag to match gcc. This flag is implied when sse42 is enabled, but can be disabled separately. Move popcnt intrinsics to popcntintrin.h to match gcc.
...
llvm-svn: 147340
2011-12-29 16:10:46 +00:00
Craig Topper
c334dd68a7
Add BMI2 intrinsics.
...
llvm-svn: 147275
2011-12-26 02:31:10 +00:00
Craig Topper
03348d09e3
Change LZCNT and BMI tests to check IR instead of X86 assembly.
...
llvm-svn: 147267
2011-12-25 15:20:31 +00:00
Craig Topper
a06d4a1c40
Add the rest of the BMI intrinsics.
...
llvm-svn: 147265
2011-12-25 07:27:12 +00:00
Craig Topper
f2855ade2b
Add intrinsics for lzcnt and tzcnt instructions.
...
llvm-svn: 147263
2011-12-25 06:25:37 +00:00
Craig Topper
175543ac78
Add last of the AVX2 intrinsics except for gather.
...
llvm-svn: 147253
2011-12-24 17:20:15 +00:00
Craig Topper
a9387739aa
Add AVX2 permute intrinsics. Also add parentheses on some macro arguments in other intrinsic headers.
...
llvm-svn: 147242
2011-12-24 07:55:25 +00:00
Craig Topper
9a01e58447
Add AVX2 intrinsics for FP vbroadcast, vbroadcasti128, and vpblendd.
...
llvm-svn: 147240
2011-12-24 05:19:47 +00:00
Craig Topper
a6fdbd1807
Intrinsics for AVX2 unpack instructions.
...
llvm-svn: 147237
2011-12-24 03:58:43 +00:00
Craig Topper
f4bb952533
More AVX2 intrinsics for shift, psign, some shuffles, and psadbw.
...
llvm-svn: 147236
2011-12-24 03:28:57 +00:00
Craig Topper
235a365d58
Add AVX2 multiply intrinsics.
...
llvm-svn: 147219
2011-12-23 08:31:16 +00:00
Craig Topper
1f2460ad43
Add AVX2 intrinsics for max, min, sign extend, and zero extend.
...
llvm-svn: 147141
2011-12-22 09:18:58 +00:00
Eli Friedman
803acb3ff2
Add support for bitcasts to vector type in Evaluate.
...
llvm-svn: 147137
2011-12-22 03:51:45 +00:00
Eli Friedman
1148b0f13c
Fix a silly mistake in this test that somehow slipped into my last commit.
...
llvm-svn: 147112
2011-12-22 00:06:39 +00:00
Eli Friedman
5c9cd7a8a3
Fix a failure (which led to a crash) in constant emission code with vector compound literals.
...
llvm-svn: 147111
2011-12-22 00:04:00 +00:00
Craig Topper
a73baa8050
Add a few more AVX2 intrinsics and fix the type strings on a couple SSE intrinsics.
...
llvm-svn: 147048
2011-12-21 08:35:05 +00:00
Craig Topper
3fe5ac40db
Add AVX2 horizontal add/sub intrinsics.
...
llvm-svn: 147047
2011-12-21 08:17:40 +00:00
Craig Topper
a89747dd1e
Add AVX2 intrinsics for pavg, pblend, and pcmp instructions. Also remove unneeded builtins for SSE pcmp. Change SSE pcmpeqq and pcmpgtq to not use builtins and just use vector == and >.
...
llvm-svn: 146969
2011-12-20 09:55:26 +00:00
Chris Lattner
4db839a8d4
loads also handled of course.
...
llvm-svn: 146910
2011-12-19 21:17:33 +00:00
Chris Lattner
2415357a05
Fix PR5279 - don't sliently drop alignment information on stores of types that have alignment less than the natural alignment of the type when it comes from a typedef.
...
llvm-svn: 146908
2011-12-19 21:16:08 +00:00
Chris Lattner
494f431097
filecheckize.
...
llvm-svn: 146907
2011-12-19 21:11:59 +00:00
Chris Lattner
7e588a8db0
rename test.
...
llvm-svn: 146906
2011-12-19 21:10:59 +00:00
Eli Friedman
61221b72ee
Attempt to fix test in Release builds.
...
llvm-svn: 146898
2011-12-19 20:09:01 +00:00
Rafael Espindola
ba9cc6c1bb
Add a triple to the test.
...
llvm-svn: 146871
2011-12-19 16:30:30 +00:00
Rafael Espindola
4fdc1759ca
Extend the fix for PR9614 to handle inline asm in the outer decl and
...
the inner decl being a builtin. This is needed to support the glibc headers
in fedora 16 (2.14).
llvm-svn: 146867
2011-12-19 14:41:01 +00:00
Craig Topper
a557e1c122
Add AVX2 intrinsics for and, andn, or, and xor.
...
llvm-svn: 146862
2011-12-19 09:03:48 +00:00
Craig Topper
94aba2c260
More AVX2 intrinsic support including saturating add/sub and palignr.
...
llvm-svn: 146857
2011-12-19 07:03:25 +00:00
Craig Topper
dec792ebb5
Begin adding AVX2 intrinsics. Necessitated increasing the number of bits used to store builtinID when serializing identifier table.
...
llvm-svn: 146855
2011-12-19 05:04:33 +00:00
Chad Rosier
060d03be1c
Fix _mm256_round_pd, _mm256_round_ps, _mm_permute_pd and _mm256_permute_pd AVX
...
intrinsics to use "I" (ICE) markings. Fix avxintrin.h to take them into
account.
Part of rdar://10595450
llvm-svn: 146791
2011-12-17 00:15:26 +00:00
Eli Friedman
516c2ad731
Fix an edge case in IRGen for conditionals. PR11509.
...
llvm-svn: 146189
2011-12-08 22:01:56 +00:00
Richard Smith
161f09abd7
Move vector bitcast handling in constant expressions from the expression
...
evaluator into constant initializer handling / IRGen. The practical consequence
of this is that the bitcast now lives in the constant's definition, rather than
in its uses.
The code in the constant expression evaluator was producing vectors of the wrong
type and size (and possibly of the wrong value for a big-endian int-to-vector
bitcast). We were getting away with this only because we don't yet support
constant-folding of any expressions which inspect vector values.
llvm-svn: 145981
2011-12-06 22:44:34 +00:00
Eli Friedman
6d694a38fd
Make EmitAggregateCopy take an alignment argument. Make EmitFinalDestCopy pass in the correct alignment when known.
...
The test includes a FIXME for a related case involving calls; it's a bit more complicated to fix because the RValue class doesn't keep track of alignment.
<rdar://problem/10463337>
llvm-svn: 145862
2011-12-05 22:23:28 +00:00
Eric Christopher
af6431077c
Add support for AVX registers to clang inline asm. Add a small testcase
...
and update the Sema testcase with a register that we won't hit for a while
I hope.
Fixes rdar://10510405
llvm-svn: 145671
2011-12-02 02:12:16 +00:00
Eric Christopher
5037249cc3
Clean up some oddly gratuitous vertical whitespace.
...
llvm-svn: 145670
2011-12-02 02:12:12 +00:00
Eric Christopher
86e6c07a0c
Rename function.
...
llvm-svn: 145669
2011-12-02 02:12:09 +00:00
Eli Friedman
bfd5addf4c
When we're passing a vector with an illegal type through memory on x86-64, use byval so we're sure the backend does the right thing. Fixes va_arg with illegal vectors and an obscure ABI mismatch with __m64 vectors.
...
llvm-svn: 145652
2011-12-02 00:11:43 +00:00
Eli Friedman
f37bd2f2f1
Don't use a varargs convention for calls unprototyped functions where one of the arguments is an AVX vector.
...
llvm-svn: 145574
2011-12-01 04:53:19 +00:00
Tanya Lattner
71f1b2dcd4
Correct the code generation for function arguments of vec3 types on x86_64 when they are greater than 128 bits. This was incorrectly coercing things like long3 into a double2.
...
Add test case.
llvm-svn: 145312
2011-11-28 23:18:11 +00:00
Benjamin Kramer
ddbb2b85ab
CodeGen: allow __asm renaming on static local variables.
...
Fixes PR4777.
llvm-svn: 145015
2011-11-20 21:05:04 +00:00
Eli Friedman
f22fa9eaef
Finish r144971, which was an incomplete commit.
...
llvm-svn: 144972
2011-11-18 04:01:36 +00:00
Eli Friedman
0b3f201b61
Fix the meaning of an "empty" record for the case of a zero-length array. Use isEmptyRecord for arguments on x86-32; there are structs of size 0 which don't count as empty.
...
llvm-svn: 144971
2011-11-18 03:47:20 +00:00
Eli Friedman
a1748564b4
Make va_arg on x86-64 compute alignment the same way as argument passing.
...
Fixes <rdar://problem/10463281>.
llvm-svn: 144966
2011-11-18 02:44:19 +00:00
Eli Friedman
1d7dd3b682
A bunch of fixes to argument passing and va_arg on Darwin x86-32 for structures containing an SSE vector.
...
llvm-svn: 144963
2011-11-18 02:12:09 +00:00
Eli Friedman
e5c85622c9
Don't try to expand struct arguments containing holes on x86-32. From gcc struct layout tests.
...
llvm-svn: 144961
2011-11-18 01:32:26 +00:00
Eli Friedman
ee94534662
Simplify code for returning a struct for Darwin x86-32 ABI. Use a better type for a function returning a struct containing only a pointer. Handle the edge case of a struct containing only a float or double plus some dead padding instead of asserting.
...
llvm-svn: 144960
2011-11-18 01:25:50 +00:00
Eli Friedman
9f061a37bb
Ignore empty unions in argument lowering on x86-32. From gcc struct layout tests.
...
llvm-svn: 144944
2011-11-18 00:28:11 +00:00
Richard Smith
027bf11eb3
Constant expression evaluation: add support for evaluation of member pointers
...
and base-to-derived casts, and add proper handling of temporaries.
llvm-svn: 144926
2011-11-17 22:56:20 +00:00
Eli Friedman
95ff70021c
Fix crash in calling convention code expanding an struct with a complex member.
...
llvm-svn: 144612
2011-11-15 02:46:03 +00:00
Nico Weber
d60b72f696
Fix a regression in wide character codegen. See PR11369.
...
llvm-svn: 144521
2011-11-14 05:17:37 +00:00
Eli Friedman
ce6733a542
Fix test so that it XFAILs consistently.
...
llvm-svn: 143771
2011-11-05 00:49:47 +00:00
Devang Patel
45124500bb
Add new test.
...
llvm-svn: 143706
2011-11-04 17:12:03 +00:00
Devang Patel
f1faeefb32
Add new test.
...
llvm-svn: 143704
2011-11-04 16:57:26 +00:00
Eli Friedman
3d9f47fe6f
Fix alignment on alloca's for parameters using ABIArgInfo::Expand.
...
llvm-svn: 143658
2011-11-03 21:39:02 +00:00
Eli Friedman
eadd3e81a0
Fix the alignment on scalar parameter variables so that it matches what the AST thinks it should be. Per report on cfe-dev.
...
llvm-svn: 143645
2011-11-03 20:31:28 +00:00
Bob Wilson
1d9269a8d6
Check for homogeneous aggregate return values with ARM's AAPCS-VFP ABI.
...
llvm-svn: 143530
2011-11-02 04:51:36 +00:00
Eli Friedman
86fe42d184
Correct test for additional comment line.
...
llvm-svn: 143436
2011-11-01 04:46:08 +00:00
Eli Friedman
e1f2ce8fd3
Mark test as requiring x86 backend.
...
llvm-svn: 143427
2011-11-01 03:48:36 +00:00
Eli Friedman
97ed64081d
Don't depend on system includes in test.
...
llvm-svn: 143426
2011-11-01 03:35:57 +00:00
Eli Friedman
fc08bdcc57
Tests for UTF-8 encoding in strings in source code. Patch by Seth Cantrell.
...
llvm-svn: 143418
2011-11-01 02:26:36 +00:00
Eli Friedman
fcec630a57
Fix the representation of wide strings in the AST and IR so that it uses the native representation of integers for the elements. This fixes a bunch of nastiness involving
...
treating wide strings as a series of bytes.
Patch by Seth Cantrell.
llvm-svn: 143417
2011-11-01 02:23:42 +00:00
Peter Collingbourne
f1d76db466
Add support for lazily linking bitcode files (using a new
...
-mlink-bitcode-file flag), and more generally llvm::Modules, before
running optimisations.
llvm-svn: 143314
2011-10-30 17:30:44 +00:00
Rafael Espindola
77a4538c6c
Fix this on the bots and make the test more complete by enabling optimizations.
...
llvm-svn: 143223
2011-10-28 20:52:18 +00:00
Rafael Espindola
fffc1ce1d7
Fix PR9614 for functions with the always_inline attribute. Try to keep
...
the common case (-O0, no always_inline) fast.
llvm-svn: 143222
2011-10-28 20:43:56 +00:00
Nick Lewycky
b25abd1a54
Move these test from checking assembly to checking LLVM IR. Should fix fallout
...
from r143097.
llvm-svn: 143098
2011-10-27 07:11:43 +00:00
Rafael Espindola
be069cb3d0
Fix this tests on the bots.
...
llvm-svn: 143052
2011-10-26 20:46:27 +00:00
Rafael Espindola
c594135b68
Fix pr9614 by not emitting an available_externally function when it calls
...
itself via an asm label.
available_externally functions are supposed to correspond to an external
function, and that is not the case in the examples in pr9614.
llvm-svn: 143049
2011-10-26 20:41:06 +00:00
Dan Gohman
50c756b76f
Remove another Blackfin test.
...
llvm-svn: 142894
2011-10-25 01:02:36 +00:00
Dan Gohman
c44b95c3b5
Remove more SystemZ (s390) tests.
...
llvm-svn: 142883
2011-10-25 00:15:21 +00:00
Eric Christopher
4b4beb2fe7
Fix PR11073 by adding the argument type information to the decl we construct
...
for the function type. Update a testcase accordingly.
Patch initially by Anders Waldenborg!
llvm-svn: 142700
2011-10-21 23:30:10 +00:00
Douglas Gregor
0a92de06f0
Switch tests from grep to FileCheck
...
llvm-svn: 142699
2011-10-21 23:20:41 +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
Eli Friedman
cc66a2b067
Add missing newline.
...
llvm-svn: 142285
2011-10-17 21:48:31 +00:00
Eli Friedman
a4c2602b71
Initial implementation of __atomic_is_lock_free. The input is the size of an atomic type rather than an atomic type itself just to save some implementation pain; I can change that if it seems worthwhile.
...
I think this is the last hook needed for <atomic> besides defines for ATOMIC_CHAR_LOCK_FREE and friends.
llvm-svn: 142281
2011-10-17 21:44:23 +00:00
Tanya Lattner
49b3841398
The comparison of two vectors should return a signed result. hasIntegerRepresentation() used to always return false for vectors, but since it was changed, it also
...
changed the return type of a compare of two unsigned vectors to be unsigned. This patch removes the check for hasIntegerRepresentation since its not needed and returns the appropriate signed type.
I added a new test case and updated exisiting test cases that assumed an unsigned result.
llvm-svn: 142250
2011-10-17 21:00:38 +00:00
Anton Korobeynikov
f82017f3fe
Missed tests for half FP support
...
llvm-svn: 142017
2011-10-14 23:32:50 +00:00
Eli Friedman
4b72fddd99
Misc fixes for atomics. Biggest fix is doing alignment correctly for _Atomic types.
...
llvm-svn: 142002
2011-10-14 20:59:01 +00:00
Benjamin Kramer
73eb8c7a8e
Harden test for windows paths.
...
llvm-svn: 141973
2011-10-14 19:03:46 +00:00
Richard Smith
9ca5c42582
Update all tests other than Driver/std.cpp to use -std=c++11 rather than
...
-std=c++0x. Patch by Ahmed Charles!
llvm-svn: 141900
2011-10-13 22:29:44 +00:00
Eric Christopher
7cdf948601
Recommit:
...
Start handling debug line and scope information better:
Migrate most of the location setting within the larger API in CGDebugInfo and
update a lot of callers.
Remove the existing file/scope change machinery in UpdateLineDirectiveRegion
and replace it with DILexicalBlockFile usage.
Finishes off the rest of rdar://10246360
after fixing a few bugs that were exposed in gdb testsuite testing.
llvm-svn: 141893
2011-10-13 21:45:18 +00:00
Rafael Espindola
2d21ab024e
Add returns_twice to functions that are known to return twice. This implements
...
the same behavior of gcc by keeping the attribute out of the function type.
llvm-svn: 141803
2011-10-12 19:51:18 +00:00
Eric Christopher
93663b3c62
Revert file/scope handling patches. gdb testing revealed a couple of bugs.
...
llvm-svn: 141796
2011-10-12 18:39:35 +00:00
Eric Christopher
498b7fd7fe
Start handling debug line and scope information better:
...
Migrate most of the location setting within the larger API in CGDebugInfo and
update a lot of callers.
Remove the existing file/scope change machinery in UpdateLineDirectiveRegion
and replace it with DILexicalBlockFile usage.
Finishes off the rest of rdar://10246360
llvm-svn: 141732
2011-10-11 23:00:55 +00:00
Eli Friedman
94ab9308d7
PR11062: Make C99 inlining work properly for names with associated builtin libcalls.
...
llvm-svn: 141723
2011-10-11 22:09:24 +00:00
Eli Friedman
df14b3a837
Initial implementation of __atomic_* (everything except __atomic_is_lock_free).
...
llvm-svn: 141632
2011-10-11 02:20:01 +00:00
Lang Hames
83d9f01c7f
Added natural stack alignment to target-data.c test case.
...
llvm-svn: 141622
2011-10-11 01:06:28 +00:00
Rafael Espindola
70107f989c
Propagate __attribute__((returns_twice)) from C to IL.
...
llvm-svn: 141002
2011-10-03 14:59:42 +00:00
John McCall
9cb88ec8d1
I had meant to locally revert this test.
...
llvm-svn: 140243
2011-09-21 08:34:49 +00:00
John McCall
cbc038a6c3
ANSI C requires that a call to an unprototyped function type succeed
...
if the definition has a non-variadic prototype with compatible
parameters. Therefore, the default rule for such calls must be to
use a non-variadic convention. Achieve this by casting the callee to
the function type with which it is required to be compatible, unless
the target specifically opts out and insists that unprototyped calls
should use the variadic rules. The only case of that I'm aware of is
the x86-64 convention, which passes arguments the same way in both
cases but also sets a small amount of extra information; here we seek
to maintain compatibility with GCC, which does set this when calling
an unprototyped function.
Addresses PR10810 and PR10713.
llvm-svn: 140241
2011-09-21 08:08:30 +00:00
Eli Friedman
6b9c41ea68
Add list initialization for complex numbers in C. Essentially, this allows "_Complex float x = {1.0f, 2.0f};". See changes to docs/LanguageExtensions.html for a longer description.
...
<rdar://problem/9397672>.
llvm-svn: 140090
2011-09-19 23:17:44 +00:00
Bill Wendling
f0724e8e06
Throw the switch to convert clang to the new exception handling model!
...
This model uses the 'landingpad' instruction, which is pinned to the top of the
landing pad. (A landing pad is defined as the destination of the unwind branch
of an invoke instruction.) All of the information needed to generate the correct
exception handling metadata during code generation is encoded into the
landingpad instruction.
The new 'resume' instruction takes the place of the llvm.eh.resume intrinsic
call. It's lowered in much the same way as the intrinsic is.
llvm-svn: 140049
2011-09-19 20:31:14 +00:00
NAKAMURA Takumi
3f62af76b9
test/CodeGen/sse-builtins.c: Make this host-independent to unbreak posix-unlike hosts.
...
Without -ffreestanding, clang tries to seek /usr/include/stdlib.h in host filesystem, even on Windows hosts.
llvm-svn: 139899
2011-09-16 03:55:36 +00:00
Eli Friedman
9bb51adcce
Tweak *mmintrin.h so that they don't make any bad assumptions about alignment (which probably has little effect in practice, but better to get it right). Make the load in _mm_loadh_pi and _mm_loadl_pi a single LLVM IR instruction to make optimizing easier for CodeGen.
...
rdar://10054986
llvm-svn: 139874
2011-09-15 23:15:27 +00:00
Eli Friedman
84d2812111
Re-commit r139643.
...
Make clang use Acquire loads and Release stores where necessary.
llvm-svn: 139650
2011-09-13 22:21:56 +00:00
Eli Friedman
acca089617
Revert r139643 while I look into it; it's breaking selfhost.
...
llvm-svn: 139648
2011-09-13 22:08:16 +00:00
Eli Friedman
f92b2e0714
Make clang use Acquire loads and Release stores where necessary.
...
llvm-svn: 139643
2011-09-13 21:31:32 +00:00
Julien Lerouge
d25ed06c63
Make this test portable on Win32.
...
llvm-svn: 139464
2011-09-10 05:46:15 +00:00
John McCall
5dc5c1ea47
Missed a %local use; hopefully this clears this test up.
...
llvm-svn: 139462
2011-09-10 05:31:57 +00:00
Eli Friedman
5c917278fd
clang part of r139458; un-XFAIL testcase.
...
llvm-svn: 139460
2011-09-10 02:03:28 +00:00
Richard Trieu
c41773ab6a
Revision 139454 fixed a broken assert in LLVM, which causes
...
a test failure in CodeGen/palignr.c, which has been marked
XFAIL for the time being. A bug has been filed at PR10901
for this issue.
llvm-svn: 139457
2011-09-10 01:56:32 +00:00
John McCall
e5e7e6bc84
Make this test not depend on unnecessary details and IR variable names.
...
llvm-svn: 139455
2011-09-10 01:37:23 +00:00
Julien Lerouge
5a6b6987dc
Bring llvm.annotation* intrinsics support back to where it was in llvm-gcc: can
...
annotate global, local variables, struct fields, or arbitrary statements (using
the __builtin_annotation), rdar://8037476.
llvm-svn: 139423
2011-09-09 22:41:49 +00:00
Eric Christopher
65c5c9132f
Carry the debug information from single exit unified return block
...
along with the new insert point.
Fixes PR10829
llvm-svn: 139416
2011-09-09 21:53:04 +00:00
John McCall
7959fee258
Treat the weak export of block runtime symbols as a deployment-target
...
feature akin to the ARC runtime checks. Removes a terrible hack where
IR gen needed to find the declarations of those symbols in the translation
unit.
llvm-svn: 139404
2011-09-09 20:41:01 +00:00
Jakob Stoklund Olesen
ed2a360fd1
The frexp, modf, and remquo builtins are not 'const'.
...
These functions return a second value by writing to a pointer argument,
so they cannot be marked 'readnone' which implies that they don't access
memory.
<rdar://problem/10070234>
llvm-svn: 139319
2011-09-08 21:18:03 +00:00
Eli Friedman
ce3e2c85b1
Make sure the FunctionDecl's created by "#pragma weak" have correct ParmVarDecl's. PR10878.
...
llvm-svn: 139224
2011-09-07 04:05:06 +00:00
Eli Friedman
e9f8113ec4
Switch clang over to using fence/atomicrmw/cmpxchg instead of the intrinsics (which will go away). LLVM CodeGen does almost exactly the same thing with these and the old intrinsics, so I'm reasonably confident this will not break anything.
...
There are still a few issues which need to be resolved with code generation for atomic load and store, so I'm not converting the places which need those for now.
I'm not entirely sure what to do about __builtin_llvm_memory_barrier: the fence instruction doesn't expose all the possibilities which can be expressed by __builtin_llvm_memory_barrier. I would appreciate hearing from anyone who is using this intrinsic.
llvm-svn: 139216
2011-09-07 01:41:24 +00:00
Fariborz Jahanian
4efb6b35f6
Revise test and see if it passes with a release-built clang.
...
llvm-svn: 139043
2011-09-02 21:47:51 +00:00
Fariborz Jahanian
2bb8270e6f
blocks: Support capturing complex variable in block.
...
// rdar://10033896
llvm-svn: 139041
2011-09-02 21:33:44 +00:00
Fariborz Jahanian
b74711df52
revert patch in r139020
...
llvm-svn: 139029
2011-09-02 20:03:16 +00:00
Fariborz Jahanian
f30bc00103
blocks: Support capturing complex variable in block.
...
// rdar://10033896
llvm-svn: 139020
2011-09-02 18:39:40 +00:00
John McCall
a5efa7386a
Track whether an AggValueSlot is potentially aliased, and do not
...
emit call results into potentially aliased slots. This allows us
to properly mark indirect return slots as noalias, at the cost
of requiring an extra memcpy when assigning an aggregate call
result into a l-value. It also brings us into compliance with
the x86-64 ABI.
llvm-svn: 138599
2011-08-25 23:04:34 +00:00
Bruno Cardoso Lopes
fbb8b84f5f
Add testcase for r138411
...
llvm-svn: 138422
2011-08-24 01:35:04 +00:00
Eric Christopher
b58b3e879d
Make constant aggregate constant initializers private linkage.
...
After talking with John making this the case for all of these is
the right way to go.
Fixes rdar://9804564 and PR10414
llvm-svn: 138418
2011-08-24 00:33:55 +00:00
Fariborz Jahanian
b50801f049
block IRgen - Fixes a crash when determining if given block variable
...
is captured by a given statement expression. // rdar://10001085
llvm-svn: 138314
2011-08-23 00:27:49 +00:00
Eli Friedman
c55efe4fb2
Make sure we don't inline functions marked with __attribute__((naked)). <rdar://problem/9973228>
...
llvm-svn: 138310
2011-08-22 23:55:33 +00:00
Devang Patel
2de80d601a
Add new test.
...
Remove one outdated test.
llvm-svn: 138144
2011-08-19 23:26:54 +00:00
Devang Patel
0e3a9f645b
Robustify test, there is no need to check metadata number which can change.
...
llvm-svn: 137752
2011-08-16 21:01:06 +00:00
Eric Christopher
bf005ecd9c
'pure' and 'const' functions should also be marked nounwind. Migrate
...
test over from llvm/test/FrontendC++ and update others to account for
the change.
llvm-svn: 137669
2011-08-15 22:38:22 +00:00
Eli Friedman
729ed799c7
Update clang tests for r137527.
...
llvm-svn: 137535
2011-08-12 23:33:52 +00:00
Craig Topper
6d64a738fa
Add tests for string literal concatenation.
...
llvm-svn: 137302
2011-08-11 05:57:09 +00:00
Craig Topper
54edccafc5
Add support for C++0x raw string literals.
...
llvm-svn: 137298
2011-08-11 04:06:15 +00:00
Chad Rosier
e1a6a0e05c
Add support for using anonymous bitfields (e.g., int : 0) to enforce alignment.
...
This fixes cases where the anonymous bitfield is followed by a bitfield member.
E.g.,
struct t4
{
char foo;
long : 0;
char bar : 1;
};
rdar://9859156
llvm-svn: 136991
2011-08-05 22:38:04 +00:00
Matt Beaumont-Gay
b0244cf0a4
Output to /dev/null, not "0"
...
llvm-svn: 136955
2011-08-05 01:05:35 +00:00
Chad Rosier
2c23b27fc7
Formatting.
...
llvm-svn: 136924
2011-08-04 21:26:30 +00:00
Chad Rosier
18903ee2d3
Add partial support for using anonymous bitfields (e.g., int : 0) to enforce
...
alignment. This fixes cases where the anonymous bitfield is followed by a
non-bitfield member. E.g.,
struct t4
{
int foo : 1;
long : 0;
char bar;
};
Part of rdar://9859156
llvm-svn: 136858
2011-08-04 01:21:14 +00:00
John McCall
9b24df470d
Emit wide string literals with the appropriate alignment.
...
Patch by Craig Topper and Sundeep!
llvm-svn: 136856
2011-08-04 01:03:22 +00:00
Chad Rosier
6088393248
For APCS the alignment of bitfield types is *not* respected when laying out
...
structures. Alignment can be enforced with the use of anonymous bitfields
(e.g., int :0), but this is not currently supported. Add this test case to
document the current state, which will hopefully be fixed shortly.
llvm-svn: 136848
2011-08-04 00:19:13 +00:00
Chandler Carruth
db4c563121
Delete one of the old tests that was ported over to Clang. The test is
...
designed to be executed, and its output inspected for correct values,
but we aren't executing it. We're just compiling it, and dumping it to
/dev/null. It also isn't freestanding. If there is a desire to have this
test actually stick around, complain and I'll revert this and try to add
the file checks necessary to make this actually test things.
llvm-svn: 136846
2011-08-03 23:53:42 +00:00
Bob Wilson
e826a2a56b
Handle "homogeneous aggregates" as required by the ARM AAPCS-VFP ABI.
...
A homogeneous aggregate is an aggregate data structure where after flattening
any nesting there are 1 to 4 elements of the same base type that is either a
float, double, or Neon vector. All Neon vectors of the same size, either 64
or 128 bits, are treated as equivalent for this purpose. When using the
AAPCS-VFP ABI, check for homogeneous aggregates and pass them as arguments by
expanding them into a sequence of their base types. This requires extending
the existing support for expanded arguments to handle not only structs, but
also constant arrays and complex types.
llvm-svn: 136767
2011-08-03 05:58:22 +00:00
John McCall
625ed88f07
When rewriting a call to a K&R function to lead to a well-prototyped
...
function, be sure to drop parameter attributes when dropping their
associated arguments. Patch by Aaron Landwehr!
llvm-svn: 136753
2011-08-03 00:43:55 +00:00
Rafael Espindola
11d994b769
Implements alignment for long long and double types in va_arg on ARM AAPCS.
...
Patch by Jim (Ningjie) Chen.
llvm-svn: 136734
2011-08-02 22:33:37 +00:00
Eric Christopher
b081ba651c
Add support for the 'Q' arm memory constraint.
...
Fixes rdar://9866494
llvm-svn: 136524
2011-07-29 21:20:35 +00:00
Douglas Gregor
5e6fcb108f
This patch makes the string/character literal tests run in C,
...
C++98/03, and C++0x mode, from Craig Topper!
llvm-svn: 136443
2011-07-29 01:08:54 +00:00
Peter Collingbourne
05500ba6ec
Fix assertion failure in CodeGen where the input operand to an asm
...
instruction is tied to an output operand which is a pointer, and
the input operand is narrower than the output operand.
llvm-svn: 136438
2011-07-29 00:24:50 +00:00
NAKAMURA Takumi
9b249eecca
test/CodeGen/2004-03-16-AsmRegisterCrash.c: XTARGET should accept the part of triplet. ("x86" is not the part of triplet)
...
llvm-svn: 136346
2011-07-28 11:25:02 +00:00
NAKAMURA Takumi
6a662d30e4
test/CodeGen/struct-matching-constraint.c: Fixup not to emit garbage to source tree.
...
llvm-svn: 136333
2011-07-28 04:50:11 +00:00
NAKAMURA Takumi
449e4c0f43
test/CodeGen/struct-init.c, struct-matching-constraint.c: Tweak commandline, or they would not be recognized as armv7 on some hosts.
...
llvm-svn: 136330
2011-07-28 03:53:54 +00:00
Eric Christopher
7089f25dd6
Fix thinko in last checkin.
...
llvm-svn: 136311
2011-07-28 00:30:42 +00:00
Eric Christopher
e040c27fb8
Remove the need for a header and specify a triple so that the type
...
sizes make sense.
llvm-svn: 136309
2011-07-28 00:28:22 +00:00
Eric Christopher
1137086e19
Fix this up for clang codegen versus llvm-gcc.
...
llvm-svn: 136308
2011-07-28 00:25:28 +00:00
Eric Christopher
9c8dece1b6
Fix this test to work for arm and on all platforms.
...
llvm-svn: 136307
2011-07-28 00:22:59 +00:00
Eric Christopher
18a53fca27
Add a triple to this test and make sure it passes on arm where it was
...
supposed to.
llvm-svn: 136305
2011-07-28 00:13:53 +00:00
Eric Christopher
ddc29f002e
Correct the triple here.
...
llvm-svn: 136304
2011-07-28 00:11:03 +00:00
Eric Christopher
6455d84653
This works on arm.
...
llvm-svn: 136303
2011-07-28 00:10:10 +00:00
Eric Christopher
1aa80a57e0
Apparently this does work on arm.
...
llvm-svn: 136302
2011-07-28 00:09:38 +00:00
Eric Christopher
8afab4d19e
This was meant to test arm anyhow, make the registers agree with the
...
instruction and the architecture for which the instruction exists.
llvm-svn: 136301
2011-07-28 00:08:06 +00:00
Eric Christopher
f65a0e50ff
Remove this test, it's actually testing something that clang doesn't support.
...
llvm-svn: 136300
2011-07-28 00:03:07 +00:00
Eric Christopher
3befed71c6
XFAIL this test on ARM. Filed PR10518 to track.
...
llvm-svn: 136299
2011-07-27 23:48:42 +00:00
Eric Christopher
93dd260cc9
Remove the optimization option for this test.
...
llvm-svn: 136298
2011-07-27 23:46:26 +00:00
Eric Christopher
60962757d1
No one cares about ppc, but make this work for arm and x86 and xfail the rest.
...
llvm-svn: 136297
2011-07-27 23:44:48 +00:00
Eric Christopher
87d383b695
Make this darwin only for now while investigating to clear up x86_64
...
Release+Asserts linux tests.
llvm-svn: 136223
2011-07-27 16:26:09 +00:00
Douglas Gregor
fb65e592e0
Add support for C++0x unicode string and character literals, from Craig Topper!
...
llvm-svn: 136210
2011-07-27 05:40:30 +00:00
Eric Christopher
12ff9528b2
Handle different sized wchar_t for windows.
...
llvm-svn: 136192
2011-07-26 23:56:49 +00:00
Eric Christopher
99c3638935
Use the correct definition for memset.
...
llvm-svn: 136188
2011-07-26 23:44:22 +00:00
Eric Christopher
fde54ab8b5
Make this darwin only to simplify the padding calculations per arch.
...
llvm-svn: 136185
2011-07-26 23:39:23 +00:00
Eric Christopher
8f95f425aa
This appears to be passing on all hosts.
...
llvm-svn: 136182
2011-07-26 23:26:00 +00:00
Eric Christopher
ebc113d1d3
Try a little hack to fix the memset duplication on windows.
...
llvm-svn: 136179
2011-07-26 23:18:10 +00:00
Eric Christopher
9688a17bff
Try harder to fix these for windows.
...
llvm-svn: 136177
2011-07-26 23:12:06 +00:00
Eric Christopher
28f8189866
Generalize for various build bots.
...
llvm-svn: 136173
2011-07-26 22:52:35 +00:00
Eric Christopher
19520147fc
Rewrite match line to be friendlier to misc buildbots.
...
llvm-svn: 136169
2011-07-26 22:44:31 +00:00
Eric Christopher
cf2ea54160
Rewrite matching line to be friendlier to misc buildbots.
...
llvm-svn: 136168
2011-07-26 22:43:37 +00:00
Eric Christopher
f883941903
Attempt to rewrite the matching for this test to pacify the windows
...
build bots.
llvm-svn: 136166
2011-07-26 22:42:01 +00:00
Eric Christopher
970fa44d70
Rework the match here to silence release mode windows buildbots.
...
llvm-svn: 136164
2011-07-26 22:32:44 +00:00
Eric Christopher
738c7ef5bb
Attempt to generalize this test for release mode buildbots.
...
llvm-svn: 136163
2011-07-26 22:31:33 +00:00
Eric Christopher
4a8bc43083
Try to generalize the match to quiet the windows build bot.
...
llvm-svn: 136162
2011-07-26 22:27:01 +00:00
Eric Christopher
aee57b4948
Use unsigned long long for uint64_t. Fixes part of the windows buildbot.
...
llvm-svn: 136160
2011-07-26 22:19:01 +00:00
Eric Christopher
85e5156598
Migrate most of the rest of test/FrontendC from llvm and migrate
...
most of them to FileCheck.
llvm-svn: 136159
2011-07-26 22:17:02 +00:00
Eric Christopher
2dfed48cae
Adjust check for release mode.
...
llvm-svn: 136158
2011-07-26 22:07:13 +00:00
Eric Christopher
e70ea8b806
Migrate:
...
CodeGen/2003-08-21-WideString.c
CodeGen/2003-10-02-UnionLValueError.c
CodeGen/2004-02-20-Builtins.c
CodeGen/2008-01-04-WideBitfield.c
CodeGen/2002-07-14-MiscTests3.c
CodeGen/2005-04-09-ComplexOps.c
CodeGen/2008-12-23-AsmIntPointerTie.c
CodeGen/2005-07-20-SqrtNoErrno.c
CodeGen/2005-01-02-VAArgError-ICE.c
CodeGen/2004-06-17-UnorderedCompares.c
CodeGen/2002-06-25-FWriteInterfaceFailure.c
CodeGen/2002-02-18-64bitConstant.c
CodeGen/2002-05-24-Alloca.c
CodeGen/2006-01-13-Includes.c
CodeGen/2007-09-27-ComplexIntCompare.c
CodeGen/2004-02-13-IllegalVararg.c
CodeGen/2007-09-12-PragmaPack.c
CodeGen/2002-08-02-UnionTest.c
from test/FrontendC with changes to remove header file includes.
llvm-svn: 136153
2011-07-26 21:42:32 +00:00
Eric Christopher
def19fb79d
Migrate CodeGen/2007-03-05-DataLayout.c from test/FrontendC with changes
...
to remove header file includes.
llvm-svn: 136134
2011-07-26 20:44:55 +00:00
Eric Christopher
5a1d214c4a
Migrate CodeGen/2005-02-20-AggregateSAVEEXPR.c from test/FrontendC with
...
changes to remove any #include lines.
llvm-svn: 136129
2011-07-26 20:38:19 +00:00
Eric Christopher
1d9aab8c9e
Migrate CodeGen/2009-09-24-SqrtErrno.c from test/FrontendC with changes
...
to avoid header inclusions.
llvm-svn: 136128
2011-07-26 20:31:17 +00:00
Eric Christopher
63683b1e64
Migrate CodeGen/2002-03-11-LargeCharInString.c from test/FrontendC and
...
modify to avoid any outside includes.
llvm-svn: 136127
2011-07-26 20:29:08 +00:00
Eric Christopher
0a887eca46
Add CodeGen/2009-07-15-pad-wchar_t-array.c migrated from test/FrontendC
...
and modified to avoid includes.
llvm-svn: 136126
2011-07-26 20:27:12 +00:00
Eric Christopher
320db01d13
Migrate wchar-const.c with fixes and FileCheck from llvm/test/FrontendC.
...
llvm-svn: 136114
2011-07-26 18:39:16 +00:00
NAKAMURA Takumi
a2fd936107
test/CodeGen/2003-08-18-SigSetJmp.c: XFAIL: mingw, too!
...
llvm-svn: 136043
2011-07-26 01:40:37 +00:00
Eric Christopher
1c7ea99456
win32 doesn't have sigsetjmp, just xfail this test there.
...
llvm-svn: 136041
2011-07-26 01:32:19 +00:00
Eric Christopher
2da8b9c652
Rework this slightly to work for optimized compilers and remove the
...
optimization from the test.
llvm-svn: 136039
2011-07-26 01:24:10 +00:00
Eric Christopher
6f2a0d7234
These tests use standard headers and so need ms extensions with MSVC headers.
...
Use the driver instead of just clang -cc1.
llvm-svn: 136037
2011-07-26 01:12:27 +00:00
Eric Christopher
ad869153ba
Remove this test, it's more properly an optimizer test.
...
llvm-svn: 136036
2011-07-26 01:11:20 +00:00
Eric Christopher
e6051006ba
Migrate and FileCheck-ize some of:
...
2003-09-18-BitfieldTests.c 2007-04-11-PR1321.c 2003-11-13-TypeSafety.c 2003-08-29-StructLayoutBug.c 2010-05-14-Optimized-VarType.c 2003-10-06-NegateExprType.c 2007-06-05-NoInlineAttribute.c 2011-03-31-ArrayRefFolding.c 2010-07-14-ref-off-end.c Atomics-no64bit.c 2007-05-11-str-const.c 2004-11-27-InvalidConstantExpr.c 2007-04-05-UnPackedStruct.c 2004-03-15-SimpleIndirectGoto.c 2004-01-08-ExternInlineRedefine.c sret2.c 2007-02-07-AddrLabel.c 2002-09-19-StarInLabel.c 2003-11-16-StaticArrayInit.c 2003-08-18-SigSetJmp.c 2007-04-24-VolatileStructCopy.c 2002-07-29-Casts.c 2005-06-15-ExpandGotoInternalProblem.c 2007-09-17-WeakRef.c 2007-04-24-str-const.c 2003-08-30-LargeIntegerBitfieldMember.c inline-asm-mrv.c
from llvm/test/FrontendC.
llvm-svn: 136035
2011-07-26 00:57:50 +00:00
Chris Lattner
84037d3d0a
fix PR10415, tidying up IR representation of module level inline asm
...
to avoid extraneous \n's.
llvm-svn: 135862
2011-07-23 20:04:25 +00:00
Devang Patel
11de9a966a
Check column number also.
...
llvm-svn: 135437
2011-07-18 22:18:04 +00:00
Nick Lewycky
ba4cc01a1f
Don't crash when codegen'ing an empty redecl of a function in C99 mode, when
...
neither was inline. Fixes bug introduced in r135377.
llvm-svn: 135380
2011-07-18 07:11:55 +00:00
Nick Lewycky
26da4ddfa6
In C99, emit an inline function when encountering an extern redeclaration.
...
Fixes PR10233!
llvm-svn: 135377
2011-07-18 05:26:13 +00:00
Chris Lattner
6fb0ccfa0f
Enhance the IR type lowering code to be much smarter about recursively lowering
...
types. Fore xample, we used to lower:
struct bar { int a; };
struct foo {
void (*FP)(struct bar);
} G;
to:
%struct.foo = type { {}* }
since the function pointer would cause recursive translation of bar and
we didn't know if that would get us into trouble. We are now smart enough
to know that it is fine, so we get this type instead:
%struct.foo = type { void (i32)* }
Codegen still needs to be prepared for uncooperative types at any place,
which is why I let the maximally uncooperative code sit around for awhile to
help shake out the bugs.
llvm-svn: 135244
2011-07-15 05:16:14 +00:00
Bruno Cardoso Lopes
98154a76fd
Reapply r134946 with fixes. Tested on Benjamin testcase and other test-suite failures.
...
llvm-svn: 135091
2011-07-13 21:58:55 +00:00
Devang Patel
f0335ce632
Emit debug info for extended vectors.
...
llvm-svn: 135083
2011-07-13 21:23:30 +00:00
Chris Lattner
3517f14219
PR10337 reminds me that calls return values, lets handle them just
...
like arguments. Thanks PR10337! :)
llvm-svn: 135030
2011-07-13 03:59:32 +00:00
Bruno Cardoso Lopes
0aadf83f80
Revert r134946
...
llvm-svn: 135004
2011-07-12 22:30:58 +00:00
Chris Lattner
73e3004e75
fix an unintended behavior change in the type system rewrite, which caused us to compile
...
stuff like this:
typedef struct {
int x, y, z;
} foo_t;
foo_t g;
into:
%"struct.<anonymous>" = type { i32, i32, i32 }
we now get:
%struct.foo_t = type { i32, i32, i32 }
This doesn't change the behavior of the compiler, but makes the IR much easier to read.
llvm-svn: 134969
2011-07-12 05:53:08 +00:00
Chris Lattner
3ce8668273
fix PR10335 by watching out for IR type compatibility in call argument lists.
...
llvm-svn: 134966
2011-07-12 04:53:39 +00:00
Chris Lattner
5e3ef09f20
make test name less specific
...
llvm-svn: 134964
2011-07-12 04:51:05 +00:00
Bruno Cardoso Lopes
75541d00e0
Do the same as r134946 for arrays. Add more testcases for avx x86_64 arg
...
passing.
llvm-svn: 134951
2011-07-12 01:27:38 +00:00
Bruno Cardoso Lopes
7a26681092
Fix one x86_64 abi issue and the test to actually look for the right thing,
...
which is: { <4 x float>, <4 x float> } should continue to go through memory.
llvm-svn: 134946
2011-07-12 00:30:27 +00:00
Bruno Cardoso Lopes
21a41bb5ec
Reapply r134754, which turns out to be working correctly and also
...
add one more testcase.
llvm-svn: 134934
2011-07-11 22:41:29 +00:00
Chris Lattner
d1f1158203
Fix the clang bootstrap and Jay's testcase from llvm-dev by being completely
...
conservative when converting a functiontype to IR when in a "pointer within
a struct" context. This has the unfortunate sideeffect of compiling all
function pointers inside of structs into "{}*" which, though correct, is
ugly. This has the positive side effect of being correct, and it is pretty
straight-forward to improve on this.
llvm-svn: 134861
2011-07-10 03:47:27 +00:00
Chris Lattner
8806e32f16
Rename CGT::VerifyFuncTypeComplete to isFuncTypeConvertible since
...
it is a predicate, not an action. Change the return type to be a bool,
not the incomplete member. Enhace it to detect the recursive compilation
case, allowing us to compile Eli's testcase on llvmdev:
struct T {
struct T (*p)(void);
} t;
into:
%struct.T = type { {}* }
@t = common global %struct.T zeroinitializer, align 8
llvm-svn: 134853
2011-07-10 00:18:59 +00:00
Chris Lattner
a5f58b05e8
clang side to match the LLVM IR type system rewrite patch.
...
llvm-svn: 134831
2011-07-09 17:41:47 +00:00
Evan Cheng
7b15d1885f
cc1 must initialize MC subtarget infos for inline asm parsing. Re-enable asm-errors.c
...
llvm-svn: 134811
2011-07-09 07:32:07 +00:00
Chris Lattner
380667d520
disable this test to get the botz green again.
...
llvm-svn: 134808
2011-07-09 07:14:54 +00:00
Eli Friedman
a7c9411818
Silly typo in test for r134770.
...
llvm-svn: 134774
2011-07-08 23:57:18 +00:00
Eli Friedman
3346582bca
Change -mno-mmx to be more compatible with gcc. Specifically, -mno-mmx should not imply -mno-sse.
...
Note that because we don't usually touch the MMX registers anyway, all -mno-mmx needs to do is tweak the x86-32 calling convention a little for vectors that look like MMX vectors, and prevent the definition of __MMX__.
clang doesn't actually stop the user from using MMX inline asm operands or MMX builtins in -mno-mmx mode; as a QOI issue, it would be nice to diagnose, but I doubt it really matters much.
<rdar://problem/9694837>
llvm-svn: 134770
2011-07-08 23:31:17 +00:00
Bruno Cardoso Lopes
129b4cc9ec
Revert x86_64 ABI changes until I have time to check the items raised by Eli.
...
llvm-svn: 134765
2011-07-08 22:57:35 +00:00
Jakub Staszak
d2cf2cbae9
Introduce __builtin_expect() intrinsic support.
...
llvm-svn: 134761
2011-07-08 22:45:14 +00:00
Bruno Cardoso Lopes
308d7423a9
Add support for AVX 256-bit in the x86_64 ABI (as in the 0.99.5 draft)
...
llvm-svn: 134754
2011-07-08 22:18:40 +00:00
Cameron Zwarich
ae7bc98710
Add codegen support for the fma/fmal/fmaf builtins.
...
llvm-svn: 134743
2011-07-08 21:39:34 +00:00
Eric Christopher
f7d303c541
Add a testcase for the previous commit and update an existing test for an
...
extra register.
Part of PR10299 and rdar://9740322
llvm-svn: 134657
2011-07-07 23:11:01 +00:00
Cameron Zwarich
be652e6a24
r134634 causes a failure on MultiSource/Benchmarks/Olden/bh with TEST=nightly,
...
so roll it out.
llvm-svn: 134638
2011-07-07 21:03:28 +00:00
Nick Lewycky
d755e6ac48
A redeclaration of an inline method in C99 mode should trigger emission of that
...
function. Fixes PR10233!
llvm-svn: 134634
2011-07-07 20:25:10 +00:00
Fariborz Jahanian
134f4587e7
revert patch for // rdar://9227352
...
llvm-svn: 134536
2011-07-06 21:05:11 +00:00
Devang Patel
2f5297901d
Testcase for r134441.
...
llvm-svn: 134442
2011-07-05 21:48:46 +00:00
Eli Friedman
1310c68bb0
Don't use x86_mmx where it isn't necessary.
...
The start of some work on getting -mno-mmx working the way we want it to.
llvm-svn: 134300
2011-07-02 00:57:27 +00:00
Eric Christopher
dba0288cbf
Add a testcase for r134292.
...
Part of rdar://9714064
llvm-svn: 134295
2011-07-02 00:28:30 +00:00
Fariborz Jahanian
25e61c58bf
Use existing -fcatch-undefined-behavior option,
...
replacing -freset-local-blocks. // rdar://9227352
llvm-svn: 134082
2011-06-29 18:41:17 +00:00