summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* [ObjC][CodeGen] Remove an assert that is no longer correct.Akira Hatanaka2016-05-131-1/+17
| | | | | | | | | | | | | | | | | | clang asserts when compiling the following code because r231508 made changes to promote constant temporary arrays and records to globals with constant initializers: std::vector<NSString*> strs = {@"a", @"b"}; This commit changes the code to return early if the object returned by createReferenceTemporary is a global variable with an initializer. rdar://problem/25504992 rdar://problem/25955179 Differential Revision: http://reviews.llvm.org/D20045 llvm-svn: 269385
* [ubsan] Add -fsanitize-undefined-strip-path-components=NFilipe Cabecinhas2016-05-122-0/+31
| | | | | | | | | | | | | | | | | | | Summary: This option allows the user to control how much of the file name is emitted by UBSan. Tuning this option allows one to save space in the resulting binary, which is helpful for restricted execution environments. With a positive N, UBSan skips the first N path components. With a negative N, UBSan only keeps the last N path components. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19666 llvm-svn: 269309
* [OpenCL] Output OpenCL version in diagnostics.Anastasia Stulova2016-05-124-12/+12
| | | | | | | | | | | | | | Diagnostics should note version dependent issues by giving a hint about current version being compiled for. This patch changes diagnostics of static storage class specifier and generic type qualifier to specify OpenCL version as well as converts other diagnostics to match the style. Patch by Vedran Miletic! Review: http://reviews.llvm.org/D19780 llvm-svn: 269305
* [MS ABI] Don't crash when zero-initializing a vbase which contains a vbaseDavid Majnemer2016-05-121-0/+22
| | | | | | | | | | | | | | | | Bases can be zero-initialized: the storage is zero-initialized before the base constructor is run. The MS ABI has a quirk where base VBPtrs are not installed by the base constructor but by the most derived class. In particular, they are installed before the base constructor is run. The derived constructor must be careful to zero-initialize only the bits of the class which haven't already been populated by virtual base pointers. While we correctly avoided this scenario, we didn't handle the case where the base class has virtual bases which have virtual bases. llvm-svn: 269271
* [analyzer] Fix crash in ObjCGenericsCheckerDevin Coughlin2016-05-111-0/+273
| | | | | | | | | | | | | | | Fix a crash in the generics checker where DynamicTypePropagation tries to get the superclass of a root class. This is a spot-fix for a deeper issue where the checker makes assumptions that may not hold about subtyping between the symbolically-tracked type of a value and the compile-time types of a cast on that value. I've added a TODO to address the underlying issue. rdar://problem/26086914 llvm-svn: 269227
* [MSVC] Implementation of __unaligned as a proper type qualifierAndrey Bokhanko2016-05-116-4/+109
| | | | | | | | | | | This patch implements __unaligned (MS extension) as a proper type qualifier (before that, it was implemented as an ignored attribute). It also fixes PR27367 and PR27666. Differential Revision: http://reviews.llvm.org/D20103 llvm-svn: 269220
* Relax -Wcalling-convention-cast when casting to the default convention (cdecl)Reid Kleckner2016-05-111-0/+9
| | | | llvm-svn: 269214
* Embed bitcode in object file (clang cc1 part)Steven Wu2016-05-112-4/+70
| | | | | | | | | | | | | | | | | | | Summary: Teach clang to embed bitcode inside bitcode. When -fembed-bitcode cc1 option is used, clang will embed both the input bitcode and cc1 commandline into the bitcode in special sections before compiling to the object file. Using -fembed-bitcode-marker will only introduce a marker in both sections. Depends on D17390 Reviewers: rsmith Subscribers: yaron.keren, vsk, cfe-commits Differential Revision: http://reviews.llvm.org/D17392 llvm-svn: 269202
* [Hexagon] Avoid spurious failures in test/Driver/hexagon-toolchain-elf.cKrzysztof Parzyszek2016-05-111-4/+4
| | | | llvm-svn: 269200
* [clang][AVX512] completing missing set intrinsicsMichael Zuckerman2016-05-111-0/+72
| | | | | | Differential Revision: http://reviews.llvm.org/D20099 llvm-svn: 269172
* [clang][AVX512] completing missing intrinsics for [vpermt2d|vptestm] ↵Michael Zuckerman2016-05-111-0/+56
| | | | | | | | instruction set. Differential Revision: http://reviews.llvm.org/D20096 llvm-svn: 269170
* [Sema] Fix value-dependent enable_if bug.George Burgess IV2016-05-111-5/+36
| | | | | | | | | | | | | | | This patch fixes a bug where we would assume all value-dependent enable_if conditions give successful results. Instead, we consider value-dependent enable_if conditions to always fail. While this isn't ideal, this is the best we can realistically do without changing both enable_if's semantics and large parts of Sema (specifically, all of the parts that don't expect type dependence to come out of nowhere, and that may interact with overload resolution). Differential Revision: http://reviews.llvm.org/D20130 llvm-svn: 269154
* Disable -Wcast-calling-convention by default (follow-up to r269116)Hans Wennborg2016-05-111-8/+11
| | | | llvm-svn: 269148
* Wildcard away paths in fixit CHECKs in my last testcaseReid Kleckner2016-05-101-9/+9
| | | | | | Oops. :( llvm-svn: 269118
* Add -Wcast-calling-convention to warn when casting away calling conventionsReid Kleckner2016-05-101-0/+54
| | | | | | | | | | | | | | | | | | | | | | Summary: This only warns on casts of the address of a function defined in the current TU. In this case, the fix is likely to be local and the warning useful. Here are some things we could experiment with in the future: - Fire on declarations as well as definitions - Limit the warning to non-void function prototypes - Limit the warning to mismatches of caller and callee cleanup CCs This warning is currently off by default while we study its usefulness. Reviewers: thakis, rtrieu Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D17348 llvm-svn: 269116
* [WebAssembly] Reduce strictness of static destructor testDerek Schuff2016-05-101-6/+3
| | | | | | It didn't work on non-asserts builds llvm-svn: 269099
* Introduce CGCXXABI::canCallMismatchedFunctionTypeDerek Schuff2016-05-102-7/+8
| | | | llvm-svn: 269089
* Clean up condition, add ARM to testDerek Schuff2016-05-101-0/+1
| | | | llvm-svn: 269086
* Do not register incompatible C++ destructors with __cxa_atexitDerek Schuff2016-05-102-1/+35
| | | | | | | | | | | | | | | | | | | | | | Summary: For a static object with a nontrivial destructor, clang generates an initializer function (__cxx_global_var_init) which registers that object's destructor using __cxa_atexit. However some ABIs (ARM, WebAssembly) use destructors that return 'this' instead of having void return (which does not match the signature of function pointers passed to __cxa_atexit). This results in undefined behavior when the destructors are called. All the calling conventions I know of on ARM can tolerate this, but WebAssembly requires the signatures of indirect calls to match the called function. This patch disables that direct registration of destructors for ABIs that have this-returning destructors. Subscribers: aemerson, jfb, cfe-commits, dschuff Differential Revision: http://reviews.llvm.org/D19275 llvm-svn: 269085
* clang/test/CodeGen/avx512f-builtins.c: Fix for -Asserts.NAKAMURA Takumi2016-05-101-15/+15
| | | | llvm-svn: 269079
* [Clang][AVX512] completing missing intrinsics [load/store]Michael Zuckerman2016-05-101-12/+125
| | | | | | Differential Revision: http://reviews.llvm.org/D20063 llvm-svn: 269056
* [OPENMP 4.5] Initial codegen for 'priority' clause in task-basedAlexey Bataev2016-05-103-3/+3
| | | | | | | | | directives. OpenMP 4.5 supports clause 'priority' in task-based directives. Patch adds initial codegen support for this clause in codegen. llvm-svn: 269050
* [Clang][AVX512] completing missing intrinsics [vmin/vmax]{sd|sq|uq|ud}.Michael Zuckerman2016-05-101-1/+112
| | | | | | Differential Revision: http://reviews.llvm.org/D20064 llvm-svn: 269042
* [OPENMP 4.0] Fixed codegen for destructors in task-based directives.Alexey Bataev2016-05-1011-51/+19
| | | | | | | | If private variables require destructors call at the deletion of the task, additional flag in task flags must be set. Patch fixes this problem. llvm-svn: 269039
* [Clang][AVX512] completing missing intrinsics [vextractf].Michael Zuckerman2016-05-101-0/+24
| | | | | | Differential Revision: http://reviews.llvm.org/D20061 llvm-svn: 269037
* [OPENMP 4.5] Add codegen support in runtime for '[non]monotonic'Alexey Bataev2016-05-102-6/+6
| | | | | | | | | | schedule modifiers. Runtime library expects some additional data in schedule argument for loop-based directives, that have additional schedule modifiers 'monotonic|nonmonotonic'. llvm-svn: 269035
* [Clang][AVX512] completing missing intrinsics [roundscale, ceil, floor]Michael Zuckerman2016-05-101-0/+54
| | | | | | Differential Revision: http://reviews.llvm.org/D20070 llvm-svn: 269022
* [Sema] Fix an overload resolution bug with enable_if.George Burgess IV2016-05-101-0/+13
| | | | | | | | | | | | | | | | | | | | | | Currently, if clang::isBetterOverloadCandidate encounters an enable_if attribute on either candidate that it's inspecting, it will ignore all lower priority attributes (e.g. pass_object_size). This is problematic in cases like: ``` void foo(char *c) __attribute__((enable_if(1, ""))); void foo(char *c __attribute__((pass_object_size(0)))) __attribute__((enable_if(1, ""))); ``` ...Because we would ignore the pass_object_size attribute in the second `foo`, and consider any call to `foo` to be ambiguous. This patch makes overload resolution consult further tiebreakers (e.g. pass_object_size) if two candidates have equally good enable_if attributes. llvm-svn: 269005
* [CUDA] Fix flush-denormals.cu test so that it checks what it intends to CHECK.Justin Lebar2016-05-101-3/+5
| | | | | | | FileCheck does not evaluate plain CHECKs if you pass -check-prefix; you have to ask for it explicitly. llvm-svn: 269000
* [CUDA] Restrict init of local __shared__ variables to empty constructors only.Artem Belevich2016-05-092-33/+10
| | | | | | | | | | Allow only empty constructors for local __shared__ variables in a way identical to restrictions imposed on dynamic initializers for global variables on device. Differential Revision: http://reviews.llvm.org/D20039 llvm-svn: 268982
* [CUDA] Only __shared__ variables can be static local on device side.Artem Belevich2016-05-092-8/+8
| | | | | | | | | | According to CUDA programming guide (v7.5): > E.2.9.4: Within the body of a device or global function, only > shared variables may be declared with static storage class. Differential Revision: http://reviews.llvm.org/D20034 llvm-svn: 268962
* [Myriad] Use Generic_ELF::addClangTargetOptions()Douglas Katzman2016-05-091-0/+4
| | | | llvm-svn: 268956
* [Power9] Enable -mcpu=pwr9 (-mcpu=power9) in the front endNemanja Ivanovic2016-05-091-0/+28
| | | | | | | | | This patch corresponds to review: http://reviews.llvm.org/D19684 It simply adds the handling for the option and the corresponding macros. llvm-svn: 268951
* [OpenMP] Parse+Sema for '#pragma omp declare target' syntax version 4.5Dmitry Polukhin2016-05-092-1/+58
| | | | | | | | | | | | | | | | | Support OpenMP version 4.5 syntax for #pragma omp declare target. Syntax: #pragma omp declare target (extended-list) new-line or #pragma omp declare target clause[ [,] clause ... ] new-line Where clause is one of the following: to(extended-list) link(list) Differential Revision: http://reviews.llvm.org/D20011 llvm-svn: 268925
* [clang][AVX512] completing missing intrinsics [vmin/vmax].Michael Zuckerman2016-05-091-0/+58
| | | | | | Differential Revision: http://reviews.llvm.org/D20062 llvm-svn: 268910
* [Clang][AVX512] completing missing intrinsics [CVT]Michael Zuckerman2016-05-091-0/+238
| | | | | | Differential Revision: http://reviews.llvm.org/D20056 llvm-svn: 268903
* Enable support for __float128 in Clang and enable it on pertinent platformsNemanja Ivanovic2016-05-097-11/+199
| | | | | | | | | | | | | | | | | | This patch corresponds to reviews: http://reviews.llvm.org/D15120 http://reviews.llvm.org/D19125 It adds support for the __float128 keyword, literals and target feature to enable it. Based on the latter of the two aforementioned reviews, this feature is enabled on Linux on i386/X86 as well as SystemZ. This is also the second attempt in commiting this feature. The first attempt did not enable it on required platforms which caused failures when compiling type_traits with -std=gnu++11. If you see failures with compiling this header on your platform after this commit, it is likely that your platform needs to have this feature enabled. llvm-svn: 268898
* Fix spurious warnings about unused private fieldOlivier Goffart2016-05-091-0/+2
| | | | | | | | | | | | If the address of a field is taken as a pointer to member, we should not warn that the field is not used. Normaly, yse of fields are done from MemberExpr, but in case of pointer to member, it is in a DeclRefExpr Differential Revision: http://reviews.llvm.org/D20054 llvm-svn: 268895
* Teach header search about GCC 4.9 header search paths in Gentoo, theyChandler Carruth2016-05-085-0/+15
| | | | | | now use the full GCC version in their weird suffix. llvm-svn: 268874
* [OpenMP] Check for associated statements with hasAssociatedStmt() when ↵Samuel Antao2016-05-081-0/+28
| | | | | | | | | | | | | | scanning for device code. Summary: `getAssociatedStmt()` contains an assertion that assumes the statement always exists. In device code scanning, we need to look into the associated statement therefore we check its existence. This patch replaces `getAssociatedStmt` by `hasAssociatedStmt` so that we do not trigger the assertion for directives that happen not to have an associated statement (e.g target enter/exit data). Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev Subscribers: cfe-commits, caomhin Differential Revision: http://reviews.llvm.org/D19812 llvm-svn: 268870
* [CrashReproducer] Always use realpath for destinationBruno Cardoso Lopes2016-05-061-9/+1
| | | | | | | | | | When running reproducer scripts we need that original symlinks from the source filesystem are reproduced in the VFS so that different virtual paths can map to the same file, allowing the FileManager to share the same UID between these virtual entries. This avoids all sorts of module redefinition errors when using frameworks. llvm-svn: 268825
* Fix sysroot-prefix.c on Windows (/ vs \).Nico Weber2016-05-061-3/+3
| | | | llvm-svn: 268797
* Availability: set location when creating attribute for tvos, watchos.Manman Ren2016-05-061-0/+6
| | | | | | | | | | | | When inferring availability attributes for tvos, watchos from ios, we use the same source location and set the implicit bit to true. So when emitting diagnostics on inferred attributes, we have a source location. rdar://25893544 llvm-svn: 268793
* Availability: attach the note to the declaration with the attributes.Manman Ren2016-05-061-0/+11
| | | | | | | | | | | | | Sometimes, the declaration we found has inherited availability attributes, attaching the note to it does not tell us where the availability attributes are in the source. Go through the redecl chain to find the declaration with actual availability attributes. rdar://25221771 llvm-svn: 268786
* test: attempt to repair windows buildSaleem Abdulrasool2016-05-061-12/+9
| | | | | | | | Replace use of /dev/null with /var/empty. lit will substitute the /dev/null include path resulting in failures. Use a path under /var/empty which is supposed to be empty to ensure that we can successfully test. llvm-svn: 268784
* ObjC kindof: set the type of a conditional expression when involving kindof.Manman Ren2016-05-061-1/+33
| | | | | | | | When either LHS or RHS is a kindof type, we return a kindof type. rdar://problem/20513780 llvm-svn: 268781
* Frontend: support -I=path for sysroot expansionSaleem Abdulrasool2016-05-061-0/+28
| | | | | | | | | | | | | | | | | | From the GCC manpage: -I dir ... If dir begins with =, then the = will be replaced by the sysroot prefix; see --sysroot and -isysroot. Add support to expand the `=` as a prefix of the include path with the sysroot if specified. `-isysroot` takes precedence over `--sysroot` as the normal argument behaviour occurs. The ordering of the `-isysroot` is relevant to the path substituted. If no `--sysroot=` or `-isysroot` option is present, the = is not expanded. Resolves PR26965! llvm-svn: 268777
* [analyzer] Add tests for Objective-C class propertiesDevin Coughlin2016-05-061-0/+108
| | | | | | | | | Add basic tests to ensure the analyzer has support for class properties. This is a test-only change. rdar://problem/25256807 llvm-svn: 268773
* Revert "AMDGPU/SI: Use amdgpu_kernel calling convention for OpenCL kernels."Nikolay Haustov2016-05-062-16/+4
| | | | | | | | This reverts commit f7053ec90d0fc56f0837e43c2c759e85b56c21a1. It broke calling OpenCL kernel from another kernel. llvm-svn: 268740
* Revert r268727, it caused PR27666.Nico Weber2016-05-066-84/+4
| | | | llvm-svn: 268736
OpenPOWER on IntegriCloud