summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
...
* When attempting to complete an incomplete array bound type in an expression,Richard Smith2017-12-141-0/+11
| | | | | | | | | | update the type from the definition even if we didn't instantiate a definition. We may have instantiated the definition in an earlier stage of semantic analysis, after creating the DeclRefExpr but before we reach a point where a complete expression type is required. llvm-svn: 320709
* [c++20] P0515R3: Parsing support and basic AST construction for operator <=>.Richard Smith2017-12-145-0/+243
| | | | | | | | | | | | | | | Adding the new enumerator forced a bunch more changes into this patch than I would have liked. The -Wtautological-compare warning was extended to properly check the new comparison operator, clang-format needed updating because it uses precedence levels as weights for determining where to break lines (and several operators increased their precedence levels with this change), thread-safety analysis needed changes to build its own IL properly for the new operator. All "real" semantic checking for this operator has been deferred to a future patch. For now, we use the relational comparison rules and arbitrarily give the builtin form of the operator a return type of 'void'. llvm-svn: 320707
* Renamed test file to use proper naming conventionIlya Biryukov2017-12-141-1/+1
| | | | | | | Also changed the order of CHECK statements. CHEKC-NOT must come before CHECK in skipped-function-bodies.cpp llvm-svn: 320702
* Warn if we find a Unicode homoglyph for a symbol in an identifier.Richard Smith2017-12-141-0/+5
| | | | | | | | | | | | | | | | Specifically, warn if: * we find a character that the language standard says we must treat as an identifier, and * that character is not reasonably an identifier character (it's a punctuation character or similar), and * it renders identically to a valid non-identifier character in common fixed-width fonts. Some tools "helpfully" substitute the surprising characters for the expected characters, and replacing semicolons with Greek question marks is a common "prank". llvm-svn: 320697
* [Frontend] Treat function with skipped body as definitionIlya Biryukov2017-12-141-0/+9
| | | | | | | | | | | | | | | | Summary: This fixes an invalid warning about missing definition of a function when parsing with SkipFunctionBodies=true Reviewers: bkramer, sepavloff Reviewed By: sepavloff Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D41189 llvm-svn: 320696
* IRGen: When performing CFI checks, load vtable pointer from vbase when ↵Peter Collingbourne2017-12-132-0/+56
| | | | | | | | | | | | | | necessary. Under the Microsoft ABI, it is possible for an object not to have a virtual table pointer of its own if all of its virtual functions were introduced by virtual bases. In that case, we need to load the vtable pointer from one of the virtual bases and perform the type check using its type. Differential Revision: https://reviews.llvm.org/D41036 llvm-svn: 320638
* [OPENMP] Add codegen for `nowait` clause in target directives.Alexey Bataev2017-12-138-16/+16
| | | | | | Added basic codegen for `nowait` clauses in target-based directives. llvm-svn: 320613
* [Hexagon] Intrinsic support for V62 and V65Krzysztof Parzyszek2017-12-131-1866/+2276
| | | | llvm-svn: 320609
* [OPENMP] Initial codegen for `target teams distribute simd` directive.Alexey Bataev2017-12-139-0/+2842
| | | | | | | Host + generic device codegen for `target teams distribute simd` directive. llvm-svn: 320608
* [OPENMP] Support `reduction` clause on target-based directives.Alexey Bataev2017-12-133-44/+508
| | | | | | | OpenMP 5.0 added support for `reduction` clause in target-based directives. Patch adds this support to clang. llvm-svn: 320596
* [OPENMP] Fix handling of clauses in clause parsing mode.Alexey Bataev2017-12-137-204/+157
| | | | | | | The compiler may generate incorrect code if we try to capture the variable in clause parsing mode. llvm-svn: 320590
* [Hexagon] Add front-end support for Hexagon V65Krzysztof Parzyszek2017-12-133-5/+40
| | | | llvm-svn: 320579
* [Sema] Ignore decls in namespaces when global decls are not wanted.Eric Liu2017-12-131-0/+21
| | | | | | | | | | | | | | Summary: ... in qualified code completion and decl lookup. Reviewers: ilya-biryukov, arphaman Reviewed By: ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D40562 llvm-svn: 320563
* [OpenMP] Add function attribute for triggering data sharing.Gheorghe-Teodor Bercea2017-12-121-3/+8
| | | | | | | | | | | | | | | | Summary: The backend should only emit data sharing code for the cases where it is needed. A new function attribute is used by Clang to enable data sharing only for the cases where OpenMP semantics require it and there are variables that need to be shared. Reviewers: hfinkel, Hahnfeld, ABataev, carlo.bertolli, caomhin Reviewed By: ABataev Subscribers: cfe-commits, jholewinski Differential Revision: https://reviews.llvm.org/D41123 llvm-svn: 320527
* [OpenMP] Diagnose function name on the link clauseKelvin Li2017-12-122-6/+5
| | | | | | | | | | | This patch is to add diagnose when a function name is specified on the link clause. According to the OpenMP spec, only the list items that exclude the function name are allowed on the link clause. Differential Revision: https://reviews.llvm.org/D40968 llvm-svn: 320521
* [cmake] Follow-up to rL320494.Don Hinton2017-12-121-2/+2
| | | | | | EXISTS requires full paths. llvm-svn: 320519
* Add --cuda-path to mock a CUDA Toolkit installation to avoidKelvin Li2017-12-121-1/+1
| | | | | | | | | unexpected error messages for incompatibility between the default SM level and the support in the installed toolkit. Differential Revision: https://reviews.llvm.org/D40996 llvm-svn: 320506
* [debuginfo-tests] Add support for moving debuginfo-tests from clang/test to ↵Don Hinton2017-12-122-2/+19
| | | | | | | | | | | | | | | | | | | | | llvm/projects or monorepo. Summary: The new version of debuginfo-tests will have it's own lit.cfg.py file which is incompatible with the one in clang/test. This change supports both the old and new versions, and can be used until the bots actually move debuginfo-tests to either clang/test or the monorepo. This is a prerequisite for D40971. Reviewers: zturner, aprantl Subscribers: mgorny, JDevlieghere, llvm-commits, cfe-commits Differential Revision: https://reviews.llvm.org/D41055 llvm-svn: 320494
* Fix ICE when __has_unqiue_object_representations called with invalid declErich Keane2017-12-121-0/+8
| | | | llvm-svn: 320489
* [analyzer] StackAddrEscape: For now, disable the new async escape checks.Artem Dergachev2017-12-122-2/+16
| | | | | | | | | | | | | | | | | The new check introduced in r318705 is useful, but suffers from a particular class of false positives, namely, it does not account for dispatch_barrier_sync() API which allows one to ensure that the asyncronously executed block that captures a pointer to a local variable does not actually outlive that variable. The new check is split into a separate checker, under the name of alpha.core.StackAddressAsyncEscape, which is likely to get enabled by default again once these positives are fixed. The rest of the StackAddressEscapeChecker is still enabled by default. Differential Revision: https://reviews.llvm.org/D41042 llvm-svn: 320455
* [Driver][CodeGen] Add -mprefer-vector-width driver option and attribute ↵Craig Topper2017-12-112-0/+38
| | | | | | | | | | | | | | | | during CodeGen. This adds a new command line option -mprefer-vector-width to specify a preferred vector width for the vectorizers. Valid values are 'none' and unsigned integers. The driver will check that it meets those constraints. Specific supported integers will be managed by the targets in the backend. Clang will take the value and add it as a new function attribute during CodeGen. This represents the alternate direction proposed by Sanjay in this RFC: http://lists.llvm.org/pipermail/llvm-dev/2017-November/118734.html The syntax here matches gcc, though gcc treats it as an x86 specific command line argument. gcc only allows values of 128, 256, and 512. I'm not having clang check any values. Differential Revision: https://reviews.llvm.org/D40230 llvm-svn: 320419
* PR35586: Relax two asserts that are overly restrictiveErich Keane2017-12-111-0/+5
| | | | | | | | | The two asserts are too aggressive. In C++ mode, an enum is NOT considered an integral type, but an enum value is allowed to be an enum. This patch relaxes the two asserts to allow the enum value as well (as typechecking does). llvm-svn: 320411
* [Hexagon] Remove unsupported vlut intrinsicsKrzysztof Parzyszek2017-12-111-16/+0
| | | | llvm-svn: 320410
* Fix warn-enum-compare.cpp on WindowsHans Wennborg2017-12-111-1/+6
| | | | | | It's been failing since r319875. llvm-svn: 320405
* P0620 follow-up: deducing `auto` from braced-init-list in new exprZhihao Yuan2017-12-114-3/+26
| | | | | | | | | | | | | | | | | | | Summary: This is a side-effect brought in by p0620r0, which allows other placeholder types (derived from `auto` and `decltype(auto)`) to be usable in a `new` expression with a single-clause //braced-init-list// as its initializer (8.3.4 [expr.new]/2). N3922 defined its semantics. References: http://wg21.link/p0620r0 http://wg21.link/n3922 Reviewers: rsmith, aaron.ballman Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D39451 llvm-svn: 320401
* Revert 320391: Certain targets are failing, pulling back to diagnose.Erich Keane2017-12-1115-110/+56
| | | | llvm-svn: 320398
* [Sema] Fix crash in unused-lambda-capture warning for VLAsMalcolm Parsons2017-12-111-0/+9
| | | | | | | | | | | | | | | | | | | | Summary: Clang was crashing when diagnosing an unused-lambda-capture for a VLA because From.getVariable() is null for the capture of a VLA bound. Warning about the VLA bound capture is not helpful, so only warn for the VLA itself. Fixes: PR35555 Reviewers: aaron.ballman, dim, rsmith Reviewed By: aaron.ballman, dim Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D41016 llvm-svn: 320396
* For Linux/gnu compatibility, preinclude <stdc-predef.h> if the file is availableErich Keane2017-12-1115-56/+110
| | | | | | | | | | | | | | | | | | | | As reported in llvm bugzilla 32377. Here’s a patch to add preinclude of stdc-predef.h. The gcc documentation says “On GNU/Linux, <stdc-predef.h> is pre-included.” See https://gcc.gnu.org/gcc-4.8/porting_to.html; The preinclude is inhibited with –ffreestanding. Basically I fixed the failing test cases by adding –ffreestanding which inhibits this behavior. I fixed all the failing tests, including some in extra/test, there's a separate patch for that which is linked here Note: this is a recommit after a test failure took down the original (r318669) Patch By: mibintc Differential Revision: https://reviews.llvm.org/D34158 llvm-svn: 320391
* Switch to gnu++14 as the default dialect.Tim Northover2017-12-0913-38/+50
| | | | | | This is C++14 with conforming GNU extensions. llvm-svn: 320250
* Revert r320230 to fix buildbots.Richard Trieu2017-12-091-148/+12
| | | | llvm-svn: 320239
* Fix Driver/darwin-version.c testAlex Lorenz2017-12-091-1/+1
| | | | | | A target argument should be provided to avoid failures on non-Darwin llvm-svn: 320238
* [driver][darwin] Refactor the target selection code, NFCAlex Lorenz2017-12-091-0/+5
| | | | | | | | | | | | | | | | | The simulator variant of Darwin's platforms is removed in favor of a new environment field. The code that selects the platform and the version is split into 4 different functions instead of being all in one function. This is an NFC commit, although it slightly improves the "invalid version number" diagnostic by displaying the environment variable instead of -m<os>-version-min if the OS version was derived from the environment. rdar://35813850 Differential Revision: https://reviews.llvm.org/D41035 llvm-svn: 320235
* Fix fsanitize-blacklist test on Windows.Evgeniy Stepanov2017-12-091-2/+2
| | | | | | Broken in r320232. llvm-svn: 320233
* Hardware-assisted AddressSanitizer (clang part).Evgeniy Stepanov2017-12-0911-5/+159
| | | | | | | | | | | | | | Summary: Driver, frontend and LLVM codegen for HWASan. A clone of ASan, basically. Reviewers: kcc, pcc, alekseyshl Subscribers: srhines, javed.absar, cfe-commits Differential Revision: https://reviews.llvm.org/D40936 llvm-svn: 320232
* [ODRHash] Support ODR violation detection in functions.Richard Trieu2017-12-091-12/+148
| | | | | | | Extend the hashing to functions, which allows detection of function definition mismatches across modules. llvm-svn: 320230
* [CodeGen][X86] Fix handling of __fp16 vectors.Akira Hatanaka2017-12-094-51/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes a bug in IRGen where it generates completely broken code for __fp16 vectors on X86. For example when the following code is compiled: half4 hv0, hv1, hv2; // these are vectors of __fp16. void foo221() { hv0 = hv1 + hv2; } clang generates the following IR, in which two i16 vectors are added: @hv1 = common global <4 x i16> zeroinitializer, align 8 @hv2 = common global <4 x i16> zeroinitializer, align 8 @hv0 = common global <4 x i16> zeroinitializer, align 8 define void @foo221() { %0 = load <4 x i16>, <4 x i16>* @hv1, align 8 %1 = load <4 x i16>, <4 x i16>* @hv2, align 8 %add = add <4 x i16> %0, %1 store <4 x i16> %add, <4 x i16>* @hv0, align 8 ret void } To fix the bug, this commit uses the code committed in r314056, which modified clang to promote and truncate __fp16 vectors to and from float vectors in the AST. It also fixes another IRGen bug where a short value is assigned to an __fp16 variable without any integer-to-floating-point conversion, as shown in the following example: __fp16 a; short b; void foo1() { a = b; } @b = common global i16 0, align 2 @a = common global i16 0, align 2 define void @foo1() #0 { %0 = load i16, i16* @b, align 2 store i16 %0, i16* @a, align 2 ret void } rdar://problem/20625184 Differential Revision: https://reviews.llvm.org/D40112 llvm-svn: 320215
* Unify implementation of our two different flavours of -Wtautological-compare,Richard Smith2017-12-083-100/+174
| | | | | | | | | | | | | | | | | | | | | | | | | and fold together into a single function. In so doing, fix a handful of remaining bugs where we would report false positives or false negatives if we promote a signed value to an unsigned type for the comparison. This re-commits r320122 and r320124, minus two changes: * Comparisons between a constant and a non-constant expression of enumeration type never warn, not even if the constant is out of range. We should be warning about the creation of such a constant, not about its use. * We do not use more precise bit-widths for comparisons against bit-fields. The more precise diagnostics probably are the right thing, but we should consider moving them under their own warning flag. Other than the refactoring, this patch should only change the behavior for the buggy cases (where the warnings didn't take into account that promotion from signed to unsigned can leave a range of inaccessible values in the middle of the promoted type). llvm-svn: 320211
* [OPENMP] Simplify codegen for loop iteration variables in loop preamble.Alexey Bataev2017-12-086-2/+12
| | | | | | | Initial patch could cause trouble in the optimized code because of the incorrectly generated lifetime intrinsics. llvm-svn: 320191
* [ubsan] array-bounds: Ignore params with constant sizeVedant Kumar2017-12-081-2/+1
| | | | | | | | | | This is a follow-up to r320128. Eli pointed out that there is some gray area in the language standard about whether the constant size is exact, or a lower bound. https://reviews.llvm.org/D40940 llvm-svn: 320185
* Revert "Unify implementation of our two different flavours of ↵Hans Wennborg2017-12-083-140/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | -Wtautological-compare." > Unify implementation of our two different flavours of -Wtautological-compare. > > In so doing, fix a handful of remaining bugs where we would report false > positives or false negatives if we promote a signed value to an unsigned type > for the comparison. This caused a new warning in Chromium: ../../base/trace_event/trace_log.cc:1545:29: error: comparison of constant 64 with expression of type 'unsigned int' is always true [-Werror,-Wtautological-constant-out-of-range-compare] DCHECK(handle.event_index < TraceBufferChunk::kTraceBufferChunkSize); ~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'unsigned int' is really a 6-bit bitfield, which is why it's always less than 64. I thought we didn't use to warn (with out-of-range-compare) when comparing against the boundaries of a type? llvm-svn: 320162
* [OPENMP] Initial codegen for `target teams distribute` directive.Alexey Bataev2017-12-0810-14/+2846
| | | | | | Host + default devices codegen for `target teams distribute` directive. llvm-svn: 320149
* In stdbool.h, define bool, false, true only in gnu++98Stephan Bergmann2017-12-081-5/+11
| | | | | | | | | | GCC has meanwhile corrected that with the similar <https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=216679> "C++11 explicitly forbids macros for bool, true and false." Differential Revision: https://reviews.llvm.org/D40167 llvm-svn: 320135
* [Blocks] Inherit sanitizer options from parent declVedant Kumar2017-12-081-1/+2
| | | | | | | | | | | | There is no way to apply sanitizer suppressions to ObjC blocks. A reasonable default is to have blocks inherit their parent's sanitizer options. rdar://32769634 Differential Revision: https://reviews.llvm.org/D40668 llvm-svn: 320132
* Add a test that the __STDC_VERSION__ macro reports the correct value for ↵Aaron Ballman2017-12-081-0/+4
| | | | | | -std=c17. llvm-svn: 320131
* [ubsan] Use pass_object_size info in bounds checksVedant Kumar2017-12-081-0/+69
| | | | | | | | | Teach UBSan's bounds check to opportunistically use pass_object_size information to check array accesses. rdar://33272922 llvm-svn: 320128
* Unify implementation of our two different flavours of -Wtautological-compare.Richard Smith2017-12-083-100/+140
| | | | | | | | In so doing, fix a handful of remaining bugs where we would report false positives or false negatives if we promote a signed value to an unsigned type for the comparison. llvm-svn: 320122
* Correct line endings that got mixed up in r320088; NFC.Aaron Ballman2017-12-071-12/+12
| | | | llvm-svn: 320115
* Correct line endings that got mixed up in r320089; NFC.Aaron Ballman2017-12-071-22/+22
| | | | llvm-svn: 320113
* Add new language mode flags for C17.Aaron Ballman2017-12-071-20/+22
| | | | | | This adds -std=c17, -std=gnu17, and -std=iso9899:2017 as language mode flags for C17 and updates the value of __STDC_VERSION__ to the value based on the C17 FDIS. Given that this ballot cannot succeed until 2018, it is expected that we (and GCC) will add c18 flags as aliases once the ballot passes. llvm-svn: 320089
* Add support for the __has_c_attribute builtin preprocessor macro.Aaron Ballman2017-12-071-0/+12
| | | | | | This behaves similar to the __has_cpp_attribute builtin macro in that it allows users to detect whether an attribute is supported with the [[]] spelling syntax, which can be enabled in C with -fdouble-square-bracket-attributes. llvm-svn: 320088
OpenPOWER on IntegriCloud