summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Honor the casted-to alignment of an explicit cast even whenJohn McCall2015-09-291-0/+8
| | | | | | | | | Sema thinks the cast is a no-op, as it does when (e.g.) the only thing that changes is an alignment attribute. Fixed PR24944. llvm-svn: 248775
* [OPENMP 4.1] Codegen for ‘simd’ clause in ‘ordered’ directive.Alexey Bataev2015-09-291-0/+17
| | | | | | | | | | | Description. If the simd clause is specified, the ordered regions encountered by any thread will use only a single SIMD lane to execute the ordered regions in the order of the loop iterations. Restrictions. An ordered construct with the simd clause is the only OpenMP construct that can appear in the simd region. An ordered directive with ‘simd’ clause is generated as an outlined function and corresponding function call to prevent this part of code from vectorization later in backend. llvm-svn: 248772
* [CUDA] 32-bit NVPTX should have 32-bit long type.Artem Belevich2015-09-283-18/+17
| | | | | | | | | Currently it's 64-bit which will lead to mismatch between host and device code if we compile for i386. Differential Revision: http://reviews.llvm.org/D13181 llvm-svn: 248753
* Generate assume loads only with -fstrict-vtable-pointersPiotr Padlewski2015-09-281-2/+3
| | | | | | | Temporary fix till InstCombine and other possible passes will be efficient to handle multiple assumes. llvm-svn: 248734
* [OPENMP 4.1] Add 'simd' clause for 'ordered' directive.Alexey Bataev2015-09-282-0/+182
| | | | | | | | | | | Parsing and sema analysis for 'simd' clause in 'ordered' directive. Description If the simd clause is specified, the ordered regions encountered by any thread will use only a single SIMD lane to execute the ordered regions in the order of the loop iterations. Restrictions An ordered construct with the simd clause is the only OpenMP construct that can appear in the simd region llvm-svn: 248696
* clang/test/Driver/arm-compiler-rt.c: Relax expressions for dos path.NAKAMURA Takumi2015-09-261-7/+7
| | | | llvm-svn: 248666
* Driver: support ARM/HF on a single toolchainSaleem Abdulrasool2015-09-261-0/+21
| | | | | | | | | | | | | | | | | ARM EABI adds target attributes to the object file. Amongst the attributes that are emitted is the VFP argument passing (Hard vs Soft). The linker is responsible for checking these attributes and erroring on mismatches. This causes problems for the compiler-rt builtins when targeting both hard and soft. Because both of these options name the builtins compiler-rt component the same (libclang_rt.builtins-arm.a or libclang_rt.builtins-arm-android). GCC is able to get away with this as it does one target per toolchain. This changes the naming convention for the ARM compiler-rt builtins to differentiate between HF and Soft. Although this means that compiler-rt may be duplicated, it enables supporting both variants from a single toolchain. A similar approach is taken by the Darwin toolchain, naming the library to differentiate between the calling conventions. llvm-svn: 248649
* Change arc-cxx11-init-list.mm to work with upcoming SCEV changes.Sanjoy Das2015-09-251-2/+0
| | | | | | | | | | | | | | | Summary: The store being checked for in arc-cxx11-init-list.mm is a store to an unescaped alloca. After an uncoming change to ScalarEvolution, LLVM is able to elide the store, so adjust the test accordingly. Reviewers: compnerd Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D13183 llvm-svn: 248632
* Relax test to allow for __attribute__((thiscall)). Under Win32 c-index-test ↵Yaron Keren2015-09-251-2/+2
| | | | | | | | | output is CXXMethod=foo:4:7 (unavailable) [type=int () __attribute__((thiscall))] [typekind=FunctionProto] [resulttype=int] [resulttypekind=Int] [isPOD=0] CXXConstructor=Foo:5:3 (unavailable) [type=void () __attribute__((thiscall))] [typekind=FunctionProto] [resulttype=void] [resulttypekind=Void] [isPOD=0] llvm-svn: 248626
* Fix bug on reporting availability of deleted methods in libclang.Manuel Klimek2015-09-251-0/+13
| | | | | | Patch by Sergey Kalinichev. llvm-svn: 248596
* Make incomplete type errors better with enable_ifGeorge Burgess IV2015-09-251-1/+9
| | | | | | | | | | | | This patch fixes the order in which we evaluate the different ways that a function call could be disallowed. Now, if you call a non-overloaded function with an incomplete type and failing enable_if, we'll prioritize reporting the more obvious error (use of incomplete type) over reporting the failing enable_if. Thanks to Ettore Speziale for the patch! llvm-svn: 248595
* Revert "This patch adds missing pieces to clang, including the PS4 toolchain ↵Greg Bedwell2015-09-259-208/+1
| | | | | | | | definition, added warnings, PS4 defaults, and Driver changes needed for our compiler." This reverts commit r248546 to get our bot green again while we discuss the best way forward. llvm-svn: 248578
* [OPENMP 4.1] Add 'threads' clause for '#pragma omp ordered'.Alexey Bataev2015-09-253-2/+74
| | | | | | | | OpenMP 4.1 extends format of '#pragma omp ordered'. It adds 3 additional clauses: 'threads', 'simd' and 'depend'. If no clause is specified, the ordered construct behaves as if the threads clause had been specified. If the threads clause is specified, the threads in the team executing the loop region execute ordered regions sequentially in the order of the loop iterations. The loop region to which an ordered region without any clause or with a threads clause binds must have an ordered clause without the parameter specified on the corresponding loop directive. llvm-svn: 248569
* New test ps4-linker-win.c (added in r48546) is causing problems for Windows ↵Ekaterina Romanova2015-09-251-26/+0
| | | | | | bots. I'm deleting this file during investigation. llvm-svn: 248567
* This patch adds missing pieces to clang, including the PS4 toolchainEkaterina Romanova2015-09-2410-1/+234
| | | | | | | | | | | 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/D11279 llvm-svn: 248546
* Recommit r248154: [ARM] Handle DSP feature as an ArchExtKindArtyom Skrobov2015-09-241-12/+14
| | | | | | | | | | | | | | | | Currently, the availability of DSP instructions (ACLE 6.4.7) is handled in a hand-rolled tricky condition block in lib/Basic/Targets.cpp, with a FIXME: attached. http://reviews.llvm.org/D12937 moved the handling of the DSP feature over to ARMTargetParser.def in LLVM, to be in line with other architecture extensions. This is the corresponding patch to clang, to clear the FIXME: and update the tests. Differential Revision: http://reviews.llvm.org/D12938 llvm-svn: 248521
* Enable SafeStack on all Linux platforms.Evgeniy Stepanov2015-09-241-0/+2
| | | | llvm-svn: 248518
* [analyzer] When memcpy'ing into a fixed-size array, do not invalidate entire ↵Devin Coughlin2015-09-241-0/+916
| | | | | | | | | | | | | | | | | | | | region. Change the analyzer's modeling of memcpy to be more precise when copying into fixed-size array fields. With this change, instead of invalidating the entire containing region the analyzer now invalidates only offsets for the array itself when it can show that the memcpy stays within the bounds of the array. This addresses false positive memory leak warnings of the kind reported by krzysztof in https://llvm.org/bugs/show_bug.cgi?id=22954 (This is the second attempt, now with assertion failures resolved.) A patch by Pierre Gousseau! Differential Revision: http://reviews.llvm.org/D12571 llvm-svn: 248516
* Module Debugging: Emit submodules as nested DW_TAG_modules.Adrian Prantl2015-09-242-5/+22
| | | | llvm-svn: 248511
* [mips] Relax -mnan=2008 acceptance to permit MIPS32R2 and MIPS64R2.Daniel Sanders2015-09-241-13/+33
| | | | | | | | | | | | | | | Summary: Strictly speaking, the MIPS*R2 ISA's should not permit -mnan=2008 since this feature was added in MIPS*R3. However, other toolchains permit this and we should do the same. Reviewers: atanasyan Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D13057 llvm-svn: 248481
* clang/test/Analysis/malloc-overflow2.c: Appease 32-bit targets.NAKAMURA Takumi2015-09-241-1/+1
| | | | | | size_t is not unsigned long for targeting i686 (and Windows x64). llvm-svn: 248458
* Make a test a bit shorter. No behavior change.Nico Weber2015-09-241-5/+1
| | | | llvm-svn: 248456
* Improve the printing of ranges when macros are involved.Richard Trieu2015-09-245-68/+73
| | | | | | | | | | | | Trace the ranges through the macro backtrace better. This allows better range highlighting through all levels of the macro bracktrace. Also some improvements to backtrace printer for omitting different backtraces. Patch by Zhengkai Wu. Differential Revision: http://reviews.llvm.org/D12379 llvm-svn: 248454
* Disabled one of the test runs in cuda-detect.cuArtem Belevich2015-09-241-2/+0
| | | | | | | --sysroot apparently can't handle long paths which triggers test failure on some platforms. llvm-svn: 248448
* [analyzer] Discard malloc-overflow bug-report when a known size is malloc'ed.Devin Coughlin2015-09-232-1/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch ignores malloc-overflow bug in two cases: Case1: x = a/b; where n < b malloc (x*n); Then x*n will not overflow. Case2: x = a; // when 'a' is a known value. malloc (x*n); Also replaced isa with dyn_cast. Reject multiplication by zero cases in MallocOverflowSecurityChecker Currently MallocOverflowSecurityChecker does not catch cases like: malloc(n * 0 * sizeof(int)); This patch rejects such cases. Two test cases added. malloc-overflow2.c has an example inspired from a code in linux kernel where the current checker flags a warning while it should not. A patch by Aditya Kumar! Differential Revision: http://reviews.llvm.org/D9924 llvm-svn: 248446
* Forbid qualifiers on ObjC generic parameters and arguments, butJohn McCall2015-09-232-0/+226
| | | | | | | | | | | | | | silently ignore them on arguments when they're provided indirectly (.e.g behind a template argument or typedef). This is mostly just good language design --- specifying that a generic argument is __weak doesn't actually do anything --- but it also prevents assertions when trying to apply a different ownership qualifier. rdar://21612439 llvm-svn: 248436
* Remove warning on over-wide bit-field of boolean type; there's no risk thatRichard Smith2015-09-233-6/+6
| | | | | | | | | | someone thought all the bits would be value bits in this case. Also fix the wording of the warning -- it claimed that the width of 'bool' is 8, which is not correct; the width is 1 bit, whereas the size is 8 bits in our implementation. llvm-svn: 248435
* [CUDA] Added CUDA installation detector class.Artem Belevich2015-09-235-0/+12
| | | | | | | | | | | Added new option --cuda-path=<path> which allows overriding default search paths. If it's not specified we look for CUDA installation in /usr/include/cuda and /usr/include/cuda-7.0. Differential Revision: http://reviews.llvm.org/D12989 llvm-svn: 248433
* [analyzer] Improve localizability checks for iOS / OS X.Devin Coughlin2015-09-232-10/+154
| | | | | | | | | | | | | | | | | | | | Various improvements to the localization checker: * Adjusted copy to be consistent with diagnostic text in other Apple API checkers. * Added in ~150 UIKit / AppKit methods that require localized strings in UnlocalizedStringsChecker. * UnlocalizedStringChecker now checks for UI methods up the class hierarchy and UI methods that conform for a certain Objective-C protocol. * Added in alpha version of PluralMisuseChecker and some regression tests. False positives are still not ideal. (This is the second attempt, with the memory issues on Linux resolved.) A patch by Kulpreet Chilana! Differential Revision: http://reviews.llvm.org/D12417 llvm-svn: 248432
* PR14858: Initial support for proper sizeof... handling within alias templates.Richard Smith2015-09-232-1/+31
| | | | | | | This doesn't quite get alias template equivalence right yet, but handles the egregious cases where we would silently give the wrong answers. llvm-svn: 248431
* Support linking against OpenMP runtime on NetBSD.Joerg Sonnenberger2015-09-231-0/+12
| | | | llvm-svn: 248426
* Push OpenMP linker flags after linker input on Darwin. Don't add anyJoerg Sonnenberger2015-09-231-0/+25
| | | | | | libraries if -nostdlib is specified. Test. llvm-svn: 248424
* Reverted r248408 "[CUDA] Added CUDA installation detector class."Artem Belevich2015-09-235-6/+0
| | | | | | because included test fails on some platforms. llvm-svn: 248413
* [CUDA] Added CUDA installation detector class.Artem Belevich2015-09-235-0/+6
| | | | | | | | | | | Added new option --cuda-path=<path> which allows overriding default search paths. If it's not specified we look for CUDA installation in /usr/include/cuda and /usr/include/cuda-7.0. Differential Revision: http://reviews.llvm.org/D12989 llvm-svn: 248408
* [CUDA] __global__ functions should always be visible externally.Artem Belevich2015-09-231-6/+1
| | | | | | | | | Adjust __global__ functions with DiscardableODR linkage to use StrongODR linkage instead, so they are visible externally. Differential Revision: http://reviews.llvm.org/D13067 llvm-svn: 248400
* [Lex] A source-file new-line in a raw string literal results in a new-lineDavid Majnemer2015-09-231-0/+17
| | | | | | | | | Our string literal parser copied any source-file new-line characters into the execution string-literal. This is incorrect if the source-file new-line character was a \r\n sequence because new-line characters are merely \n. llvm-svn: 248392
* [Sema] Don't create an invalid source range for overlong initializer lists.Benjamin Kramer2015-09-231-0/+4
| | | | | | | | | We took both source locations from the end of the initializer list what the code below doesn't expect. This can lead to a crash when rendering the diagnostic (PR24816). Assert that we have more than one element in a scalar initializer with too many elements. llvm-svn: 248391
* Add -fplugin=name.so option to the driverJohn Brawn2015-09-231-0/+7
| | | | | | | | This translates to -load name.so in the cc1 command. We can't name the driver option -load, as that means "link against oad", so instead we follow GCC's lead and name the option -fplugin. llvm-svn: 248378
* [DeclPrinter] Don't crash when printing a using decl with a special nameBenjamin Kramer2015-09-231-0/+8
| | | | | | Fixes PR24872. llvm-svn: 248376
* [ARM] Fix crash "-target arm -mcpu=generic", without "-march="Vladimir Sukharev2015-09-232-0/+17
| | | | | | | | | | | | | | | | An assertion hit has been fixed for cmdlines like $ clang --target=arm-linux-gnueabi -mcpu=generic hello.c Related to: http://reviews.llvm.org/rL245445 Reviewers: rengolin Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D13013 llvm-svn: 248370
* Make ms-intrin.cpp test require the x86 target.Nico Weber2015-09-231-0/+2
| | | | llvm-svn: 248355
* Revert "[analyzer] Improve localizability checks for iOS / OS X."Devin Coughlin2015-09-232-154/+10
| | | | | | This reverts commit r248350. The pluralization checks are failing on some bots. llvm-svn: 248351
* [analyzer] Improve localizability checks for iOS / OS X.Devin Coughlin2015-09-222-10/+154
| | | | | | | | | | | | | | | | | | Various improvements to the localization checker: * Adjusted copy to be consistent with diagnostic text in other Apple API checkers. * Added in ~150 UIKit / AppKit methods that require localized strings in UnlocalizedStringsChecker. * UnlocalizedStringChecker now checks for UI methods up the class hierarchy and UI methods that conform for a certain Objective-C protocol. * Added in alpha version of PluralMisuseChecker and some regression tests. False positives are still not ideal. A patch by Kulpreet Chilana! Differential Revision: http://reviews.llvm.org/D12417 llvm-svn: 248350
* Module Debugging: Use the clang module signature as the module's dwo_idAdrian Prantl2015-09-223-5/+13
| | | | | | | | | | | when building a module. Clang already records the module signature when building a skeleton CU to reference a clang module. Matching the id in the skeleton with the one in the module allows a DWARF consumer to verify that they found the correct version of the module without them needing to know about the clang module format. llvm-svn: 248345
* [analyzer] Make realloc(ptr, 0) handling equivalent to malloc(0).Devin Coughlin2015-09-221-3/+31
| | | | | | | | | | | | | | | | | | Currently realloc(ptr, 0) is treated as free() which seems to be not correct. C standard (N1570) establishes equivalent behavior for malloc(0) and realloc(ptr, 0): "7.22.3 Memory management functions calloc, malloc, realloc: If the size of the space requested is zero, the behavior is implementation-defined: either a null pointer is returned, or the behavior is as if the size were some nonzero value, except that the returned pointer shall not be used to access an object." The patch equalizes the processing of malloc(0) and realloc(ptr,0). The patch also enables unix.Malloc checker to detect references to zero-allocated memory returned by realloc(ptr,0) ("Use of zero-allocated memory" warning). A patch by Антон Ярцев! Differential Revision: http://reviews.llvm.org/D9040 llvm-svn: 248336
* [analyzer] Create one state for a range switch case instead of multiple.Devin Coughlin2015-09-221-0/+220
| | | | | | | | | | | | | This fixes PR16833, in which the analyzer was using large amounts of memory for switch statements with large case ranges. rdar://problem/14685772 A patch by Aleksei Sidorin! Differential Revision: http://reviews.llvm.org/D5102 llvm-svn: 248318
* Analyzer: Teach analyzer how to handle TypeTraitExprIsmail Pazarbasi2015-09-221-1/+36
| | | | | | | | | | | | | | | | | | | | Summary: `TypeTraitExpr`s are not supported by the ExprEngine today. Analyzer creates a sink, and aborts the block. Therefore, certain bugs that involve type traits intrinsics cannot be detected (see PR24710). This patch creates boolean `SVal`s for `TypeTraitExpr`s, which are evaluated by the compiler. Test within the patch is a summary of PR24710. Reviewers: zaks.anna, dcoughlin, krememek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D12482 llvm-svn: 248314
* [CUDA] Allow parsing of host and device code simultaneously.Artem Belevich2015-09-221-19/+14
| | | | | | | | | | | | * adds -aux-triple option to specify target triple * propagates aux target info to AST context and Preprocessor * pulls in target specific preprocessor macros. * pulls in target-specific builtins from aux target. * sets appropriate host or device attribute on builtins. Differential Revision: http://reviews.llvm.org/D12917 llvm-svn: 248299
* [CUDA] Fixes minor cuda-related issues in the driverArtem Belevich2015-09-221-2/+20
| | | | | | | | | | * Only the last of the --cuda-host-only/--cuda-device-only options has effect. * CudaHostAction always wraps host-side compilation now. * Fixed printing of empty action lists. Differential Revision: http://reviews.llvm.org/D12892 llvm-svn: 248297
* [CUDA] Add appropriate host/device attribute to builtins.Artem Belevich2015-09-222-3/+42
| | | | | | | | | The changes are part of attribute-based CUDA function overloading (D12453) and as such are only enabled when it's in effect (-fcuda-target-overloads). Differential Revision: http://reviews.llvm.org/D12122 llvm-svn: 248296
OpenPOWER on IntegriCloud