summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/alias.c
Commit message (Collapse)AuthorAgeFilesLines
* [Clang][CodeGen] support alias attribute w/ gnu_inlineNick Desaulniers2019-09-121-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: r369705 did not consider the addition of gnu_inline on function declarations of alias attributed functions. This resulted in a reported regression in the clang-9-rc4 release from the Zig developers building glibc, which was observable as a failed assertion: llvm-project/clang/lib/AST/Decl.cpp:3336: bool clang::FunctionDecl::isInlineDefinitionExternallyVisible() const: Assertion `(doesThisDeclarationHaveABody() || willHaveBody()) && "Must be a function definition"' failed. Alias function declarations do not have bodies, so allow us to proceed if we have the alias function attribute but no body/definition, and add a test case. The emitted symbols and their linkage matches GCC for the added test case. Link: https://bugs.llvm.org/show_bug.cgi?id=43268 Reviewers: aaron.ballman, rsmith, erichkeane, andrewrk Reviewed By: andrewrk Subscribers: cfe-commits, andrewrk, hans, srhines Tags: #clang Differential Revision: https://reviews.llvm.org/D67455 llvm-svn: 371766
* [Bugfix] fix r369705 unit testNick Desaulniers2019-08-221-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: Aliases aren't supported on OSX. Add a GNU target triple. Reported-by: leonardchan Reported-by: erik.pilkington Reviewers: leonardchan, erik.pilkington Reviewed By: leonardchan, erik.pilkington Subscribers: dexonsmith, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66622 llvm-svn: 369713
* [Clang][CodeGen] set alias linkage on QualTypeNick Desaulniers2019-08-221-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: It seems that CodeGen was always using ExternalLinkage when emitting a GlobalDecl with __attribute__((alias)). This leads to symbol redefinitions (ODR) that cause failures at link time for static aliases. This is readily attempting to link an ARM (32b) allyesconfig Linux kernel built with Clang. Reported-by: nathanchance Suggested-by: ihalip Link: https://bugs.llvm.org/show_bug.cgi?id=42377 Link: https://github.com/ClangBuiltLinux/linux/issues/631 Reviewers: rsmith, aaron.ballman, erichkeane Reviewed By: aaron.ballman Subscribers: javed.absar, kristof.beyls, cfe-commits, srhines, ihalip, nathanchance Tags: #clang Differential Revision: https://reviews.llvm.org/D66492 llvm-svn: 369705
* Update test after r328635 in LLVMKrzysztof Parzyszek2018-03-271-3/+3
| | | | llvm-svn: 328641
* Cleanup the handling of noinline function attributes, -fno-inline,Chandler Carruth2016-12-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -fno-inline-functions, -O0, and optnone. These were really, really tangled together: - We used the noinline LLVM attribute for -fno-inline - But not for -fno-inline-functions (breaking LTO) - But we did use it for -finline-hint-functions (yay, LTO is happy!) - But we didn't for -O0 (LTO is sad yet again...) - We had weird structuring of CodeGenOpts with both an inlining enumeration and a boolean. They interacted in weird ways and needlessly. - A *lot* of set smashing went on with setting these, and then got worse when we considered optnone and other inlining-effecting attributes. - A bunch of inline affecting attributes were managed in a completely different place from -fno-inline. - Even with -fno-inline we failed to put the LLVM noinline attribute onto many generated function definitions because they didn't show up as AST-level functions. - If you passed -O0 but -finline-functions we would run the normal inliner pass in LLVM despite it being in the O0 pipeline, which really doesn't make much sense. - Lastly, we used things like '-fno-inline' to manipulate the pass pipeline which forced the pass pipeline to be much more parameterizable than it really needs to be. Instead we can *just* use the optimization level to select a pipeline and control the rest via attributes. Sadly, this causes a bunch of churn in tests because we don't run the optimizer in the tests and check the contents of attribute sets. It would be awesome if attribute sets were a bit more FileCheck friendly, but oh well. I think this is a significant improvement and should remove the semantic need to change what inliner pass we run in order to comply with the requested inlining semantics by relying completely on attributes. It also cleans up tho optnone and related handling a bit. One unfortunate aspect of this is that for generating alwaysinline routines like those in OpenMP we end up removing noinline and then adding alwaysinline. I tried a bunch of other approaches, but because we recompute function attributes from scratch and don't have a declaration here I couldn't find anything substantially cleaner than this. Differential Revision: https://reviews.llvm.org/D28053 llvm-svn: 290398
* Fix Clang tests that used CHECK-NEXT-NOT and CHECK-DAG-NOT.Paul Robinson2016-02-261-3/+3
| | | | | | | | FileCheck actually doesn't support combo suffixes. Differential Revision: http://reviews.llvm.org/D17589 llvm-svn: 262052
* [opaque pointer type] update test cases for explicit pointee types on global ↵David Blaikie2015-09-111-8/+8
| | | | | | aliases llvm-svn: 247380
* The alias.c test now requires arm-registered-targetJohn Brawn2015-08-121-0/+1
| | | | | | This should fix a buildbot failure llvm-svn: 244760
* Add test for PR24379John Brawn2015-08-121-2/+25
| | | | | | | | | | The fix for this is in LLVM but it depends on how clang handles the alias attribute, so add a test to the clang tests to make sure everything works together as expected. Differential Revision: http://reviews.llvm.org/D11980 llvm-svn: 244756
* CodeGen: Don't drop thread_local when emitting __thread aliasesDavid Majnemer2014-10-151-0/+5
| | | | | | | | | | | | CodeGen wouldn't mark the aliasee as thread_local if the aliasee was a tentative definition. Even if the definition was already emitted, it would never mark the alias as thread_local. This fixes PR21288. llvm-svn: 219859
* Update for llvm change.Rafael Espindola2014-07-301-1/+1
| | | | llvm-svn: 214356
* Update for llvm API change.Rafael Espindola2014-06-031-2/+2
| | | | | | Aliases in llvm now hold an arbitrary expression. llvm-svn: 210063
* Update for llvm api change.Rafael Espindola2014-05-161-2/+2
| | | | | | | | | | Now that llvm cannot represent alias cycles, we have to diagnose erros just before trying to close the cycle. This degrades the errors a bit. The real solution is what it was before: if we want to provide good errors for these cases, we have to be able to find a clang level decl given a mangled name and produce the error from Sema. llvm-svn: 209008
* Fix pr19653.Rafael Espindola2014-05-051-0/+5
| | | | | | Warn if an alias requests a section other than the aliasee section. llvm-svn: 207997
* Handle and warn on aliases to weak aliases.Rafael Espindola2014-03-271-0/+6
| | | | | | | This produces valid IR now that llvm rejects aliases to weak aliases and warns the user that the resolution is not changed if the weak alias is overridden. llvm-svn: 204935
* Also don't hardcode the order on this test.Rafael Espindola2013-10-141-2/+2
| | | | llvm-svn: 192603
* CHECK-LABEL-ify some code gen tests to improve diagnostic experience when ↵Stephen Lin2013-08-151-1/+1
| | | | | | tests fail. llvm-svn: 188447
* Fix testcases to not rely upon target-* attributes.Bill Wendling2013-02-261-9/+7
| | | | llvm-svn: 176135
* Revert "Add more attributes from the command line to functions."Anna Zaks2013-02-251-7/+9
| | | | | | | | This reverts commit 176009. The commit is a likely cause of several buildbot failures. llvm-svn: 176044
* Add more attributes from the command line to functions.Bill Wendling2013-02-251-9/+7
| | | | | | | This is an ongoing process. Any command line option which a back-end cares about should be added here. llvm-svn: 176009
* Modify the tests to use attribute group references instead of listing theBill Wendling2013-02-201-5/+11
| | | | | | function attributes. llvm-svn: 175606
* Add the 'target-cpu' and 'target-features' attributes to functions.Bill Wendling2013-02-151-2/+2
| | | | | | | The back-end will use these values to reconfigure code generation for different features. llvm-svn: 175308
* Fix another spot where this test varied for a Release build.Alex Rosenberg2012-10-051-2/+2
| | | | llvm-svn: 165347
* Make test resilient to Release build temp names.Alex Rosenberg2012-10-051-2/+2
| | | | llvm-svn: 165345
* Propagate calling convention for aliases and weakrefs.Alex Rosenberg2012-10-051-7/+23
| | | | llvm-svn: 165343
* FileCheckize testAlex Rosenberg2012-10-051-15/+13
| | | | llvm-svn: 165342
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* Eliminate &&s in tests.Daniel Dunbar2009-11-081-6/+6
| | | | | | - 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&& *$#\1#g' $i | FileUpdate $i; done', for the curious. llvm-svn: 86430
* Diagnose uses of function specifiers on declarations which don't declareEli Friedman2009-04-071-1/+1
| | | | | | functions. Fixes PR3941. llvm-svn: 68541
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* make alias definition logic more similar to functions/globals.Chris Lattner2009-03-221-0/+7
| | | | llvm-svn: 67481
* fix PR3200 by making alias emission use the new infrastructure. Fold Chris Lattner2009-03-221-1/+13
| | | | | | some tests into the alias.c file. llvm-svn: 67479
* IRgen support for alias of global variable.Daniel Dunbar2009-03-191-0/+13
- PR3818. llvm-svn: 67297
OpenPOWER on IntegriCloud