summaryrefslogtreecommitdiffstats
path: root/clang/test/Frontend
Commit message (Collapse)AuthorAgeFilesLines
...
* [AArch64] Vulcan is now ThunderXT99Joel Jones2017-03-071-1/+1
| | | | | | | | | | | | | Broadcom Vulcan is now Cavium ThunderX2T99. LLVM Bugzilla: http://bugs.llvm.org/show_bug.cgi?id=32113 Corresponding LLVM change: https://reviews.llvm.org/rL297190 Changes to clang to support the change. Patch by Joel Jones llvm-svn: 297227
* Use filename in linemarker when compiling preprocessed source (Revised)Taewook Oh2017-03-071-0/+10
| | | | | | | | | | | | | | | | Summary: This is a revised version of D28796. Included test is changed to resolve the target compatibility issue reported (rL293032). Reviewers: inglorion, dblaikie, echristo, aprantl, probinson Reviewed By: inglorion Subscribers: mehdi_amini, cfe-commits Differential Revision: https://reviews.llvm.org/D30663 llvm-svn: 297194
* Migrate all of aarch64-linux-gnu to \01_mcount instead of just when passing ↵Eric Christopher2017-02-281-2/+3
| | | | | | | | along gnueabi as this matches both gcc and what the kernel expects. More of PR27311 llvm-svn: 296490
* Hook up OpenBSD AArch64 supportBrad Smith2017-02-211-1/+1
| | | | llvm-svn: 295786
* Adjust tests after folding inlining analysis into missed remarksAdam Nemet2017-01-302-7/+7
| | | | llvm-svn: 293493
* Revert "Use filename in linemarker when compiling preprocessed source"Diana Picus2017-01-251-4/+0
| | | | | | | | | | | | | | | | | | | | | This reverts commit r293004 because it broke the buildbots with "unknown CPU" errors. I tried to fix it in r293026, but that broke on Green Dragon with this kind of error: error: expected string not found in input // CHECK: l{{ +}}df{{ +}}*ABS*{{ +}}{{0+}}{{.+}}preprocessed-input.c{{$}} ^ <stdin>:2:1: note: scanning from here /Users/buildslave/jenkins/sharedspace/incremental@2/clang-build/tools/clang/test/Frontend/Output/preprocessed-input.c.tmp.o: file format Mach-O 64-bit x86-64 ^ <stdin>:2:67: note: possible intended match here /Users/buildslave/jenkins/sharedspace/incremental@2/clang-build/tools/clang/test/Frontend/Output/preprocessed-input.c.tmp.o: file format Mach-O 64-bit x86-64 I suppose this means that llvm-objdump doesn't support Mach-O, so the test should indeed check for linux (but not for x86). I'll leave it to someone that knows better. llvm-svn: 293032
* Try to fix test from r293004Diana Picus2017-01-251-1/+1
| | | | | | | | This test broke on a lot of non-x86 buildbots with "unknowm CPU" errors. I don't see anything platform-specific about this test, and it seems to work fine on ARM if we just remove the -triple i686 flags from the run line. llvm-svn: 293026
* Use filename in linemarker when compiling preprocessed sourceDavid Callahan2017-01-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Clang appears to always use name as specified on the command line, whereas gcc uses the name as specified in the linemarker at the first line when compiling a preprocessed source. This results mismatch between two compilers in FILE symbol table entry. This patch makes clang to resemble gcc's behavior in finding the original source file name and use it as an input file name. Even with this patch, values of FILE symbol table entry may still be different because clang uses dirname+basename for the entry whlie gcc uses basename only. I'll write a patch for that once this patch is committed. Reviewers: dblaikie, inglorion Reviewed By: inglorion Subscribers: inglorion, aprantl, bruno Differential Revision: https://reviews.llvm.org/D28796 llvm-svn: 293004
* [Frontend] The macro that describes the Objective-C bool type shouldAlex Lorenz2017-01-201-3/+3
| | | | | | | | | | be defined for non Objective-C code as well rdar://29794915 Differential Revision: https://reviews.llvm.org/D28349 llvm-svn: 292617
* [X86] Add recent CPU strings to some of the tests that check other cpu names.Craig Topper2017-01-101-0/+5
| | | | llvm-svn: 291545
* AMD family 17h (znver1) enablementCraig Topper2017-01-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Summary: This patch enables the following 1. AMD family 17h architecture using "znver1" tune flag (-march, -mcpu). 2. ISAs that are enabled for "znver1" architecture. 3. Checks ADX isa from cpuid to identify "znver1" flag when -march=native is used. 4. ISAs FMA4, XOP are disabled as they are dropped from amdfam17. 5. For the time being, it uses the btver2 scheduler model. 6. Test file is updated to check this flag. This is linked to llvm review item https://reviews.llvm.org/D28017 Patch by Ganesh Gopalasubramanian. Additional test cases added by Craig Topper. Reviewers: RKSimon, craig.topper Subscribers: cfe-commits, RKSimon, ashutosh.nema, llvm-commits Differential Revision: https://reviews.llvm.org/D28018 llvm-svn: 291544
* [Frontend] Fix an issue where a quoted search path is incorrectlyAlex Lorenz2016-12-021-0/+12
| | | | | | | | | | | | | | | removed as a duplicate header search path The commit r126167 started passing the First index into RemoveDuplicates, but forgot to update 0 to First in the loop that looks for the duplicate. This resulted in a bug where an -iquoted search path was incorrectly removed if you passed in the same path into -iquote and more than one time into -isystem. rdar://23991350 Differential Revision: https://reviews.llvm.org/D27298 llvm-svn: 288491
* Give this test that uses Itanium mangling a tripleReid Kleckner2016-11-301-2/+4
| | | | llvm-svn: 288222
* Stop handling interesting deserialized decls after HandleTranslationUnitReid Kleckner2016-11-301-0/+30
| | | | | | | | Other AST consumers can deserialize interesting decls that we might codegen, but they won't make it to the final object file and can trigger assertions in debug information generation after finalization. llvm-svn: 288221
* [Frontend] Add a predefined macro that describes the Objective-C bool typeAlex Lorenz2016-11-211-0/+13
| | | | | | | | | | | | | This commit adds a new predefined macro named __OBJC_BOOL_IS_BOOL that describes the Objective-C boolean type: its value is zero if the Objective-C boolean uses the signed character type, otherwise its value is one as the Objective-C boolean uses the builtin boolean type. rdar://21170440 Differential Revision: https://reviews.llvm.org/D26234 llvm-svn: 287529
* [clang] Limit clang test to ARM and AArch64 onlyMandeep Singh Grang2016-10-231-0/+2
| | | | | | | | | | | | | | Summary: Limit clang/test/Frontend/gnu-mcount.c to ARM and AArch64 only. Reviewers: abdulras, honggyu.kim, rengolin Subscribers: aemerson, rengolin, cfe-commits Tags: #clang-c Differential Revision: https://reviews.llvm.org/D25842 llvm-svn: 284931
* CC1: Add -save-stats optionMatthias Braun2016-09-261-0/+8
| | | | | | | | | This option behaves in a similar spirit as -save-temps and writes internal llvm statistics in json format to a file. Differential Revision: https://reviews.llvm.org/D24820 llvm-svn: 282426
* Reapply r281276 with passing -emit-llvm in one of the testsAdam Nemet2016-09-132-0/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Original commit message: Add -fdiagnostics-show-hotness Summary: I've recently added the ability for optimization remarks to include the hotness of the corresponding code region. This uses PGO and allows filtering of the optimization remarks by relevance. The idea was first discussed here: http://thread.gmane.org/gmane.comp.compilers.llvm.devel/98334 The general goal is to produce a YAML file with the remarks. Then, an external tool could dynamically filter these by hotness and perhaps by other things. That said it makes sense to also expose this at the more basic level where we just include the hotness info with each optimization remark. For example, in D22694, the clang flag was pretty useful to measure the overhead of the additional analyses required to include hotness. (Without the flag we don't even run the analyses.) For the record, Hal has already expressed support for the idea of this patch on IRC. Differential Revision: https://reviews.llvm.org/D23284 llvm-svn: 281293
* Revert "Add -fdiagnostics-show-hotness"Adam Nemet2016-09-132-70/+0
| | | | | | | | This reverts commit r281276. Many bots are failing. llvm-svn: 281279
* Add -fdiagnostics-show-hotnessAdam Nemet2016-09-122-0/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: I've recently added the ability for optimization remarks to include the hotness of the corresponding code region. This uses PGO and allows filtering of the optimization remarks by relevance. The idea was first discussed here: http://thread.gmane.org/gmane.comp.compilers.llvm.devel/98334 The general goal is to produce a YAML file with the remarks. Then, an external tool could dynamically filter these by hotness and perhaps by other things. That said it makes sense to also expose this at the more basic level where we just include the hotness info with each optimization remark. For example, in D22694, the clang flag was pretty useful to measure the overhead of the additional analyses required to include hotness. (Without the flag we don't even run the analyses.) For the record, Hal has already expressed support for the idea of this patch on IRC. Differential Revision: https://reviews.llvm.org/D23284 llvm-svn: 281276
* [Frontend] Fix mcount inlining bugHonggyu Kim2016-09-011-31/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add support for -fdiagnostics-absolute-paths: printing absolute paths in ↵Hans Wennborg2016-08-262-0/+20
| | | | | | | | diagnostics Differential Revision: https://reviews.llvm.org/D23816 llvm-svn: 279827
* test/Frontend: Add a test for aarch64 target CPU names.Matthias Braun2016-07-271-0/+14
| | | | | | | Nothing else checked the target cpu names for aarch64 yet. Add a test in the spirit of x86-target-cpu.c. llvm-svn: 276930
* Provide __GLIBCXX_TYPE_INT_N_0 and __GLIBCXX_BITSIZE_INT_N_0 when in C++ gnu ↵Yaron Keren2016-07-211-0/+11
| | | | | | | | | language extensions. These are used by libstdc++ <type_traits> for is_integral<__int128>. Addresses http://llvm.org/pr23156. llvm-svn: 276252
* Allow iOS and tvOS version numbers with 2-digit major version numbers.Bob Wilson2016-07-181-0/+4
| | | | | | rdar://problem/26921601 llvm-svn: 275905
* [OpenCL] Actually activate Frontend/opencl.cl test and fix test bugsBenjamin Kramer2016-07-142-4/+4
| | | | | | | | | | | | | | rL275318 added the test Frontend/opencl.cl test, but that test was never actually run because Frontend/lit.local.cfg doesn't contain the '.cl' file suffix. Once the test is activated, it fails with (unintended) compile errors in the newly added CHECK_INVALID_OPENCL_VERSION checks. This patch adds the '.cl' file suffix to Frontend/lit.local.cfg to activate the test and fixes the test bug by adding '-fblocks' to the relevant command lines. Patch by Martin Böhme! Differential Revision: http://reviews.llvm.org/D22349 llvm-svn: 275405
* [OpenCL] Fixes failures in test/Driver/opencl.cl.Yaxun Liu2016-07-131-0/+7
| | | | | | | | | | Also fixes strict-aliasing option to only be allowed when OpenCL Version 1.0. Added testcase in test/Frontend/opencl-blocks.cl. Patch by Aaron En Ye Shi. Differential Revision: http://reviews.llvm.org/D22170 llvm-svn: 275318
* [OpenCL] Allow -std={cl|CL}{|1.1|1.2|2.0} in driverYaxun Liu2016-06-171-0/+4
| | | | | | | | | | Fix a regression which forbids using -std=cl|CL1.1|CL1.2|CL2.0 in driver. Allow -std and -cl-std={cl|CL}{|1.1|1.2|2.0}. Differential Revision: http://reviews.llvm.org/D20630 llvm-svn: 273015
* [OpenCL] Enable -fblocks by default for OpenCL 2.0 and above.Yaxun Liu2016-06-141-0/+20
| | | | | | Reviewed as part of http://reviews.llvm.org/D20444 llvm-svn: 272720
* Add a loop's debug location to its llvm.loop metadataHal Finkel2016-05-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Getting accurate locations for loops is important, because those locations are used by the frontend to generate optimization remarks. Currently, optimization remarks for loops often appear on the wrong line, often the first line of the loop body instead of the loop itself. This is confusing because that line might itself be another loop, or might be somewhere else completely if the body was an inlined function call. This happens because of the way we find the loop's starting location. First, we look for a preheader, and if we find one, and its terminator has a debug location, then we use that. Otherwise, we look for a location on an instruction in the loop header. The fallback heuristic is not bad, but will almost always find the beginning of the body, and not the loop statement itself. The preheader location search often fails because there's often not a preheader, and even when there is a preheader, depending on how it was formed, it sometimes carries the location of some preceeding code. I don't see any good theoretical way to fix this problem. On the other hand, this seems like a straightforward solution: Put the debug location in the loop's llvm.loop metadata. When emitting debug information, this commit causes us to add the debug location as an operand to each loop's llvm.loop metadata. Thus, we now generate this metadata for all loops (not just loops with optimization hints) when we're otherwise generating debug information. The remark test case changes depend on the companion LLVM commit r270771. llvm-svn: 270772
* Change embed-bitcode linkage typeSteven Wu2016-05-161-4/+4
| | | | | | | | | | | Embedded bitcode should have private linkage instead of appending or external. Otherwise, it will cause link failure due to duplicated symbols. Also add llvm.embedded.module and llvm.cmdline to llvm.compiler.used so they don't get optimized out. rdar://problem/21555860 llvm-svn: 269679
* Embed bitcode in object file (clang cc1 part)Steven Wu2016-05-111-0/+59
| | | | | | | | | | | | | | | | | | | 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
* Re-apply r267784, r267824 and r267830.Peter Collingbourne2016-04-281-1/+1
| | | | | | I have updated the compiler-rt tests. llvm-svn: 267903
* Revert r267784, r267824 and r267830.Benjamin Kramer2016-04-281-1/+1
| | | | | | | | | | It makes compiler-rt tests fail if the gold plugin is enabled. Revert "Rework interface for bitset-using features to use a notion of LTO visibility." Revert "Driver: only produce CFI -fvisibility= error when compiling." Revert "clang/test/CodeGenCXX/cfi-blacklist.cpp: Exclude ms targets. They would be non-cfi." llvm-svn: 267871
* Rework interface for bitset-using features to use a notion of LTO visibility.Peter Collingbourne2016-04-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Bitsets, and the compiler features they rely on (vtable opt, CFI), only have visibility within the LTO'd part of the linkage unit. Therefore, only enable these features for classes with hidden LTO visibility. This notion is based on object file visibility or (on Windows) dllimport/dllexport attributes. We provide the [[clang::lto_visibility_public]] attribute to override the compiler's LTO visibility inference in cases where the class is defined in the non-LTO'd part of the linkage unit, or where the ABI supports calling classes derived from abstract base classes with hidden visibility in other linkage units (e.g. COM on Windows). If the cross-DSO CFI mode is enabled, bitset checks are emitted even for classes with public LTO visibility, as that mode uses a separate mechanism to cause bitsets to be exported. This mechanism replaces the whole-program-vtables blacklist, so remove the -fwhole-program-vtables-blacklist flag. Because __declspec(uuid()) now implies [[clang::lto_visibility_public]], the support for the special attr:uuid blacklist entry is removed. Differential Revision: http://reviews.llvm.org/D18635 llvm-svn: 267784
* [OpenCL] Add predefined macros.Yaxun Liu2016-04-262-11/+9
| | | | | | | | | | | | OpenCL spec requires __OPENCL_C_VERSION__ to be defined based on -cl-std option. This patch implements that. The patch also defines __FAST_RELAXED_MATH__ based on -cl-fast-relaxed-math option. Also fixed a test using -std=c99 for OpenCL program. Limit allowed language standard of OpenCL to be OpenCL standards. Differential Revision: http://reviews.llvm.org/D19071 llvm-svn: 267590
* Pass -backend-option to LLVM when there is no target machine.Yaxun Liu2016-04-121-0/+4
| | | | | | | | Clang should pass -backend-option to LLVM even though there is no target machine, since LLVM passes are used when emitting LLVM IR. Differential Revision: http://reviews.llvm.org/D17552 llvm-svn: 266117
* Basic: fix profiling with GNU EABISaleem Abdulrasool2016-04-121-11/+21
| | | | | | | | | The GNU profiling support indicates that the interface is `_mcount` rather than `mcount`. Conditionalise the behaviour according to the `-meabi gnu` flag. Resolves PR27311 llvm-svn: 266039
* Correct pg instrumentation for AArch64Saleem Abdulrasool2016-04-101-19/+20
| | | | | | | | | It seems that there was a miscommunication between Renato and I, and the original behaviour of AArch64 was to be preserved and not to mirror the new behaviour. Restore the original behaviour for AArch64. Addresses post-commit review comments from Renato Golin. llvm-svn: 265899
* test: add additional tests for SVN r265888Saleem Abdulrasool2016-04-101-0/+23
| | | | | | Add test cases for AArch64 as well as that was changed as part of that change. llvm-svn: 265889
* Add support for __gnu_mcount_nc as the pg interfaceSaleem Abdulrasool2016-04-101-0/+44
| | | | | | | | | | | This adds support to optionally support using `__gnu_mcount_nc` as the mcount interface rather than `mcount` for Linux and EABI. The other targets do not provide an implementation for `__gnu_mcount_nc`. This can be activated via the `-meabi gnu` flag. Resolves PR23969. llvm-svn: 265888
* Use NoDebug compile units to mark debug metadata used only for sample-basedAdrian Prantl2016-04-082-4/+6
| | | | | | | | | | profiling and optimization remarks and indicate that no debug info shall be emitted for these compile units. http://reviews.llvm.org/D18808 <rdar://problem/25427165> llvm-svn: 265862
* Add a PragmaHandler Registry for plugins to add PragmaHandlers toJohn Brawn2016-04-041-3/+21
| | | | | | | | | | This allows plugins which add AST passes to also define pragmas to do things like only enable certain behaviour of the AST pass in files where a certain pragma is used. Differential Revision: http://reviews.llvm.org/D18319 llvm-svn: 265295
* clang-cl: Include /FI headers in /showIncludes output.Nico Weber2016-03-231-12/+12
| | | | | | | | | | | | | | | | | -H in gcc mode doesn't print -include headers, but they are included in depfiles written by MMD and friends. Since /showIncludes is what's used instead of depfiles, printing /FI there seems important (and matches cl.exe). Instead of giving HeaderIncludeGen more options, just switch on ShowAllHeaders in clang-cl mode and let clang::InitializePreprocessor() not put -include flags in the <command line> block. This changes the behavior of -E slightly, and it removes the <command line> flag from the output triggered by setting the obscure CC_PRINT_HEADERS=1 env var to true while running clang. Both of these seem ok to change. http://reviews.llvm.org/D18401 llvm-svn: 264174
* Make it possible for AST plugins to enable themselves by defaultJohn Brawn2016-03-151-0/+7
| | | | | | | | | | | | Currently when an AST plugin is loaded it must then be enabled by passing -plugin pluginname or -add-plugin pluginname to the -cc1 command line. This patch adds a method to PluginASTAction which allows it to declare that the action happens before, instead of, or after the main AST action, plus the relevant changes to make the plugin action happen at that time automatically. Differential Revision: http://reviews.llvm.org/D17959 llvm-svn: 263546
* Revert r260266 (and r260276), "clang-cl: Enable plugins on Windows"NAKAMURA Takumi2016-02-111-1/+0
| | | | | | It doesn't work, at least, i686-win32. llvm-svn: 260537
* Fix the test added in r260266Ehsan Akhgari2016-02-091-1/+1
| | | | llvm-svn: 260276
* clang-cl: Enable plugins on WindowsEhsan Akhgari2016-02-091-0/+1
| | | | llvm-svn: 260266
* Add backend dignostic printer for unsupported featuresOliver Stannard2016-02-021-2/+2
| | | | | | | | | | | | | | Re-commit of r258950 after fixing layering violation. The related LLVM patch adds a backend diagnostic type for reporting unsupported features, this adds a printer for them to clang. In the case where debug location information is not available, I've changed the printer to report the location as the first line of the function, rather than the closing brace, as the latter does not give the user any information. This also affects optimisation remarks. llvm-svn: 259499
* Revert r259036, it introduces a cyclic library dependencyOliver Stannard2016-01-281-2/+2
| | | | llvm-svn: 259043
OpenPOWER on IntegriCloud