Commit Graph

1448 Commits

Author SHA1 Message Date
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