summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Revert "MemorySanitizer does not require PIE."Evgeniy Stepanov2015-10-211-3/+2
| | | | | | It actually does require PIE on some targets. llvm-svn: 250944
* MemorySanitizer does not require PIE.Evgeniy Stepanov2015-10-211-2/+3
| | | | | | | | | | Since r249754 MemorySanitizer should work equally well for PIE and non-PIE executables. Beware, with this change -fsanitize=memory no longer adds implicit -fPIE -pie compiler/linker flags, unless the target defaults to PIE. llvm-svn: 250941
* Fix and stylize the emission of GC/ARC ivar and GC block layout strings.John McCall2015-10-213-2/+49
| | | | | | | | | | | | | | | Specifically, handle under-aligned object references (by explicitly ignoring them, because this just isn't representable in the format; yes, this means that GC silently ignores such references), descend into anonymous structs and unions, stop classifying fields of pointer-to-strong/weak type as strong/weak in ARC mode, and emit skips to cover the entirety of block layouts in GC mode. As a cleanup, extract this code into a helper class, avoid a number of unnecessary copies and layout queries, generate skips implicitly instead of explicitly tracking them, and clarify the bitmap-creation logic. llvm-svn: 250919
* Some minor ARC diagnostic improvements.John McCall2015-10-214-6/+16
| | | | llvm-svn: 250917
* In ARC, peephole the initialization of a __weak variable withJohn McCall2015-10-213-5/+12
| | | | | | | a value loaded from a __weak variable into a call to objc_copyWeak or objc_moveWeak. llvm-svn: 250916
* [OpenCL] Add test for program scope variable restrictions in OpenCL v2.0Anastasia Stulova2015-10-211-0/+15
| | | | | | http://reviews.llvm.org/D13105 llvm-svn: 250892
* Fix __ARM_FP value for sp-only FPUs with Half-precisionRichard Barton2015-10-212-15/+69
| | | | | | | | | The logic for parsing FP capabilities to set __ARM_FP was mistakenly removing the Half-Precision capability when handling fp-only-sp resulting in a value of 0x4. Section 6.5.1 of ACLE states that for such FP architectures the value should be 0x6 llvm-svn: 250888
* [modules] libstdc++ defines some static inline functions in its internalRichard Smith2015-10-216-0/+28
| | | | | | | | | | | headers. If those headers end up being textually included twice into the same module, we get ambiguity errors. Work around this by downgrading the ambiguity error to a warning if multiple identical internal-linkage functions appear in an overload set, and just pick one of those functions as the lookup result. llvm-svn: 250884
* Revert r247977, "clang/test/lit.cfg: *-ps4 doesn't have appropriate driver ↵NAKAMURA Takumi2015-10-201-1/+1
| | | | | | | | yet. Mark it as "non-clang-driver"." They, "tests requiring clang-driver", should work in trunk since ps4 driver has been introduced. llvm-svn: 250866
* Re-land r250592 without rejecting field refs in unevaluated contextsReid Kleckner2015-10-201-1/+64
| | | | | | | | | | | This time, I went with the first approach from http://reviews.llvm.org/D6700, where clang actually attempts to form an implicit member reference from an UnresolvedLookupExpr. We know that there are only two possible outcomes at this point, a DeclRefExpr of the FieldDecl or an error, but its safer to reuse the existing machinery for this. llvm-svn: 250856
* [-fms-extensions] Allow missing exception specifications in redeclarations ↵David Majnemer2015-10-201-0/+8
| | | | | | | | | | | as an extension Microsoft's ATL headers make use of this MSVC extension, add support for it and issue a diagnostic under -Wmicrosoft-exception-spec. This fixes PR25265. llvm-svn: 250854
* Add back null check removed accidentally in r250554Reid Kleckner2015-10-201-0/+3
| | | | | | Fixes PR25262 llvm-svn: 250844
* Look through using decls when classifying implicit member accessReid Kleckner2015-10-201-0/+13
| | | | | | | | | | | | | | | | | | | | | Clang will now accept this valid C++11 code: struct A { int field; }; struct B : A { using A::field; enum { TheSize = sizeof(field) }; }; Previously we would classify the 'field' reference as something other than a field, and then forget to apply the C++11 rule to allow non-static data member references in unevaluated contexts. This usually arises in class templates that want to reference fields of a dependent base in an unevaluated context outside of an instance method. Such contexts do not allow references to 'this', so the only way to access the field is with a using decl and an implicit member reference. llvm-svn: 250839
* [x86] Fix maskload/store intrinsic definitions in avxintrin.hAndrea Di Biagio2015-10-201-8/+8
| | | | | | | | | | | | | According to the Intel documentation, the mask operand of a maskload and maskstore intrinsics is always a vector of packed integer/long integer values. This patch introduces the following two changes: 1. It fixes the avx maskload/store intrinsic definitions in avxintrin.h. 2. It changes BuiltinsX86.def to match the correct gcc definitions for avx maskload/store (see D13861 for more details). Differential Revision: http://reviews.llvm.org/D13861 llvm-svn: 250816
* [DEBUG INFO] Emit debug info for type used in explicit cast only.Alexey Bataev2015-10-201-0/+46
| | | | | | | Currently debug info for types used in explicit cast only is not emitted. It happened after a patch for better alignment handling. This patch fixes this bug. Differential Revision: http://reviews.llvm.org/D13582 llvm-svn: 250795
* Revert "Diagnose UnresolvedLookupExprs that resolve to instance members in ↵Reid Kleckner2015-10-201-50/+1
| | | | | | | | | | | | | | | | | static methods" This reverts commit r250592. It has issues around unevaluated contexts, like this: template <class T> struct A { T i; }; template <class T> struct B : A<T> { using A<T>::i; typedef decltype(i) U; }; template struct B<int>; llvm-svn: 250774
* [MS ABI] Give linkonce_odr, instead of external_linkage, to certain kinds of ↵David Majnemer2015-10-192-8/+8
| | | | | | | | | | | | | | | | | static data members Out-of-line definitions of static data members which have an inline initializer must get GVA_DiscardableODR linkage instead of GVA_StrongExternal linkage. MSVC 2013's behavior is different with respect to this and would cause link errors if one TU provided a definition while another did not. MSVC 2015 fixed this bug, making this OK. Note that the 2015 behavior is always compatible with 2013: it never produces a strong definition. This essentially reverts r237787. llvm-svn: 250757
* clang-format: Use pipes instead of temporary files for most lit tests.Nico Weber2015-10-199-34/+31
| | | | | | | | | | | | | | | This makes the format tests look more like most other FileCheck tests in clang. The multiple-inputs tests still use temp files, to make sure that the file input code in clang-format stays tested. Stop stripping out the comment lines in style-on-command-line.cpp as they don't get in the way and it makes the test simpler. Also remove 2>&1s on the tests in that file that don't need it. http://reviews.llvm.org/D13852 llvm-svn: 250706
* Make test not rely on %T ending on /Output.Manuel Klimek2015-10-191-9/+9
| | | | llvm-svn: 250690
* [X86] Enable soft float ABI for x86Michael Kuperstein2015-10-191-0/+6
| | | | | | | | | The Intel MCU psABI requires floating-point values to be passed in-reg. This makes the x86-32 ABI code respect "-mfloat-abi soft" and generate float inreg arguments. Differential Revision: http://reviews.llvm.org/D13554 llvm-svn: 250689
* [OPENMP] Fix for http://llvm.org/PR25221: Infinite loop while parsing OpenMP ↵Alexey Bataev2015-10-191-0/+15
| | | | | | | | directive Clang skipped annot_pragma_openmp token, while it should be considered as a stop token while skipping tokens. llvm-svn: 250684
* Support linking against OpenMP runtime on FreeBSD.Dimitry Andric2015-10-181-0/+8
| | | | | | | | | | | | | | | Summary: Similar to rL248426 (which was a followup to rL248379 and rL248424), add the required libraries for OpenMP on the linker command line, and update the test case. Reviewers: emaste, theraven, joerg Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D13822 llvm-svn: 250657
* clang/test/Driver/ps4-linker-non-win.c: Tweak for cygwin like ↵NAKAMURA Takumi2015-10-171-5/+5
| | | | | | ps4-linker-win.c@250403. Cygwin seeks dependent libs along $PATH. llvm-svn: 250632
* clang/test/Driver/ps4-linker-non-win.c: Make %T/ps4-ld executable, or the ↵NAKAMURA Takumi2015-10-171-1/+1
| | | | | | driver wouldn't find it. llvm-svn: 250631
* clang/test/Driver/ps4-linker-non-win.c: Make sure that %T/ps4-ld would be ↵NAKAMURA Takumi2015-10-171-1/+4
| | | | | | used but *fails*. llvm-svn: 250630
* clang-format: Add test for (properly escaped) XML output.Daniel Jasper2015-10-171-0/+12
| | | | llvm-svn: 250629
* Diagnose UnresolvedLookupExprs that resolve to instance members in static ↵Reid Kleckner2015-10-171-1/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | methods During the initial template parse for this code, 'member' is unresolved and we don't know anything about it: struct A { int member }; template <typename T> struct B : public T { using T::member; static void f() { (void)member; // Could be static or non-static. } }; template class B<A>; The pattern declaration contains an UnresolvedLookupExpr rather than an UnresolvedMemberExpr because `f` is static, and `member` should never be a field. However, if the code is invalid, it may become a field, in which case we should diagnose it. Reviewers: rjmccall, rsmith Differential Revision: http://reviews.llvm.org/D6700 llvm-svn: 250592
* [modules] Allow the error when explicitly loading an incompatible module fileRichard Smith2015-10-161-3/+2
| | | | | | | | | via -fmodule-file= to be turned off; in that case, just include the relevant files textually. This allows module files to be unconditionally passed to all compile actions via CXXFLAGS, and to be ignored for rules that specify custom incompatible flags. llvm-svn: 250577
* Once again fix this test to read from stdin rather than an input fileRichard Barton2015-10-161-4/+4
| | | | llvm-svn: 250547
* Teach MyriadToolchain how to find its C++ header paths.James Y Knight2015-10-162-0/+6
| | | | | | | Also move the addLibStdCXXIncludePaths helper function from Linux to Generic_GCC. llvm-svn: 250536
* [PS4] Add missing tests for -fsanitize=...Filipe Cabecinhas2015-10-162-0/+34
| | | | llvm-svn: 250516
* PS4: Add tests for rtti/vptr-sanitizer interactionFilipe Cabecinhas2015-10-161-0/+5
| | | | llvm-svn: 250515
* [CMake] Reformat CLANG_TEST_DEPS.NAKAMURA Takumi2015-10-161-1/+7
| | | | llvm-svn: 250503
* [X86] Add fxsr feature name for fxsave/fxrestore builtins.Craig Topper2015-10-162-8/+8
| | | | llvm-svn: 250498
* Make __builtin_object_size more conservativeGeorge Burgess IV2015-10-162-12/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | r246877 made __builtin_object_size substantially more aggressive with unknown bases if Type=1 or Type=3, which causes issues when we encounter code like this: struct Foo { int a; char str[1]; }; const char str[] = "Hello, World!"; struct Foo *f = (struct Foo *)malloc(sizeof(*f) + strlen(str)); strcpy(&f->str, str); __builtin_object_size(&f->str, 1) would hand back 1, which is technically correct given the type of Foo, but the type of Foo lies to us about how many bytes are available in this case. This patch adds support for this "writing off the end" idiom -- we now answer conservatively when we're given the address of the very last member in a struct. Differential Revision: http://reviews.llvm.org/D12169 llvm-svn: 250488
* [Sema] Fix address-of + enable_if overloading logicGeorge Burgess IV2015-10-164-11/+53
| | | | | | | | | | | | | | | | | Previously, our logic when taking the address of an overloaded function would not consider enable_if attributes, so long as all of the enable_if conditions on a given candidate were true. So, two functions with identical signatures (one with enable_if attributes, the other without), would be considered equally good overloads. If we were calling the function instead of taking its address, then the function with enable_if attributes would be preferred. This patch makes us prefer the candidate with enable_if regardless of if we're calling or taking the address of an overloaded function. Differential Revision: http://reviews.llvm.org/D13795 llvm-svn: 250486
* Mark this test as requiring and x86 registered target.Eric Christopher2015-10-161-0/+1
| | | | llvm-svn: 250475
* Add an error when calling a builtin that requires features that don'tEric Christopher2015-10-153-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | match the feature set of the function that they're being called from. This ensures that we can effectively diagnose some[1] code that would instead ICE in the backend with a failure to select message. Example: __m128d foo(__m128d a, __m128d b) { return __builtin_ia32_addsubps(b, a); } compiled for normal x86_64 via: clang -target x86_64-linux-gnu -c would fail to compile in the back end because the normal subtarget features for x86_64 only include sse2 and the builtin requires sse3. [1] We're still not erroring on: __m128i bar(__m128i const *p) { return _mm_lddqu_si128(p); } where we should fail and error on an always_inline function being inlined into a function that doesn't support the subtarget features required. llvm-svn: 250473
* Add llvm-bcanalyzer to list of clang test dependencesTeresa Johnson2015-10-151-1/+1
| | | | | | | This addresses a bot failure from r250455, since new Misc/thinlto.c test uses it. llvm-svn: 250460
* Recommit "Clang support for -flto=thin."Teresa Johnson2015-10-154-17/+89
| | | | | | | | | This recommits r250398 with fixes to the tests for bot failures. Add "-target x86_64-unknown-linux" to the clang invocations that check for the gold plugin. llvm-svn: 250455
* The target-feature command line option doesn't take a comma delimitedEric Christopher2015-10-152-12/+12
| | | | | | string, so split them into multiple options. llvm-svn: 250449
* Add the minimum target features that these tests depend upon.Eric Christopher2015-10-152-3/+3
| | | | llvm-svn: 250448
* Tweak to make clang/test/Driver/ps4-linker-win.c less sinsitive of DLL path.NAKAMURA Takumi2015-10-152-7/+9
| | | | | | | | | | | - On mingw-w64, libstdc++-6.dll is used for clang.exe. The DLL might not be in Windows' system directory. - With --enable-shared, DLLs might be in ${CMAKE_BINARY_DIR}/bin. I understand this test confirms that appropriate name of executable can be found on %PATH%. Therefore I added "Output\\" before each expression. FIXME: The output directory %T is hardcoded like "Output\\ps4-ld.exe". llvm-svn: 250403
* Revert "Clang support for -flto=thin." (bot failures)Teresa Johnson2015-10-154-89/+17
| | | | | | | | | | | Rolling this back for now since there are a couple of bot failures on the new tests I added, and I won't have a chance to look at them in detail until later this afternoon. I think the new tests need some restrictions on having the gold plugin available. This reverts commit r250398. llvm-svn: 250402
* Clang support for -flto=thin.Teresa Johnson2015-10-154-17/+89
| | | | | | | | | | | | | | | | | | | Summary: Add clang support for -flto=thin option, which is used to set the EmitFunctionSummary code gen option on compiles. Add -flto=full as an alias to the existing -flto. Add tests to check for proper overriding of -flto variants on the command line, and convert grep tests to FileCheck. Reviewers: dexonsmith, joker.eph Subscribers: davidxl, cfe-commits Differential Revision: http://reviews.llvm.org/D11908 llvm-svn: 250398
* [X86] Add command line switches for xsave/xsaveopt/xsavec/xsaves. Macro ↵Craig Topper2015-10-153-3/+70
| | | | | | defines for the same. And add the flags to correct CPU names. llvm-svn: 250368
* Tweak a -g related test for the PS4Filipe Cabecinhas2015-10-141-1/+7
| | | | | | | | Make sure we're matching what we want: - Always have -generate-arange-section (independent of -g) - Emit a -dwarf-version=... when -g is there. llvm-svn: 250298
* Bring back r250262: PS4 toolchainFilipe Cabecinhas2015-10-1410-1/+241
| | | | | | | | | | | | | | There was a minor problem with a test. Sorry for the noise yesterday. This patch adds missing pieces to clang, including the PS4 toolchain definition, added warnings, PS4 defaults, and Driver changes needed for our compiler. A patch by Filipe Cabecinhas, Pierre Gousseau and Katya Romanova! Differential Revision: http://reviews.llvm.org/D13482 llvm-svn: 250293
* Revert-to-green r250262 (PS4 toolchain patch)Sean Silva2015-10-1410-239/+0
| | | | | | | It is breaking llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast e.g. http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/1362 llvm-svn: 250273
* Canonicalize some of the x86 builtin tests and either remove or commentEric Christopher2015-10-1431-56/+90
| | | | | | about optimization options. llvm-svn: 250271
OpenPOWER on IntegriCloud