summaryrefslogtreecommitdiffstats
path: root/test/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Allocate TargetLibraryInfo for the CodeGen passes. Otherwise, it's instantiatedChad Rosier2012-02-291-0/+27
| | | | | | | | | | by the BAA pass, which uses the default TargetLibraryInfo constructor. Unfortunately, the default TargetLibraryInfo constructor assumes all library calls are available and thus ignores -fno-builtin. rdar://10947759 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151745 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r151638 and r151641.James Molloy2012-02-291-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bug that was caught by Apple's internal buildbots was valid and also showed another bug in my implementation. These are now fixed, with regression tests added to catch them both (not Darwin-specific). Original log: ==================== Revert r151638 because it causes assertion hit on PCH creation for Cocoa.h Original log: --------------------- Correctly track tags and enum members defined in the prototype of a function, and ensure they are properly scoped. This fixes code such as: enum e {x, y}; int f(enum {y, x} n) { return 0; } This finally fixes PR5464 and PR5477. --------------------- I also reverted r151641 which was enhancement on top of r151638. ==================== git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151712 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r151638 because it causes assertion hit on PCH creation for Cocoa.hArgyrios Kyrtzidis2012-02-281-15/+0
| | | | | | | | | | | | | | | | | | | | Original log: --------------------- Correctly track tags and enum members defined in the prototype of a function, and ensure they are properly scoped. This fixes code such as: enum e {x, y}; int f(enum {y, x} n) { return 0; } This finally fixes PR5464 and PR5477. --------------------- I also reverted r151641 which was enhancement on top of r151638. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151667 91177308-0d34-0410-b5e6-96231b3b80d8
* Correctly track tags and enum members defined in the prototype of a ↵James Molloy2012-02-281-0/+15
| | | | | | | | | | | | | | | | | function, and ensure they are properly scoped. This fixes code such as: enum e {x, y}; int f(enum {y, x} n) { return 0; } This finally fixes PR5464 and PR5477. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151638 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing code for compound literals of complex type. ↵Eli Friedman2012-02-271-1/+7
| | | | | | <rdar://problem/10938628> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151549 91177308-0d34-0410-b5e6-96231b3b80d8
* Test case for r151429/r151430, which ensures llvm.lifetime intrinsics are notChad Rosier2012-02-271-0/+23
| | | | | | | | being emitted at -O0, but are emitted when optimizations are enabled. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151533 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a stupid mistake in r151133. Reported to me by Joerg Sonnenberger.Eli Friedman2012-02-241-0/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151407 91177308-0d34-0410-b5e6-96231b3b80d8
* Turned on support for __declspecs: noreturn, noinline, nothrow and naked in ↵Aaron Ballman2012-02-231-0/+16
| | | | | | MS compatibility mode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151295 91177308-0d34-0410-b5e6-96231b3b80d8
* Add 3dNOW intrinsic header to x86intrin.h, conditioned on __3dNOW__ toChandler Carruth2012-02-201-0/+156
| | | | | | | | | | | | | | | | match the behavior of GCC. Also add a test for these intrinsics, which apparently have *zero* tests. =[ Not surprisingly, Clang crashed when compiling these. Fix the bug in CodeGen where we failed to bitcast the argument type to x86mmx prior to calling the LLVM intrinsic. This fixes an assert on the new 3dnow-builtins.c test. This is one issue impacting the efforts to get Clang to emulate the Microsoft intrinsics headers -- 3dnow intrinsics are implictitly made available there. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150948 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement #pragma redefine_extname.David Chisnall2012-02-181-0/+15
| | | | | | | | This fixes PR5172 and allows clang to compile C++ programs on Solaris using the system headers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150881 91177308-0d34-0410-b5e6-96231b3b80d8
* Loosen the test from r150238 a bit to make some of our bots happy.Evgeniy Stepanov2012-02-101-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150242 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix function prolog codegen whe coerce-to type is a struct.Evgeniy Stepanov2012-02-101-0/+12
| | | | | | | | | | | | This changes function prolog in such a way as to avoid out-of-bounds stack store in the case when coerce-to type has a larger storage size than the real argument type. Fixes PR11905. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150238 91177308-0d34-0410-b5e6-96231b3b80d8
* Class objects passed by value follow the same rules as structure objects.Akira Hatanaka2012-02-091-0/+15
| | | | | | | | | Double fields of by-value class objects should be passed in floating point registers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150200 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bugs in function MipsABIInfo::returnAggregateInRegs. Functions returningAkira Hatanaka2012-02-091-0/+31
| | | | | | | | class objects follow the same rules as those returning struct objects. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150196 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove vperm2f* and vperm2i builtins. Same effect can be achieved with ↵Craig Topper2012-02-083-5/+20
| | | | | | builtin_shufflevector. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150064 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove vpermilp* builtins. Same effect can be achieved with ↵Craig Topper2012-02-082-4/+24
| | | | | | builtin_shufflevector. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150056 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not return records with non trivial destructors or copy constructors inAkira Hatanaka2012-02-081-0/+17
| | | | | | | | registers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150035 91177308-0d34-0410-b5e6-96231b3b80d8
* Make FunctionDecl::doesDeclarationForceExternallyVisibleDefinition use the ↵Eli Friedman2012-02-071-3/+28
| | | | | | same logic as FunctionDecl::isInlineDefinitionExternallyVisible to figure out whether to emit a definition. Based on work by Anton Yartsev. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149963 91177308-0d34-0410-b5e6-96231b3b80d8
* Preserve alignment for Neon vld1_lane/dup and vst1_lane intrinsics.Bob Wilson2012-02-041-0/+10
| | | | | | | | We had been generating load/store instructions with the default alignment for the vector element type, even when the pointer argument had less alignment. <rdar://problem/10538555> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149794 91177308-0d34-0410-b5e6-96231b3b80d8
* Update tests so that they don't rely upon LLVMDebugVersion number.Devang Patel2012-02-031-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149726 91177308-0d34-0410-b5e6-96231b3b80d8
* [frontend] Don't allow a mapping to a warning override an error/fatal mapping.Chad Rosier2012-02-031-1/+1
| | | | | | rdar://10736625 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149662 91177308-0d34-0410-b5e6-96231b3b80d8
* r149587 revertedAnton Yartsev2012-02-022-34/+34
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149594 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix for PR10657 (http://llvm.org/bugs/show_bug.cgi?id=10657)Anton Yartsev2012-02-022-34/+34
| | | | | | extern inline case considered git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149587 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleanup 3dnow builtin handling. Most of them were already handled by LLVM ↵Craig Topper2012-01-301-1/+0
| | | | | | connecting intrinsics and builtins in IntrinsicsX86.td. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149233 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the __builtin_c[lt]zs builtins target independent.Benjamin Kramer2012-01-282-17/+33
| | | | | | | | | | There is really no reason to have these only available on x86. It's just __builtin_c[tl]z for shorts. Modernize the test while at it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149183 91177308-0d34-0410-b5e6-96231b3b80d8
* Make clz/ctz builtins defined for zero on ARM targets. rdar://10732455Bob Wilson2012-01-261-2/+6
| | | | | | | | | | | | | | | | ARM supports clz and ctz directly and both operations have well-defined results for zero. There is no disadvantage in performance to using the defined-at-zero versions of llvm.ctlz/cttz intrinsics. We're running into ARM-specific code written with the assumption that __builtin_clz(0) == 32, even though that value is technically undefined. The code is failing now because of llvm optimizations that are taking advantage of the undef behavior (specifically svn r147255). There's nothing wrong with that optimization on x86 where any incorrect assumptions about __builtin_clz(0) will quickly be exposed. For ARM, though, optimizations based on that undef behavior are likely to cause subtle bugs. Other targets with defined-at-zero clz/ctz support may want to override the default behavior as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149086 91177308-0d34-0410-b5e6-96231b3b80d8
* Try harder to get X7 definedDouglas Gregor2012-01-261-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149072 91177308-0d34-0410-b5e6-96231b3b80d8
* Force layout of more of the unions and structures in this testDouglas Gregor2012-01-261-1/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149066 91177308-0d34-0410-b5e6-96231b3b80d8
* Suppress any warnings from this test. They aren't interesting, and theyChandler Carruth2012-01-261-3/+3
| | | | | | | | | | 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. ;] git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149058 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend the ExternalASTSource interface to allow the AST source toDouglas Gregor2012-01-261-0/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149055 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some ABI tweaks for i386-pc-win32 triple so that we return structs in an ↵Eli Friedman2012-01-251-0/+48
| | | | | | MSVC-compatible way. Patch by Joe Groff. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148992 91177308-0d34-0410-b5e6-96231b3b80d8
* test/CodeGen/avx-builtins.c: Fix more for -Asserts.NAKAMURA Takumi2012-01-251-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148944 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-enable test that was broken by r148919Craig Topper2012-01-251-6/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148932 91177308-0d34-0410-b5e6-96231b3b80d8
* disable this test for now.Chris Lattner2012-01-251-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148928 91177308-0d34-0410-b5e6-96231b3b80d8
* fix broken testcase.Chris Lattner2012-01-251-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148925 91177308-0d34-0410-b5e6-96231b3b80d8
* Represent 256-bit unaligned loads natively and remove the builtins. Similar ↵Craig Topper2012-01-251-0/+25
| | | | | | change was made for 128-bit versions a while back. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148919 91177308-0d34-0410-b5e6-96231b3b80d8
* The following patch adds __attribute__((no_address_safety_analysis)) which ↵Kostya Serebryany2012-01-241-0/+35
| | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148842 91177308-0d34-0410-b5e6-96231b3b80d8
* add tests for wide character encodingsSeth Cantrell2012-01-211-3/+17
| | | | | | and fix typo git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148603 91177308-0d34-0410-b5e6-96231b3b80d8
* rename -ccc-host-triple into -targetSebastian Pop2012-01-206-9/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148582 91177308-0d34-0410-b5e6-96231b3b80d8
* Add and update tests for character literalsSeth Cantrell2012-01-182-44/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148392 91177308-0d34-0410-b5e6-96231b3b80d8
* Add testcase for r148375!Nick Lewycky2012-01-182-0/+19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148378 91177308-0d34-0410-b5e6-96231b3b80d8
* Add new line.Tanya Lattner2012-01-161-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148255 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for OpenCL 1.1 logical operations.Tanya Lattner2012-01-161-0/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148254 91177308-0d34-0410-b5e6-96231b3b80d8
* Some improvements to the handling of C11 atomic types:David Chisnall2012-01-162-0/+28
| | | | | | | | | | | | | | | | | | | | - 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148242 91177308-0d34-0410-b5e6-96231b3b80d8
* constexpr irgen: Add irgen support for APValue::Struct, APValue::Union,Richard Smith2012-01-141-1/+1
| | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148178 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r148138; it's causing test failures.Eli Friedman2012-01-136-9/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148141 91177308-0d34-0410-b5e6-96231b3b80d8
* rename -ccc-host-triple into -targetSebastian Pop2012-01-136-9/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148138 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix test case committed in r147986.Akira Hatanaka2012-01-121-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147993 91177308-0d34-0410-b5e6-96231b3b80d8
* Take into account the pointer to an aggregate that is passed as a hiddenAkira Hatanaka2012-01-121-0/+12
| | | | | | | | argument when Offset is initialized. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147986 91177308-0d34-0410-b5e6-96231b3b80d8
* clang/test/CodeGen/vla-4.c: Relax expression for -Asserts.NAKAMURA Takumi2012-01-111-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147934 91177308-0d34-0410-b5e6-96231b3b80d8