summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
...
* [Clang FE] Recognize -mnop-mcount CL option (SystemZ only).Jonas Paulsson2019-11-051-0/+26
| | | | | | | | | | | | | | Recognize -mnop-mcount from the command line and add a function attribute "mnop-mcount"="true" when passed. When this option is used, a nop is added instead of a call to fentry. This is used when building the Linux Kernel. If this option is passed for any other target than SystemZ, an error is generated. Review: Ulrich Weigand https://reviews.llvm.org/D67763
* [OpenCL] Add builtin function attribute handlingSven van Haastregt2019-11-051-0/+22
| | | | | | | | | Add handling for the "pure", "const" and "convergent" function attributes for OpenCL builtin functions. Patch by Pierre Gondois and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D64319
* [mips] Set __OCTEON__ macrosSimon Atanasyan2019-11-051-0/+1
|
* [mips] Fix `__mips_isa_rev` macros value for Octeon CPUSimon Atanasyan2019-11-051-0/+9
|
* [analyzer] Require darwin for scan-build testsDevin Coughlin2019-11-045-4/+6
| | | | | Let's at least get some coverage from these tests. We can generalize to other platforms later.
* [analyzer] Fixup scan-build tests for non-Darwin platforms.Devin Coughlin2019-11-045-1/+8
| | | | | This is a fix to 0aba69eb1a01c44185009f50cc633e3c648e9950 to address failing bots.
* [analyzer] Add test directory for scan-build.Devin Coughlin2019-11-049-1/+142
| | | | | | | | | | The static analyzer's scan-build script is critical infrastructure but is not well tested. To start to address this, add a new test directory under tests/Analysis for scan-build lit tests and seed it with several tests. The goal is that future scan-build changes will be accompanied by corresponding tests. Differential Revision: https://reviews.llvm.org/D69781
* [CUDA][HIP] Disable emitting llvm.linker.options in device compilationYaxun (Sam) Liu2019-11-042-0/+33
| | | | | | | The linker options (e.g. pragma detect_mismatch) are intended for host compilation only, therefore disable it for device compilation. Differential Revision: https://reviews.llvm.org/D57829
* [CGDebugInfo] Emit subprograms for decls when AT_tail_call is understoodVedant Kumar2019-11-042-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, clang emits subprograms for declared functions when the target debugger or DWARF standard is known to support entry values (DW_OP_entry_value & the GNU equivalent). Treat DW_AT_tail_call the same way to allow debuggers to follow cross-TU tail calls. Pre-patch debug session with a cross-TU tail call: ``` * frame #0: 0x0000000100000fa4 main`target at b.c:4:3 [opt] frame #1: 0x0000000100000f99 main`main at a.c:8:10 [opt] ``` Post-patch (note that the tail-calling frame, "helper", is visible): ``` * frame #0: 0x0000000100000fa4 main`target at b.c:4:3 [opt] frame #1: 0x0000000100000f80 main`helper [opt] [artificial] frame #2: 0x0000000100000f99 main`main at a.c:8:10 [opt] ``` rdar://46577651 Differential Revision: https://reviews.llvm.org/D69743
* [OPENMP50]Support for imperfectly nested loops.Alexey Bataev2019-11-043-18/+118
| | | | Added support for imperfectly nested loops introduced in OpenMP 5.0.
* [X86] Add support for -mvzeroupper and -mno-vzeroupper to match gccCraig Topper2019-11-041-0/+5
| | | | | | | | | | | | | | | | | -mvzeroupper will force the vzeroupper insertion pass to run on CPUs that normally wouldn't. -mno-vzeroupper disables it on CPUs where it normally runs. To support this with the default feature handling in clang, we need a vzeroupper feature flag in X86.td. Since this flag has the opposite polarity of the fast-partial-ymm-or-zmm-write we used to use to disable the pass, we now need to add this new flag to every CPU except KNL/KNM and BTVER2 to keep identical behavior. Remove -fast-partial-ymm-or-zmm-write which is no longer used. Differential Revision: https://reviews.llvm.org/D69786
* [ms] Fix Microsoft compatibility handling of commas in nested macro expansions.Eric Astor2019-11-041-0/+13
| | | | | | | | | | | | | | | | | | | In Microsoft-compatibility mode, single commas from nested macro expansions should not be considered as argument separators; we already emulated this by marking them to be ignored. However, in MSVC's preprocessor, subsequent expansions DO treat these commas as argument separators... so we now ignore each comma at most once. Includes a small unit test that validates we match MSVC's behavior as shown in https://gcc.godbolt.org/z/y0twaq Fixes PR43282 Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69626
* Recommit "[CodeView] Add option to disable inline line tables."Amy Huang2019-11-041-0/+31
| | | | | | | | | | | | This reverts commit 004ed2b0d1b86d424643ffc88fce20ad8bab6804. Original commit hash 6d03890384517919a3ba7fe4c35535425f278f89 Summary: This adds a clang option to disable inline line tables. When it is used, the inliner uses the call site as the location of the inlined function instead of marking it as an inline location with the function location. https://reviews.llvm.org/D67723
* [Diagnostics] Improve some error messages related to bad use of dynamic_castDávid Bolvanský2019-11-042-7/+7
|
* [OpenCL] Fix FileCheck patternSven van Haastregt2019-11-041-1/+1
| | | | | For this test, FileCheck is not run with the CHECK prefix; it seems COMMON was intended here.
* [OpenCL] Fix address space for const method call from nonconst (PR43145)Sven van Haastregt2019-11-041-0/+11
| | | | | | Patch by Anastasia Stulova and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D68781
* [CodeGenCXX][test] Use -fno-experimental-new-pass-manager for ↵Fangrui Song2019-11-021-1/+1
| | | | | | CodeGenCXX/union-tbaa2.cpp after D68593/llvmorg-10-init-8907-gcecc0d27ad5 It fails with -DENABLE_EXPERIMENTAL_NEW_PASS_MANAGER=0 builds. Temporarily use -fno-experimental-new-pass-manager while we are investigating the root cause.
* [X86] add mayRaiseFPException flag and FPCW registers for X87 instructionsPengfei Wang2019-11-011-1/+1
| | | | | | | | | | | | | | | | Summary: This patch adds flag "mayRaiseFPException" , FPCW and FPSW for X87 instructions which could raise float exception. Reviewers: pengfei, RKSimon, andrew.w.kaylor, uweigand, kpn, spatel, cameron.mcinally, craig.topper Reviewed By: craig.topper Subscribers: thakis, hiraditya, llvm-commits Patch by LiuChen. Differential Revision: https://reviews.llvm.org/D68854
* DebugInfo: Let -gdwarf use the toolchain default DWARF version, instead of ↵David Blaikie2019-11-011-0/+1
| | | | hardcoded/aliased to -gdwarf-4
* [WebAssembly] Add experimental SIMD dot product instructionThomas Lively2019-11-011-0/+6
| | | | | | | | | | | | | | | | | | | Summary: This instruction is not merged to the spec proposal, but we need it to be implemented in the toolchain to experiment with it. It is available only on an opt-in basis through a clang builtin. Defined in https://github.com/WebAssembly/simd/pull/127. Depends on D69696. Reviewers: aheejin Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D69697
* [OpenCL] Support -fdeclare-opencl-builtins in C++ modeSven van Haastregt2019-11-011-3/+5
| | | | | | | Support for C++ mode was accidentally lacking due to not checking the OpenCLCPlusPlus LangOpts version. Differential Revision: https://reviews.llvm.org/D69233
* [WebAssembly] SIMD integer min and max instructionsThomas Lively2019-10-311-0/+84
| | | | | | | | | | | | | | | | | | | | | | Summary: Introduces a clang builtins and LLVM intrinsics representing integer min/max instructions. These instructions have not been merged to the SIMD spec proposal yet, so they are currently opt-in only via builtins and not produced by general pattern matching. If these instructions are accepted into the spec proposal the builtins and intrinsics will be replaced with normal pattern matching. Defined in https://github.com/WebAssembly/simd/pull/27. Reviewers: aheejin Reviewed By: aheejin Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D69696
* clang: Fix assert on void pointer arithmetic with address_spaceMatt Arsenault2019-10-311-4/+18
| | | | | This attempted to always use the default address space void pointer type instead of preserving the source address space.
* [CodeGen] Fix invalid llvm.linker.options about pragma detect_mismatchYaxun (Sam) Liu2019-10-311-2/+7
| | | | | | | | | | When a target does not support pragma detect_mismatch, an llvm.linker.options metadata with an empty entry is created, which causes diagnostic in backend since backend expects name/value pair in llvm.linker.options entries. This patch fixes that. Differential Revision: https://reviews.llvm.org/D69678
* [profile] Add a mode to continuously sync counter updates to a fileVedant Kumar2019-10-311-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for continuously syncing profile counter updates to a file. The motivation for this is that programs do not always exit cleanly. On iOS, for example, programs are usually killed via a signal from the OS. Running atexit() handlers after catching a signal is unreliable, so some method for progressively writing out profile data is necessary. The approach taken here is to mmap() the `__llvm_prf_cnts` section onto a raw profile. To do this, the linker must page-align the counter and data sections, and the runtime must ensure that counters are mapped to a page-aligned offset within a raw profile. Continuous mode is (for the moment) incompatible with the online merging mode. This limitation is lifted in https://reviews.llvm.org/D69586. Continuous mode is also (for the moment) incompatible with value profiling, as I'm not sure whether there is interest in this and the implementation may be tricky. As I have not been able to test extensively on non-Darwin platforms, only Darwin support is included for the moment. However, continuous mode may "just work" without modification on Linux and some UNIX-likes. AIUI the default value for the GNU linker's `--section-alignment` flag is set to the page size on many systems. This appears to be true for LLD as well, as its `no_nmagic` option is on by default. Continuous mode will not "just work" on Fuchsia or Windows, as it's not possible to mmap() a section on these platforms. There is a proposal to add a layer of indirection to the profile instrumentation to support these platforms. rdar://54210980 Differential Revision: https://reviews.llvm.org/D68351
* [clang][ScanDeps] Fix issue with multiple commands with the same input.Michael Spencer2019-10-313-3/+15
| | | | | | | | | | | | | | | | | | | Previously, given a CompilationDatabase with two commands for the same source file we would report that file twice with the union of the dependencies for each command both times. This was due to the way `ClangTool` runs actions given an input source file (see the comment in `DependencyScanningTool.cpp`). This commit adds a `SingleCommandCompilationDatabase` that is created with each `CompileCommand` in the original CDB, which is then used for each `ClangTool` invocation. This gives us a single run of `DependencyScanningAction` per `CompileCommand`. I looked at using `AllTUsToolExecutor` which is a parallel tool executor, but I'm not sure it's suitable for `clang-scan-deps` as it does a lot more sharing of state than `AllTUsToolExecutor` expects. Differential Revision: https://reviews.llvm.org/D69643
* [clang][analyzer] Using CallDescription in StreamChecker.Balázs Kéri2019-10-312-26/+99
| | | | | | | | | | | | | | | | | | | Summary: Recognization of function names is done now with the CallDescription class instead of using IdentifierInfo. This means function name and argument count is compared too. A new check for filtering not global-C-functions was added. Test was updated. Reviewers: Szelethus, NoQ, baloghadamsoftware, Charusso Reviewed By: Szelethus, NoQ, Charusso Subscribers: rnkovacs, xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, donat.nagy, Charusso, dkrupp, Szelethus, gamesh411, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67706
* Make flang driver stuff work on macOSNico Weber2019-10-311-4/+0
| | | | | | | | | | | 6bf55804 added special-case code for TY_PP_Fortran to ToolChain::LookupTypeForExtension(), but Darwin::LookupTypeForExtension() overrode that method without calling the superclass implementation. Make it call the superclass implementation to fix things. Differential Revision: https://reviews.llvm.org/D69636
* [cfi] Add flag to always generate .debug_frameDavid Candler2019-10-311-0/+6
| | | | | | | | | This adds a flag to LLVM and clang to always generate a .debug_frame section, even if other debug information is not being generated. In situations where .eh_frame would normally be emitted, both .debug_frame and .eh_frame will be used. Differential Revision: https://reviews.llvm.org/D67216
* [Diagnostics] Warn for std::is_constant_evaluated in constexpr modeDávid Bolvanský2019-10-312-1/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: constexpr int fn1() { if constexpr (std::is_constant_evaluated()) // condition is always true! return 0; else return 1; } constexpr int fn2() { if (std::is_constant_evaluated()) return 0; else return 1; } Solves PR42977 Reviewers: rsmith, aaron.ballman Reviewed By: rsmith Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69518
* Revert "[CodeView] Add option to disable inline line tables."Amy Huang2019-10-301-24/+0
| | | | | | because it breaks compiler-rt tests. This reverts commit 6d03890384517919a3ba7fe4c35535425f278f89.
* [CodeView] Add option to disable inline line tables.Amy Huang2019-10-301-0/+24
| | | | | | | | | | | | | | | | | Summary: This adds a clang option to disable inline line tables. When it is used, the inliner uses the call site as the location of the inlined function instead of marking it as an inline location with the function location. See https://bugs.llvm.org/show_bug.cgi?id=42344 Reviewers: rnk Subscribers: hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D67723
* Disable new clang-scan-deps test on Windows due to backslash path matching ↵Reid Kleckner2019-10-301-0/+3
| | | | problems
* [clang][clang-scan-deps] Add support for extracting full module dependencies.Michael Spencer2019-10-301-0/+74
| | | | | | | | | | | This is a recommit of d8a4ef0e685c with the nondeterminism fixed. This adds experimental support for extracting a Clang module dependency graph from a compilation database. The output format is experimental and will change. It is currently a concatenation of JSON outputs for each compilation. Future patches will change this to deduplicate modules between compilations. Differential Revision: https://reviews.llvm.org/D69420
* Revert "[clang][clang-scan-deps] Add support for extracting full module ↵Michael Spencer2019-10-301-74/+0
| | | | | | | | dependencies." This reverts commit d8a4ef0e685cec1fc73d4953b48220b649d05b40. This commit broke some of the bots. I believe it's due to nondeterminism. Will fix and recommit.
* [MS] Don't reference deleted copy ctors from catchable typesReid Kleckner2019-10-301-0/+27
| | | | | | | | | | | When throwing objects with deleted copy constructors, the copy ctor field of the catchable type should remain null and the mangle name changes. This already worked in simple cases, but in cases involving non-trivial subobjects, sometimes LookupCopyingConstructor could return a non-null but deleted constructor decl. Skip those and don't reference them. Fixes PR43680
* [clang][clang-scan-deps] Add support for extracting full module dependencies.Michael Spencer2019-10-301-0/+74
| | | | | | | | | This adds experimental support for extracting a Clang module dependency graph from a compilation database. The output format is experimental and will change. It is currently a concatenation of JSON outputs for each compilation. Future patches will change this to deduplicate modules between compilations. Differential Revision: https://reviews.llvm.org/D69420
* Fix __attribute__((enable_if)) to treat arguments with side-effects asRichard Smith2019-10-301-1/+29
| | | | | | | | non-constant. We previously failed the entire condition evaluation if an unmodeled side-effect was encountered in an argument, even if that argument was unused in the attribute's condition.
* [clang][llvm] Obsolete Exynos M1 and M2Evandro Menezes2019-10-306-79/+1
|
* [clang][driver][flang] Mark test as unsupported on darwinPeter Waller2019-10-301-0/+4
| | | | | | | D63607 made mac builders unhappy by failing this test, and it isn't yet obvious why. Mark as unsupported as a temporary measure. Signed-off-by: Peter Waller <peter.waller@arm.com>
* [OPENMP50]Add support for parallel master taskloop simd directive.Alexey Bataev2019-10-3021-0/+5584
| | | | Added full support for parallel master taskloop simd directive.
* [ASTImporter] Add support for BuiltinTemplateDeclRaphael Isemann2019-10-302-0/+46
| | | | | | | | | | | | | | | | | Summary: That decl kind is currently not implemented. BuiltinTemplateDecl is for decls that are hardcoded in the ASTContext, so we can import them like we do other builtin decls by just taking the equivalent decl from the target ASTContext. Reviewers: martong, a.sidorin, shafik Reviewed By: martong, shafik Subscribers: rnkovacs, kristina, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69566
* Rename a flang test caseJeremy Morse2019-10-302-2/+2
| | | | | | On Windows and macOS, the filesystem is case insensitive, and these files interfere with each other. Reading through, the case of the file extension is part of the test. I've altered the rest of the name instead.
* [clang][driver] Add basic --driver-mode=flang support for fortranPeter Waller2019-10-309-19/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new Flang mode. When in Flang mode, the driver will invoke flang for fortran inputs instead of falling back to the GCC toolchain as it would otherwise do. The behaviour of other driver modes are left unmodified to preserve backwards compatibility. It is intended that a soon to be implemented binary in the flang project will import libclangDriver and run the clang driver in the new flang mode. Please note that since the binary invoked by the driver is under development, there will no doubt be further tweaks necessary in future commits. * Initial support is added for basic driver phases * -E, -fsyntax-only, -emit-llvm -S, -emit-llvm, -S, (none specified) * -### tests are added for all of the above * This is more than is supported by f18 so far, which will emit errors for those options which are unimplemented. * A test is added that ensures that clang gives a reasonable error message if flang is not available in the path (without -###). * Test that the driver accepts multiple inputs in --driver-mode=flang. * Test that a combination of C and Fortran inputs run both clang and flang in --driver-mode=flang. * clang/test/Driver/fortran.f95 is fixed to use the correct fortran comment character. Differential revision: https://reviews.llvm.org/D63607
* [MS] Fix constexpr data member pointer conversionsReid Kleckner2019-10-291-0/+27
| | | | | | | | | | | | | | | Constexpr data member conversions work by starting with the class that originally introduced the field, and converting from there to the type that the user desires. Before this change, Clang was using the inheritance model from the final destination class type instead of the model from the class that originally introduced the field. To fix this, find the relevant FieldDecl and take its parent class instead of using the member pointer type the user provided. Indirect field decls require some special handling to find the parent class. Fixes PR43803
* Thread safety analysis: Peel away NoOp implicit casts in initializersAaron Puchert2019-10-301-0/+14
| | | | | | | | | | | | Summary: This happens when someone initializes a variable with guaranteed copy elision and an added const qualifier. Fixes PR43826. Reviewers: aaron.ballman, rsmith Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D69533
* [Headers] Fix compatibility between arm_acle.h and intrin.hEli Friedman2019-10-291-0/+6
| | | | | | Make sure they don't both define __nop. Differential Revision: https://reviews.llvm.org/D69012
* Accept __is_same_as as a GCC-compatibility synonym for the proper trait name ↵Richard Smith2019-10-292-0/+5
| | | | __is_same.
* [DWARF5] Added support for deleted C++ special member functions.Adrian Prantl2019-10-291-0/+31
| | | | | | | | | | This patch adds support for deleted C++ special member functions in clang and llvm. Also added Defaulted member encodings for future support for defaulted member functions. Patch by Sourabh Singh Tomar! Differential Revision: https://reviews.llvm.org/D69215
* Fix argument numbering confusion when diagnosing a non-viable operator().Richard Smith2019-10-291-0/+7
| | | | | This could lead to crashes if operator() is a variadic template, as we could end up asking for an out-of-bounds argument.
OpenPOWER on IntegriCloud