summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* [AVX-512] Remove 128-bit and 256-bit masked floating point add/sub/mul/div ↵Craig Topper2016-09-041-40/+72
| | | | | | | | builtins and replace with native operations. We can't do the 512-bit ones because they take a rounding mode argument that we can't represent. llvm-svn: 280635
* Test case for r280607 to check presence and sanity of the *_LOCK_FREEJoerg Sonnenberger2016-09-041-0/+32
| | | | | | macros. llvm-svn: 280622
* [Modules] Add 'freestanding' to the 'requires-declaration' feature-list.Elad Cohen2016-09-041-0/+6
| | | | | | | | | This adds support for modules that require (non-)freestanding environment, such as the compiler builtin mm_malloc submodule. Differential Revision: https://reviews.llvm.org/D23871 llvm-svn: 280613
* [AVX-512] Remove masked integer mullo builtins and replace with native IR.Craig Topper2016-09-036-18/+36
| | | | llvm-svn: 280597
* [AVX-512] Remove masked integer add/sub builtins and replace with native IR.Craig Topper2016-09-034-49/+98
| | | | llvm-svn: 280596
* Add a test Aaron asked for that I forgot to add before landing r280578.Nico Weber2016-09-031-0/+2
| | | | llvm-svn: 280580
* [ms] Add support for parsing uuid as a Microsoft attribute.Nico Weber2016-09-034-0/+159
| | | | | | | | | | | | | | | | | Some Windows SDK classes, for example Windows::Storage::Streams::IBufferByteAccess, use the ATL way of spelling attributes: [uuid("....")] class IBufferByteAccess {}; To be able to use __uuidof() to grab the uuid off these types, clang needs to support uuid as a Microsoft attribute. There was already code to skip Microsoft attributes, extend that to look for uuid and parse it. Use the new "Microsoft" attribute type added in r280575 (and r280574, r280576) for this. Final part of https://reviews.llvm.org/D23895 llvm-svn: 280578
* (clang part) Implement MASM-flavor intel syntax behavior for inline MS asm ↵Yunzhong Gao2016-09-023-21/+21
| | | | | | | | | | | | | | block. Clang tests for verifying the following syntaxes: 1. 0xNN and NNh are accepted as valid hexadecimal numbers, but 0xNNh is not. 0xNN and NNh may come with optional U or L suffix. 2. NNb is accepted as a valid binary (base-2) number, but 0bNN is not. NNb may come with optional U or L suffix. Differential Revision: https://reviews.llvm.org/D22112 llvm-svn: 280556
* [Sema] Relax overloading restrictions in C.George Burgess IV2016-09-025-27/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows us to perform incompatible pointer conversions when resolving overloads in C. So, the following code will no longer fail to compile (though it will still emit warnings, assuming the user hasn't opted out of them): ``` void foo(char *) __attribute__((overloadable)); void foo(int) __attribute__((overloadable)); void callFoo() { unsigned char bar[128]; foo(bar); // selects the char* overload. } ``` These conversions are ranked below all others, so: A. Any other viable conversion will win out B. If we had another incompatible pointer conversion in the example above (e.g. `void foo(int *)`), we would complain about an ambiguity. Differential Revision: https://reviews.llvm.org/D24113 llvm-svn: 280553
* Implement __attribute__((require_constant_initialization)) for safe static ↵Eric Fiselier2016-09-021-0/+282
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | initialization. Summary: This attribute specifies expectations about the initialization of static and thread local variables. Specifically that the variable has a [constant initializer](http://en.cppreference.com/w/cpp/language/constant_initialization) according to the rules of [basic.start.static]. Failure to meet this expectation will result in an error. Static objects with constant initializers avoid hard-to-find bugs caused by the indeterminate order of dynamic initialization. They can also be safely used by other static constructors across translation units. This attribute acts as a compile time assertion that the requirements for constant initialization have been met. Since these requirements change between dialects and have subtle pitfalls it's important to fail fast instead of silently falling back on dynamic initialization. ```c++ // -std=c++14 #define SAFE_STATIC __attribute__((require_constant_initialization)) static struct T { constexpr T(int) {} ~T(); }; SAFE_STATIC T x = {42}; // OK. SAFE_STATIC T y = 42; // error: variable does not have a constant initializer // copy initialization is not a constant expression on a non-literal type. ``` This attribute can only be applied to objects with static or thread-local storage duration. Reviewers: majnemer, rsmith, aaron.ballman Subscribers: jroelofs, cfe-commits Differential Revision: https://reviews.llvm.org/D23385 llvm-svn: 280525
* Revert r280516 since it contained accidental changes.Eric Fiselier2016-09-021-282/+0
| | | | llvm-svn: 280521
* Implement __attribute__((require_constant_initialization)) for safe static ↵Eric Fiselier2016-09-021-0/+282
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | initialization. Summary: This attribute specifies expectations about the initialization of static and thread local variables. Specifically that the variable has a [constant initializer](http://en.cppreference.com/w/cpp/language/constant_initialization) according to the rules of [basic.start.static]. Failure to meet this expectation will result in an error. Static objects with constant initializers avoid hard-to-find bugs caused by the indeterminate order of dynamic initialization. They can also be safely used by other static constructors across translation units. This attribute acts as a compile time assertion that the requirements for constant initialization have been met. Since these requirements change between dialects and have subtle pitfalls it's important to fail fast instead of silently falling back on dynamic initialization. ```c++ // -std=c++14 #define SAFE_STATIC __attribute__((require_constant_initialization)) static struct T { constexpr T(int) {} ~T(); }; SAFE_STATIC T x = {42}; // OK. SAFE_STATIC T y = 42; // error: variable does not have a constant initializer // copy initialization is not a constant expression on a non-literal type. ``` This attribute can only be applied to objects with static or thread-local storage duration. Reviewers: majnemer, rsmith, aaron.ballman Subscribers: jroelofs, cfe-commits Differential Revision: https://reviews.llvm.org/D23385 llvm-svn: 280516
* Allow a C11 generic selection expression to select a function with the ↵Aaron Ballman2016-09-021-1/+9
| | | | | | overloadable attribute as the result expression without crashing. This fixes PR30201. llvm-svn: 280483
* [WebAssembly] Change wasm SizeType to match asmjsDerek Schuff2016-09-011-20/+20
| | | | | | | | | | | | | | | | Summary: We want wasm and asmjs to have matching ABIs, and right now asmjs uses unsigned int for its size_t. This causes exported symbols in libcxx to not match and can cause weird breakage where libcxx doesn't get linked as a result. Long-term we probably want wasm32, wasm64, and asmjs to all use unsigned long, but that would cause unnecessary ABI churn for asmjs so defer that until we can make all the ABI changes at once. Patch by Jacob Gravelle Differential Revision: https://reviews.llvm.org/D24134 llvm-svn: 280420
* When we reach the end of a #include of a header of a local submodule that weRichard Smith2016-09-011-0/+19
| | | | | | | | | | textually included, create an ImportDecl just as we would if we reached a #include of any other modular header. This is necessary in order to correctly determine the set of variables to initialize for an imported module. This should hopefully make the modules selfhost buildbot green again. llvm-svn: 280409
* [analyzer] ExprEngine: remove second call to PreStmt<CastExpr>Aleksei Sidorin2016-09-011-0/+10
| | | | | | | | | This patch also introduces AnalysisOrderChecker which is intended for testing of callback call correctness. Differential Revision: https://reviews.llvm.org/D23804 llvm-svn: 280367
* [analyzer] Add more FileIDs to PlistDiagnostic map to avoid assertionAleksei Sidorin2016-09-013-0/+150
| | | | | | | | | | | | | Some FileIDs that may be used by PlistDiagnostics were not added while building a list of pieces. This caused assertion violation in GetFID() function. This patch adds some missing FileIDs to avoid the assertion. It also contains small refactoring of PlistDiagnostics::FlushDiagnosticsImpl(). Patch by Aleksei Sidorin, Ilya Palachev. Differential Revision: https://reviews.llvm.org/D22090 llvm-svn: 280360
* [Frontend] Fix mcount inlining bugHonggyu Kim2016-09-012-34/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | Since some profiling tools, such as gprof, ftrace, and uftrace, use -pg option to generate a mcount function call at the entry of each function. Function invocation can be detected by this hook function. But mcount insertion is done before function inlining phase in clang, sometime a function that already has a mcount call can be inlined in the middle of another function. This patch adds an attribute "counting-function" to each function rather than emitting the mcount call directly in frontend so that this attribute can be processed in backend. Then the mcount calls can be properly inserted in backend after all the other optimizations are completed. Link: https://llvm.org/bugs/show_bug.cgi?id=28660 Reviewers: hans, rjmccall, hfinkel, rengolin, compnerd Subscribers: shenhan, cfe-commits Differential Revision: https://reviews.llvm.org/D22666 llvm-svn: 280355
* [Sema] Don't diagnose an array type mismatch when the new or previousAkira Hatanaka2016-09-011-0/+33
| | | | | | | | | | | | declaration has a dependent type. This fixes a bug where clang errors out on a valid code. rdar://problem/28051467 Differential Revision: https://reviews.llvm.org/D24110 llvm-svn: 280330
* Fix all tests under test/CXX (and test/Analysis) to pass if clang's defaultRichard Smith2016-08-3111-57/+241
| | | | | | C++ language standard is not C++98. llvm-svn: 280309
* DR259: Demote the pedantic error for an explicit instantiation after anRichard Smith2016-08-318-43/+33
| | | | | | | | | explicit specialization to a warning for C++98 mode (this is a defect report resolution, so per our informal policy it should apply in C++98), and turn the warning on by default for C++11 and later. In all cases where it fires, the right thing to do is to remove the pointless explicit instantiation. llvm-svn: 280308
* Add -fprofile-dir= to clang.Nick Lewycky2016-08-313-7/+18
| | | | | | | | | | | | | | | | | | | | | -fprofile-dir=path allows the user to specify where .gcda files should be emitted when the program is run. In particular, this is the first flag that causes the .gcno and .o files to have different paths, LLVM is extended to support this. -fprofile-dir= does not change the file name in the .gcno (and thus where lcov looks for the source) but it does change the name in the .gcda (and thus where the runtime library writes the .gcda file). It's different from a GCOV_PREFIX because a user can observe that the GCOV_PREFIX_STRIP will strip paths off of -fprofile-dir= but not off of a supplied GCOV_PREFIX. To implement this we split -coverage-file into -coverage-data-file and -coverage-notes-file to specify the two different names. The !llvm.gcov metadata node grows from a 2-element form {string coverage-file, node dbg.cu} to 3-elements, {string coverage-notes-file, string coverage-data-file, node dbg.cu}. In the 3-element form, the file name is already "mangled" with .gcno/.gcda suffixes, while the 2-element form left that to the middle end pass. llvm-svn: 280306
* DebugInfo: Fix -gsplit-dwarf + -fno-split-dwarf-inliningDavid Blaikie2016-08-311-0/+7
| | | | | | | | | | | I tested the cases involving split-dwarf + gmlt + no-split-dwarf-inlining, but didn't verify the simpler case without gmlt. The logic is, admittedly, a little hairy, but seems about as simple as I could wrangle it. llvm-svn: 280290
* Don't diagnoes a mismatch between implicit and explicit exceptionRichard Smith2016-08-312-3/+18
| | | | | | | specifications under -fno-exceptions, just as we don't diagnose other exception specification mismatch errors. llvm-svn: 280289
* Fix mishandling of deletedness for assignment operators of classes withRichard Smith2016-08-311-1/+2
| | | | | | | | indirect virtual bases. We don't need to be able to invoke such an assignment operator from the derived class, and we shouldn't delete the derived assignment op if we can't do so. llvm-svn: 280288
* [codeview] Don't emit vshape info for classes without vfptrsReid Kleckner2016-08-311-0/+54
| | | | | | | | | | | | Classes with no virtual methods or whose virtual methods were all inherited from virtual bases don't have a vfptr at offset zero. We were crashing attempting to get the layout of that non-existent vftable. We don't need any vshape info in this case because the debugger can infer it from the base class information. The current class may not introduce any virtual methods if we are in this situation. llvm-svn: 280287
* Revert "Driver: use the canonical static library naming"Saleem Abdulrasool2016-08-312-6/+6
| | | | | | | | This breaks chromium and its unclear if this is actually a modern convention. This reverts SVN r280169. llvm-svn: 280281
* [codeview] Pass through vftable shape informationReid Kleckner2016-08-311-1/+8
| | | | | | | | | | | | | | | The shape is really just the number of methods in the vftable, since we don't support 16 bit far calls. All calls are near. Encode this number in the size of the artificial __vtbl_ptr_type DIDerivedType that we generate. For DWARF, this will be a normal pointer, but for codeview this will be a wide pointer that gets pattern matched into a VFTableShape record. Insert this type into the element list of all dynamic classes when emitting CodeView, so that the backend can emit the shape even if the vptr lives in a primary base class. Fixes PR28150 llvm-svn: 280255
* Revision r280064 adds new options -fdenormal-fp-math and passes through optionSjoerd Meijer2016-08-311-0/+3
| | | | | | | | | -ffast-math to CC1, but it included a wrong llvm regression tests which was removed in r280065. Although regression test noexceptionsfpmath.c makes sure -fno-trapping-math ends up as a function attribute, this adds a test that explicitly checks the driver output for -fno-trapping-math. llvm-svn: 280227
* Attempt to pacify buildbots after r280217James Molloy2016-08-312-4/+4
| | | | | | | | These clang tests check diagnostics from the backend by giving it an unvectorizable loop. This loop is now vectorized :/ Make it really unvectorizable by making it unprofitable to ifconvert. llvm-svn: 280220
* [Coverage] Suppress creating a code region if the same area is covered by an ↵Igor Kudrin2016-08-312-7/+10
| | | | | | | | | | | | expansion region. In most cases these code regions are just redundant, but sometimes they could be assigned to the counter of the parent code region instead of the counter of the nested block. Differential Revision: https://reviews.llvm.org/D23987 llvm-svn: 280199
* [AVX-512] Implement masked floating point logical operations with native IR ↵Craig Topper2016-08-312-49/+121
| | | | | | and remove the builtins. llvm-svn: 280197
* [X86] Use v2i64 vectors to implement _mm_and/andn/or/xor_pd.Craig Topper2016-08-311-5/+5
| | | | | | These will be reused when removing some builtins from avx512vldqintrin.h and this will make the tests for that change show a better number of vector elements. llvm-svn: 280196
* PR12298 et al: don't recursively instantiate a template specialization fromRichard Smith2016-08-313-22/+105
| | | | | | | | | | | | | | | within the instantiation of that same specialization. This could previously happen for eagerly-instantiated function templates, variable templates, exception specifications, default arguments, and a handful of other cases. We still have an issue here for default template arguments that recursively make use of themselves and likewise for substitution into the type of a non-type template parameter, but in those cases we're producing a different entity each time, so they should instead be caught by the instantiation depth limit. However, currently we will typically run out of stack before we reach it. :( llvm-svn: 280190
* Concatenate two FileCheck lines in a test.Richard Trieu2016-08-311-8/+4
| | | | | | | | | 'cc1' is a valid sequence of hexadecimal and sometimes can occur in the path when testing. This can lead to FileCheck matching the incorrect occurance of the 'cc1' string and causing a test failure. Join two adjacent flags together into one check to prevent this. llvm-svn: 280189
* Don't try to run a test that generates code for x86 if it's not a registered ↵Richard Smith2016-08-301-0/+2
| | | | | | target. llvm-svn: 280178
* [analyzer] Use lazily created buffer in EmptyLocalizationContextCheckerDevin Coughlin2016-08-302-1/+12
| | | | | | | | | | | Fix a crash when relexing the underlying memory buffer to find incorrect arguments to NSLocalizedString(). With precompiled headers, the raw buffer may be NULL. Instead, use the source manager to get the buffer, which will lazily create the buffer for precompiled headers. rdar://problem/27429091 llvm-svn: 280174
* Driver: use the canonical static library namingSaleem Abdulrasool2016-08-302-6/+6
| | | | | | | | | | On Windows, static libraries are named lib<name>.lib while import libraries are named <name>.lib. Use the appropriate naming on itanium and msvc environments. This is setup properly so that if a dynamic builtins is used on Windows, it would do the right thing, although this is not currently wired through the driver (i.e. there is no equivalent to -{shared,static}-gcc). llvm-svn: 280169
* [Modules] Add 'gnuinlineasm' to the 'requires-declaration' feature-list.Bruno Cardoso Lopes2016-08-304-0/+26
| | | | | | | | | | | | | This adds support for modules that require (no-)gnu-inline-asm environment, such as the compiler builtin cpuid submodule. This is the gnu-inline-asm variant of https://reviews.llvm.org/D23871 Differential Revision: https://reviews.llvm.org/D23905 rdar://problem/26931199 llvm-svn: 280159
* [test] Pass a fake libLTO.dylib to a driver test which depends on itVedant Kumar2016-08-301-7/+7
| | | | | | | This makes it possible to run 'check-clang' on Darwin without building libLTO.dylib. See r280142 for more context. llvm-svn: 280150
* Revert "[test] Add libLTO as a clang test dependency on Darwin"Vedant Kumar2016-08-301-4/+0
| | | | | | | | This reverts commit r280142. Mehdi suggested a better way to fix up the test: just create a fake libLTO.dylib and tell the driver where to find it. Patch incoming... llvm-svn: 280149
* [test] Add libLTO as a clang test dependency on DarwinVedant Kumar2016-08-301-0/+4
| | | | | | | | | | | | | Running 'check-clang' on a stock checkout of llvm+clang doesn't work on Darwin, because test/Driver/darwin-ld-lto.c can't find libLTO.dylib. Add libLTO as a clang test dependency on Darwin to fix the problem. Note: We don't have this issue with check-all because libLTO is in the test-depends target. Differential Revision: https://reviews.llvm.org/D24042 llvm-svn: 280142
* PR29166: when merging declarations with typedef names for linkage purposes,Richard Smith2016-08-301-0/+1
| | | | | | | don't assume that the anonymous struct will be part of the most recent declaration of the typedef. llvm-svn: 280136
* Unrevert r280035 now that the clang-cl bug it exposed has been fixed byRichard Smith2016-08-302-2/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r280133. Original commit message: C++ Modules TS: driver support for building modules. This works as follows: we add --precompile to the existing gamut of options for specifying how far to go when compiling an input (-E, -c, -S, etc.). This flag specifies that an input is taken to the precompilation step and no further, and this can be specified when building a .pcm from a module interface or when building a .pch from a header file. The .cppm extension (and some related extensions) are implicitly recognized as C++ module interface files. If --precompile is /not/ specified, the file is compiled (via a .pcm) to a .o file containing the code for the module (and then potentially also assembled and linked, if -S, -c, etc. are not specified). We do not yet suppress the emission of object code for other users of the module interface, so for now this will only work if everything in the .cppm file has vague linkage. As with the existing support for module-map modules, prebuilt modules can be provided as compiler inputs either via the -fmodule-file= command-line argument or via files named ModuleName.pcm in one of the directories specified via -fprebuilt-module-path=. This also exposes the -fmodules-ts cc1 flag in the driver. This is still experimental, and in particular, the concrete syntax is subject to change as the Modules TS evolves in the C++ committee. Unlike -fmodules, this flag does not enable support for implicitly loading module maps nor building modules via the module cache, but those features can be turned on separately and used in conjunction with the Modules TS support. llvm-svn: 280134
* PR30195: Fix clang-cl attempting to precompile bogus (non-precompilable) ↵Richard Smith2016-08-301-24/+27
| | | | | | input types. llvm-svn: 280133
* Disable clang/test/SemaTemplate/instantiation-depth-default.cpp temporarily ↵NAKAMURA Takumi2016-08-301-0/+3
| | | | | | for targeting mingw32. It crashes. Investigating. llvm-svn: 280104
* Fix typo in commentNico Weber2016-08-301-1/+1
| | | | llvm-svn: 280094
* Revert r280035 (and followups r280057, r280085), it caused PR30195Nico Weber2016-08-302-40/+2
| | | | llvm-svn: 280091
* Handle -mlong-calls on HexagonKrzysztof Parzyszek2016-08-301-0/+15
| | | | | | Differential Revision:://reviews.llvm.org/D22766 llvm-svn: 280089
* clang/test/Driver/modules-ts.cpp: Satisfy quoted filename.NAKAMURA Takumi2016-08-301-1/+1
| | | | | | | | On win32, backslashed filename is emitted like; -o "C:\\bb-win\\ninja-clang-i686-msc19-R\\build\\tools\\clang\\test\\Driver\\Output\\modules-ts.cpp.tmp.o" llvm-svn: 280085
OpenPOWER on IntegriCloud