summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* [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
* [CUDA] Allow function overloads in CUDA based on host/device attributes.Artem Belevich2015-09-222-0/+531
| | | | | | | | | | | | | | | | | | | The patch makes it possible to parse CUDA files that contain host/device functions with identical signatures, but different attributes without having to physically split source into host-only and device-only parts. This change is needed in order to parse CUDA header files that have a lot of name clashes with standard include files. Gory details are in design doc here: https://goo.gl/EXnymm Feel free to leave comments there or in this review thread. This feature is controlled with CC1 option -fcuda-target-overloads and is disabled by default. Differential Revision: http://reviews.llvm.org/D12453 llvm-svn: 248295
* [CUDA] Add implicit __attribute__((used)) to all __global__ functions.Artem Belevich2015-09-221-0/+15
| | | | | | | | | | This makes sure that we emit kernels that were instantiated from the host code and which would never be explicitly referenced by anything else on device side. Differential Revision: http://reviews.llvm.org/D11666 llvm-svn: 248293
* [mips] Added support for using the command line options -Wa,-msoft-float and ↵Daniel Sanders2015-09-221-0/+25
| | | | | | | | | | | | | | -Wa,-mhard-float. Patch by Scott Egerton. Reviewers: vkalintiris, dsanders Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D12600 llvm-svn: 248276
* Add bug number to FIXME comment.Nico Weber2015-09-221-1/+1
| | | | llvm-svn: 248235
* ms Intrin.h: Fix __movsw's and __stosw's inline asm.Nico Weber2015-09-221-2/+34
| | | | | | | | | | | Before, clang's internal assembler would reject the inline asm in clang's Intrin.h. To make sure this doesn't happen for other Intrin.h functions using __asm__ blocks, add 32-bit and 64-bit codegen tests for Intrin.h. Sadly, these tests discovered that __readcr3 and __writecr3 have bad implementations in 64-bit builds. This will have to be fixed in a follow-up. llvm-svn: 248234
* Remove attributes minsize and optsize, which conflict with optnone.Akira Hatanaka2015-09-211-0/+18
| | | | | | | | | | | This commit fixes an assert that is triggered when optnone is being added to an IR function that is already marked with minsize and optsize. rdar://problem/22723716 Differential Revision: http://reviews.llvm.org/D13004 llvm-svn: 248191
* Add a belated testcase for the skeleton CU behavior in r248062.Adrian Prantl2015-09-211-2/+20
| | | | llvm-svn: 248185
* Debug Info: When building a module, emit skeleton CUs for imported modules.Adrian Prantl2015-09-211-0/+15
| | | | llvm-svn: 248184
* Revert "[ARM] Handle +t2dsp feature as an ArchExtKind in ARMTargetParser.def"James Molloy2015-09-211-14/+12
| | | | | | | | This was committed without the code review (http://reviews.llvm.org/D12938) being approved. This reverts commit r248154. llvm-svn: 248173
* Fix assertion in inline assembler IR genAlexander Musman2015-09-211-0/+12
| | | | | | | Several inputs may not refer to one output constraint in inline assembler insertions, clang was failing on assertion on such test case. llvm-svn: 248158
* [ARM] Handle +t2dsp feature as an ArchExtKind in ARMTargetParser.defArtyom Skrobov2015-09-211-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 +t2dsp 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: 248154
* clang/test/Modules/DebugInfoSubmodules.c REQUIRES asserts due to -debug-only.NAKAMURA Takumi2015-09-211-0/+1
| | | | llvm-svn: 248142
* Module debugging: Support submodules in the PCM/PCH debug info.Adrian Prantl2015-09-204-0/+32
| | | | llvm-svn: 248127
* [X86][SSE] Replace 128-bit SSE41 PMOVSX intrinsics with native IRSimon Pilgrim2015-09-192-12/+6
| | | | | | | | | | 128-bit vector integer sign extensions correctly lower to the pmovsx instructions even for debug builds. This patch removes the builtins and reimplements the _mm_cvtepi*_epi* intrinsics __using builtin_shufflevector (to extract the bottom most subvector) and __builtin_convertvector (to actually perform the sign extension). Differential Revision: http://reviews.llvm.org/D12835 llvm-svn: 248092
* [Modules] More descriptive diagnostics for misplaced import directiveSerge Pavlov2015-09-1911-12/+49
| | | | | | | | | | If an import directive was put into wrong context, the error message was obscure, complaining on misbalanced braces. To get more descriptive messages, annotation tokens related to modules are processed where they must not be seen. Differential Revision: http://reviews.llvm.org/D11844 llvm-svn: 248085
* Add test that we correctly allow some non-letter unicode characters inRichard Smith2015-09-191-1/+10
| | | | | | identifiers, and extend existing test to also cover C++. llvm-svn: 248079
* [Static Analyzer] Fixed a false positive case in DynamicTypeChecker when ↵Gabor Horvath2015-09-181-0/+10
| | | | | | dealing with forward declarations. llvm-svn: 248065
* Split off the binary literal warning into a subgroup of C++14 warningsRichard Trieu2015-09-181-0/+5
| | | | | | | | | Binary literals predate C++14, but they are listed as a C++14 extension since this was the first time they were standardized in the language. Move the warning into a subgroup so it can be selectively disabled when checking for other C++14 features. llvm-svn: 248064
* Relax the test to get it passing with windows paths.Rafael Espindola2015-09-181-1/+1
| | | | llvm-svn: 248051
OpenPOWER on IntegriCloud