Commit Graph

25 Commits

Author SHA1 Message Date
Coby Tayree aecc982abe Fixups to FE tests affected by D36793
Differential Revision: https://reviews.llvm.org/D36794


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311640 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-24 08:47:26 +00:00
Saleem Abdulrasool 49c4c7d799 Sema: prevent __declspec(naked) use on x64
MSDN (https://msdn.microsoft.com/en-us/library/h5w10wxs.aspx) indicates
that `__declspec(naked)` is only permitted on x86 and ARM targets.
Testing with cl does confirm this behaviour.  Provide a warning for use
of `__declspec(naked)` on x64.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299774 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-07 15:13:47 +00:00
Aaron Ballman b3ce54c645 __declspec is not a core Clang language extension. Instead, require -fms-extensions or -fborland to enable the language extension.
Note: __declspec is also temporarily enabled when compiling for a CUDA target because there are implementation details relying on __declspec(property) support currently. When those details change, __declspec should be disabled for CUDA targets.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238238 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 19:44:52 +00:00
Ehsan Akhgari de87f96e74 ms-inline-asm: Correctly mark MS inline ASM labels as used
Summary: This fixes PR21155.

Test Plan: The patch includes a test.

Reviewers: rnk

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D5619

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219322 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-08 17:28:34 +00:00
Ehsan Akhgari d88b0e1b7f ms-inline-asm: Scope inline asm labels to functions
Summary:
This fixes PR20023.  In order to implement this scoping rule, we piggy
back on the existing LabelDecl machinery, by creating LabelDecl's that
will carry the "internal" name of the inline assembly label, which we
will rewrite the asm label to.

Reviewers: rnk

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D4589

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218230 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-22 02:21:54 +00:00
Hans Wennborg e0e727e025 Don't allow inline asm statements to reference parameters in naked functions
Differential Revision: http://reviews.llvm.org/D5183

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217200 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-04 22:16:48 +00:00
Reid Kleckner f3bd7cfdd7 MS inline asm: Add tests for LLVM r214468
This used to assert.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214551 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-01 20:23:03 +00:00
Ehsan Akhgari e26841e34d clang-cl: Merge adjacent single-line __asm blocks
Summary:
This patch extends the __asm parser to make it keep parsing input tokens
as inline assembly if a single-line __asm line is followed by another line
starting with __asm too.  It also makes sure that we correctly keep
matching braces in such situations by separating the notions of how many
braces we are matching and whether we are in single-line asm block mode.

Reviewers: rnk

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D4598

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213916 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-25 02:27:14 +00:00
Ehsan Akhgari 67eada069f Fix up the test that expects the failure fixed in r212352
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212353 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-04 19:22:29 +00:00
Reid Kleckner cd2a97492e Add tests for MS inline asm change r203146
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203147 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-06 19:19:36 +00:00
Reid Kleckner 5dc62e379a Tests for LLVM MS inline asm change r202865
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202866 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 17:57:56 +00:00
NAKAMURA Takumi a8fb443f44 clang/test: REQUIRES: s/x86-64-registered-target/x86-registered-target/
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196350 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-04 03:41:33 +00:00
Dmitri Gribenko 59953e5dc4 MS inline asm: When LLVM called back to Clang to parse a name and do name
lookup, if parsing failed, we did not restore the lexer state properly, and
eventually crashed.  This change ensures that we always consume all the tokens
from the new token stream we started to parse the name from inline asm.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196182 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-03 00:48:09 +00:00
Benjamin Kramer 31e0e38d09 Reenable ms inline asm test.
LLVM r196044 should make it pass.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196045 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-01 11:48:10 +00:00
Chad Rosier 8b3326527e Fail these tests in a way that doesn't cause unexpected successes, per Daniel's
suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173367 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-24 20:46:39 +00:00
Chad Rosier 872a6f6bfe Temporarily XFAIL this test; the compiler will segfault if the target-specific
parser is not included in the compiler. Thanks to Renato for discovering the
underlying issue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173365 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-24 20:33:35 +00:00
Chad Rosier b2e2157f90 [ms-inline asm] Remove the -fenable-experimental-ms-inline-asm flag. MS-style
inline assembly can be enable with -fasm-blocks or -fms-extensions alone.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173186 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 19:38:32 +00:00
Chad Rosier 96bd14bf58 [ms-inline asm] Test case for r172773.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172774 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 00:51:29 +00:00
Chad Rosier 205ecf0193 [ms-inline asm] Updates and test case for r172743.
Part of rdar://12576868

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172744 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17 19:22:48 +00:00
Chad Rosier 9b629fcb8b [ms-inline asm] Test case for r170037.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170038 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-12 22:46:23 +00:00
Chad Rosier 15490fd42d [driver, ms-inline asm] MS-Style inline assembly is controlled by the
-fasm-blocks flag, not the -fms-extensions flag.
rdar://12808010

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169422 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-05 21:08:21 +00:00
Chad Rosier 0adc4d29d6 [ms-inline asm] Add test case for r166792.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166793 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-26 18:33:59 +00:00
David Tweed dd6e106621 These tests require an actual x86 registered target, so mark them as such. Tested on ARM.
Patch by Joey Gouly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166765 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-26 10:17:44 +00:00
Eli Friedman 5f1385b81b [ms-inline-asm] Add handling for errors coming out of the backend.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166463 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-23 02:43:30 +00:00
Bob Wilson b0f6b9c940 Replace an assertion with an error for empty __asm statements.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164551 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-24 19:57:59 +00:00