summaryrefslogtreecommitdiffstats
path: root/clang/test/Frontend
Commit message (Collapse)AuthorAgeFilesLines
...
* Add backend dignostic printer for unsupported featuresOliver Stannard2016-01-281-2/+2
| | | | | | | | | | | | | | | | | | Re-commit of r258950 after fixing layering violation. Add backend dignostic printer for unsupported features 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. Differential Revision: http://reviews.llvm.org/D16591 llvm-svn: 259036
* Revert r258951 (and r258950), "Refactor backend diagnostics for unsupported ↵NAKAMURA Takumi2016-01-281-2/+2
| | | | | | | | | | | features" It broke layering violation in LLVMIR. clang r258950 "Add backend dignostic printer for unsupported features" llvm r258951 "Refactor backend diagnostics for unsupported features" llvm-svn: 259016
* Add backend dignostic printer for unsupported featuresOliver Stannard2016-01-271-2/+2
| | | | | | | | | | | | | | 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. Differential Revision: http://reviews.llvm.org/D16591 llvm-svn: 258950
* Preprocessor: define correct tvOS and watchOS version macrosTim Northover2015-10-301-0/+22
| | | | llvm-svn: 251707
* Add back null check removed accidentally in r250554Reid Kleckner2015-10-201-0/+3
| | | | | | Fixes PR25262 llvm-svn: 250844
* Stop messing with the 'g' group of options in CompilerInvocation.Douglas Katzman2015-10-082-2/+2
| | | | | | | | | | | | | | | | With this change, most 'g' options are rejected by CompilerInvocation. They remain only as Driver options. The new way to request debug info from cc1 is with "-debug-info-kind={line-tables-only|limited|standalone}" and "-dwarf-version={2|3|4}". In the absence of a command-line option to specify Dwarf version, the Toolchain decides it, rather than placing Toolchain-specific logic in CompilerInvocation. Also fix a bug in the Windows compatibility argument parsing in which the "rightmost argument wins" principle failed. Differential Revision: http://reviews.llvm.org/D13221 llvm-svn: 249655
* Fix the sample profile format that breaks in test ↵Dehao Chen2015-09-301-1/+1
| | | | | | | | http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/505 http://reviews.llvm.org/D13145 llvm-svn: 248869
* Revert "Always_inline codegen rewrite" and 2 follow-ups.Evgeniy Stepanov2015-09-142-6/+3
| | | | | | | | | | Revert "Update cxx-irgen.cpp test to allow signext in alwaysinline functions." Revert "[CodeGen] Remove wrapper-free always_inline functions from COMDATs" Revert "Always_inline codegen rewrite." Reason for revert: PR24793. llvm-svn: 247620
* Always_inline codegen rewrite.Evgeniy Stepanov2015-09-122-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current implementation may end up emitting an undefined reference for an "inline __attribute__((always_inline))" function by generating an "available_externally alwaysinline" IR function for it and then failing to inline all the calls. This happens when a call to such function is in dead code. As the inliner is an SCC pass, it does not process dead code. Libc++ relies on the compiler never emitting such undefined reference. With this patch, we emit a pair of 1. internal alwaysinline definition (called F.alwaysinline) 2a. A stub F() { musttail call F.alwaysinline } -- or, depending on the linkage -- 2b. A declaration of F. The frontend ensures that F.inlinefunction is only used for direct calls, and the stub is used for everything else (taking the address of the function, really). Declaration (2b) is emitted in the case when "inline" is meant for inlining only (like __gnu_inline__ and some other cases). This approach, among other nice properties, ensures that alwaysinline functions are always internal, making it impossible for a direct call to such function to produce an undefined symbol reference. This patch is based on ideas by Chandler Carruth and Richard Smith. llvm-svn: 247494
* Revert "Specify target triple in alwaysinline tests."Evgeniy Stepanov2015-09-112-6/+3
| | | | | | | | | Revert "Always_inline codegen rewrite." Breaks gdb & lldb tests. Breaks on Fedora 22 x86_64. llvm-svn: 247491
* Always_inline codegen rewrite.Evgeniy Stepanov2015-09-112-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current implementation may end up emitting an undefined reference for an "inline __attribute__((always_inline))" function by generating an "available_externally alwaysinline" IR function for it and then failing to inline all the calls. This happens when a call to such function is in dead code. As the inliner is an SCC pass, it does not process dead code. Libc++ relies on the compiler never emitting such undefined reference. With this patch, we emit a pair of 1. internal alwaysinline definition (called F.alwaysinline) 2a. A stub F() { musttail call F.alwaysinline } -- or, depending on the linkage -- 2b. A declaration of F. The frontend ensures that F.inlinefunction is only used for direct calls, and the stub is used for everything else (taking the address of the function, really). Declaration (2b) is emitted in the case when "inline" is meant for inlining only (like __gnu_inline__ and some other cases). This approach, among other nice properties, ensures that alwaysinline functions are always internal, making it impossible for a direct call to such function to produce an undefined symbol reference. This patch is based on ideas by Chandler Carruth and Richard Smith. llvm-svn: 247465
* This test requires UTF-8 output to print the UT-8 characters.Yaron Keren2015-09-111-0/+1
| | | | llvm-svn: 247410
* Do not include default sanitizer blacklists into -M/-MM/-MD/-MMD output.Ivan Krasin2015-09-021-1/+1
| | | | | | | | | | | | | | | | | Summary: Do not include default sanitizer blacklists into -M/-MM/-MD/-MMD output. Introduce a frontend option -fdepfile-entry, and only insert them for the user-defined sanitizer blacklists. In frontend, grab ExtraDeps from -fdepfile-entry, instead of -fsanitize-blacklist. Reviewers: rsmith, pcc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D12544 llvm-svn: 246700
* Improve options printed on vectorization analysis diagnostics.Tyler Nowicki2015-08-271-2/+2
| | | | | | | | | | | The LLVM patch changes the analysis diagnostics produced when loops with floating-point recurrences or memory operations are identified. The new messages say "cannot prove it is safe to reorder * operations; allow reordering by specifying #pragma clang loop vectorize(enable)". Depending on the type of diagnostic the message will include additional options such as ffast-math or __restrict__. llvm-svn: 246189
* Remove test cases, which rely on the default sanitizer blacklists.Ivan Krasin2015-08-131-5/+0
| | | | | | | | | | | | | | Summary: The default blacklists may vary across different architectures and configurations. It was not wise to include into http://reviews.llvm.org/D11968 Reviewers: chapuni, pcc Subscribers: cfe-commits, pcc Differential Revision: http://reviews.llvm.org/D12021 llvm-svn: 244985
* clang/test/Frontend/dependency-gen.c: Add explicit -target x86_64-linux-gnu ↵NAKAMURA Takumi2015-08-131-2/+2
| | | | | | for -fsanitize. llvm-svn: 244970
* Disable failing check in bots from r244867.Yaron Keren2015-08-131-1/+0
| | | | llvm-svn: 244869
* Add sanitizer blacklists to the rules generated with -M/-MM/-MD/-MMD.Ivan Krasin2015-08-132-1/+18
| | | | | | | | | | | | | | | | | | | Summary: Clang sanitizers, such as AddressSanitizer, ThreadSanitizer, MemorySanitizer, Control Flow Integrity and others, use blacklists to specify which types / functions should not be instrumented to avoid false positives or suppress known failures. This change adds the blacklist filenames to the list of dependencies of the rules, generated with -M/-MM/-MD/-MMD. This lets CMake/Ninja recognize that certain C/C++/ObjC files need to be recompiled (if a blacklist is updated). Reviewers: pcc Subscribers: rsmith, honggyu.kim, pcc, cfe-commits Differential Revision: http://reviews.llvm.org/D11968 llvm-svn: 244867
* Make the analysis reporting test with x86 to fix the hexagon build.Tyler Nowicki2015-08-111-2/+2
| | | | llvm-svn: 244561
* Print vectorization analysis when loop hint is specified.Tyler Nowicki2015-08-111-0/+21
| | | | | | This patche and a related llvm patch solve the problem of having to explicitly enable analysis when specifying a loop hint pragma to get the diagnostics. Passing AlwasyPrint as the pass name (see below) causes the front-end to print the diagnostic if the user has specified '-Rpass-analysis' without an '=<target-pass>’. Users of loop hints can pass that compiler option without having to specify the pass and they will get diagnostics for only those loops with loop hints. llvm-svn: 244556
* Append options for vectorization when pointer checking threshold is exceeded.Tyler Nowicki2015-08-101-0/+9
| | | | | | Following one of the appended options will allow the loop to be vectorized. We do not include a command line option for modifying the pointer checking threshold because there is no clang-level interface for this currently. llvm-svn: 244526
* Make frontend floating-point commutivity test X86 specific to avoid ↵Tyler Nowicki2015-08-101-1/+1
| | | | | | cost-model related problems on arm-thumb and hexagon. llvm-svn: 244517
* Remove non-ascii characters.Tyler Nowicki2015-08-101-1/+1
| | | | llvm-svn: 244506
* Append options for floating-point commutivity when related diagnostics are ↵Tyler Nowicki2015-08-101-0/+12
| | | | | | | | produced. With this patch clang appends the command line options that would allow vectorization when floating-point commutativity is required. Specifically those are enabling fast-math or specifying a loop hint. llvm-svn: 244492
* Revert "Revert r241620 and follow-up commits" and move the initializationAdrian Prantl2015-07-081-0/+1
| | | | | | of the llvm targets from clang/CodeGen into ClangCheck.cpp and CIndex.cpp. llvm-svn: 241653
* Revert r241620 and follow-up commits while investigating linux buildbot ↵Adrian Prantl2015-07-071-1/+0
| | | | | | failures. llvm-svn: 241642
* Wrap clang modules and pch files in an object file container.Adrian Prantl2015-07-071-0/+1
| | | | | | | | | | | | | This patch adds ObjectFilePCHContainerOperations uses the LLVM backend to put the contents of a PCH into a __clangast section inside a COFF, ELF, or Mach-O object file container. This is done to facilitate module debugging by makeing it possible to store the debug info for the types defined by a module alongside the AST. rdar://problem/20091852 llvm-svn: 241620
* Commit some test changes somehow missed in r239789.Richard Smith2015-06-161-1/+1
| | | | llvm-svn: 239791
* Add `-verify-ignore-unexpected` option to ignore unexpected diagnostics in ↵Eric Fiselier2015-06-131-0/+81
| | | | | | | | | | | | | | | | | | | | | VerifyDiagnosticsConsumer Summary: The goal of this patch is to make `-verify` easier to use when testing libc++. The `notes` attached to compile error diagnostics are numerous and relatively unstable when they reference libc++ header internals. This patch allows libc++ to write stable compilation failure tests by allowing unexpected diagnostic messages to be ignored where they are not relevant. This patch adds a new CC1 flag called `-verify-ignore-unexpected`. `-verify-ignore-unexpected` tells `VerifyDiagnosticsConsumer` to ignore *all* unexpected diagnostic messages. `-verify-ignore-unexpected=<LevelList>` can be used to only ignore certain diagnostic levels. `<LevelList>` is a comma separated list of diagnostic levels to ignore. The supported levels are `note`, `remark`, `warning` and `error`. Reviewers: bogner, grosser, EricWF Reviewed By: EricWF Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D10138 llvm-svn: 239665
* Fix fragile source-col-map.c test-case.James Y Knight2015-06-041-2/+3
| | | | | | | | | | | The test passing was dependent upon your source tree being checked out in a directory with a long enough path, to cause the diagnostics to wrap at the expected locations. Use stdin instead, so that the error messages consistently use <stdin> as the filename, and get wrapped consistently. llvm-svn: 239009
* Don't leak TemplateIds when a plugin parses late-parsed templates at TU end.Nico Weber2015-05-171-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | In -fdelayed-template-parsing mode, templates that aren't used are not parsed at all. For some diagnostic plugins, this is a problem since they want to analyse the contents of the template function body. What has been suggested on cfe-dev [1] is to explicitly parse interesting templates in HandleTranslationUnit(); IWYU does this for example [2]. This is workable, but since the delayed parsing doesn't run below a call to ParseTopLevelDecl(), no DestroyTemplateIdAnnotationsRAIIObj object is on the stack to clean up TemplateIds that are created during parsing. To fix this, let ~Parser() clean them up in delayed template parsing mode instead of leaking (or asserting in +Assert builds). (r219810, relanded in r220400, fixed the same problem in incremental processing mode; the review thread of r219810 has a good discussion of the problem.) To test this, give the PrintFunctionNames plugin a flag to force parsing of a template and add a test that uses it in -fdelayed-template-parsing mode. Without the Parser.cpp change, that test asserts. 1: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-August/038415.html 2: https://code.google.com/p/include-what-you-use/source/detail?r=566 llvm-svn: 237531
* clang/test/Frontend/dependency-gen-escaping.c: Appease win32 hosts. ↵NAKAMURA Takumi2015-05-141-1/+1
| | | | | | | Investigating. FIXME: Do we really emit single \ or escaped \\ along the context with -fms-compatibility -MG? llvm-svn: 237347
* clang/test/Frontend/dependency-gen-escaping.c: Tweak r237296, to let '/' and ↵NAKAMURA Takumi2015-05-141-3/+7
| | | | | | '\\' distinguishd, to unbreak "--host=linux --target=msvc". llvm-svn: 237333
* Break \# in a depfile the same way as gcc.Paul Robinson2015-05-131-3/+4
| | | | | | | | Backslash followed by # in a filename should have both characters escaped, if you do it the way GNU Make wants. GCC doesn't, so we do it the way GCC does rather than the way GNU Make wants. llvm-svn: 237304
* Make GNUInline consistent with whether we use traditional GNU inline semantics.Peter Collingbourne2015-05-131-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we were setting LangOptions::GNUInline (which controls whether we use traditional GNU inline semantics) if the language did not have the C99 feature flag set. The trouble with this is that C++ family languages also do not have that flag set, so we ended up setting this flag in C++ modes (and working around it in a few places downstream by also checking CPlusPlus). The fix is to check whether the C89 flag is set for the target language, rather than whether the C99 flag is cleared. This also lets us remove most CPlusPlus checks. We continue to test CPlusPlus when deciding whether to pre-define the __GNUC_GNU_INLINE__ macro for consistency with GCC. There is a change in semantics in two other places where we weren't checking both CPlusPlus and GNUInline (FunctionDecl::doesDeclarationForceExternallyVisibleDefinition and FunctionDecl::isInlineDefinitionExternallyVisible), but this change seems to put us back into line with GCC's semantics (test case: test/CodeGen/inline.c). While at it, forbid -fgnu89-inline in C++ modes, as GCC doesn't support it, it didn't have any effect before, and supporting it just makes things more complicated. Differential Revision: http://reviews.llvm.org/D9333 llvm-svn: 237299
* Fix dependency file escaping.Paul Robinson2015-05-131-0/+8
| | | | | | | | | | | | | | When writing a dependency (.d) file, if space or # is immediately preceded by one or more backslashes, escape the backslashes as well as the space or # character. Otherwise leave backslash alone. This straddles the fence between BSD Make (which does no escaping at all, and does not support space or # in filespecs) and GNU Make (which does support escaping, but will fall back to the filespec as-written if the escaping doesn't match an existing file). Differential Revision: http://reviews.llvm.org/D9208 llvm-svn: 237296
* Simplify depfile quoting test.Paul Robinson2015-04-271-15/+8
| | | | | | | With -MG we don't actually need to create the files with funky names. Also use a more sensible check-prefix for the NMAKE case. llvm-svn: 235908
* Support generating NMake/Jom-style depfiles.Paul Robinson2015-04-271-0/+9
| | | | | | | | | | | | | | | NMake is a Make-like builder that comes with Microsoft Visual Studio. Jom (https://wiki.qt.io/Jom) is an NMake-compatible build tool. Dependency files for NMake/Jom need to use double-quotes to wrap filespecs containing special characters, instead of the backslash escapes that GNU Make wants. Adds the -MV option, which specifies to use double-quotes as needed instead of backslash escapes when writing the dependency file. Differential Revision: http://reviews.llvm.org/D9260 llvm-svn: 235903
* Fix typo in my last commit.Matthias Braun2015-03-031-1/+1
| | | | llvm-svn: 231039
* Remove shell requirements from tests that use 'cd'Reid Kleckner2015-03-023-4/+0
| | | | | | | | Modules and Tooling tests in particular tend to want to change the cwd, so we were missing test coverage in this area on Windows. It should now be easier to write such portable tests. llvm-svn: 231029
* Improve robustness of dependency-generation-crash.c test.Matthias Braun2015-03-021-4/+1
| | | | | | | | | | | The test wants to provoke a failure when opening the output file. Using chmod 0 on the output file does not work reliably on all filesystems or when running the test as root. Change the test to use a nonexistant directory instead. Differential Revision: http://reviews.llvm.org/D7620 llvm-svn: 231009
* Add -fuse-line-directive flag to control usage of #line with -EReid Kleckner2015-02-261-0/+22
| | | | | | | | | | | | | | | | | | Currently -fms-extensions controls this behavior, which doesn't make much sense. It means we can't identify what is and isn't a system header when compiling our own preprocessed output, because #line doesn't represent this information. If someone is feeding Clang's preprocessed output to another compiler, they can use this flag. Fixes PR20553. Reviewers: rsmith Differential Revision: http://reviews.llvm.org/D5217 llvm-svn: 230587
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-251-1/+0
| | | | llvm-svn: 230454
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-251-0/+1
| | | | | | | | | | | | | | | | | This is a necessary prerequisite for debugging with modules. The .pcm files become containers that hold the serialized AST which allows us to store debug information in the module file that can be shared by all object files that were built importing the module. This reapplies r230044 with a fixed configure+make build and updated dependencies and testcase requirements. Over the last iteration this version adds - missing target requirements for testcases that specify an x86 triple, - a missing clangCodeGen.a dependency to libClang.a in the make build. rdar://problem/19104245 llvm-svn: 230423
* Fix copy-paste errors in the testDmitri Gribenko2015-02-231-3/+3
| | | | llvm-svn: 230272
* Fix dependency generation crash test to run clang and clean up after itself.Greg Bedwell2015-02-121-1/+5
| | | | | | | | | | Previously the test did not have a RUN: prefix for the clang command. In addition it was leaving behind a tmp file with no permissions causing issues when deleting the build directory on Windows. Differential Revision: http://reviews.llvm.org/D7534 llvm-svn: 228919
* Update darwin-version testsSteven Wu2015-02-041-17/+17
| | | | | | | | | | | | | | | | | Summary: Now that the darwin-version tests in Driver and Frontend are testing different parts of the version encoding instead of doing duplicated work Reviewers: rnk Reviewed By: rnk Subscribers: rnk, cfe-commits Differential Revision: http://reviews.llvm.org/D7134 llvm-svn: 228159
* Frontend: Fix SourceColumnMap assertion failure on non-ascii characters.Logan Chien2015-01-081-0/+37
| | | | | | | | | | | | | | | | | | | | If there are some non-ascii character in the input source code, the column index might be smallar than the byte index. This will result in two possible assertion failures. This CL fixes the computation of the column index and byte index. 1. The assertion in startOfNextColumn() and startOfPreviousColumn() should not be raised when the byte index is greater than the column index since the non-ascii characters may use more than one bytes to store a character in a column. 2. The length of the caret line should be equal to the number of columns of source line, instead of the length of the source line. Otherwise, the assertion in selectInterestingSourceRegion will be raised because the removed columns plus the kept columns are not greater than the max column, which means that we should not remove any column at all. llvm-svn: 225442
* Add driver flags -ftrigraphs, -fno-trigraphs.Nico Weber2014-12-231-2/+2
| | | | | | | | | | | | | | | | | -trigraphs is now an alias for -ftrigraphs. -fno-trigraphs makes it possible to explicitly disable trigraphs, which couldn't be done before. clang -std=c++11 -fno-trigraphs now builds without GNU extensions, but with trigraphs disabled. Previously, trigraphs were only disabled in GNU modes or with -std=c++1z. Make the new -f flags the cc1 interface too. This requires changing -trigraphs to -ftrigraphs in a few cc1 tests. Related to PR21974. llvm-svn: 224790
* Disable trigraphs in microsoft mode by default. Matches cl.exe.Nico Weber2014-12-221-2/+4
| | | | | | | | | | The default value of Opts.Trigraphs now no longer depends solely on the language input kind, so move the code out of setLangDefaults(). Also make sure that Opts.MSVCCompat is set before the Trigraph code runs. Related to PR21974. llvm-svn: 224719
OpenPOWER on IntegriCloud