summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/ms-inline-asm.c
Commit message (Collapse)AuthorAgeFilesLines
* [X86] Add test case for llvm change r329734Craig Topper2018-04-101-0/+7
| | | | | | This test ensures the popfd instruction in MS inline assembly can properly find a clobber name for the dirflag register. Previously the register was named 'DF', but it needs to be named 'dirflag' to match the name in the GCC register name list. llvm-svn: 329738
* Avoid unecessary opsize byte in segment move to memoryNirav Dave2017-11-211-6/+6
| | | | | | | | | | | | | | | | | Segment moves to memory are always 16-bit. Remove invalid 32 and 64 bit variants. Recommiting with missing clang inline assembly test change. Fixes PR34478. Reviewers: rnk, craig.topper Subscribers: llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D39847 llvm-svn: 318797
* [x86][inline-asm] allow recognition of MPX regs inside ms inline-asm blobCoby Tayree2017-11-211-0/+11
| | | | | | Differential Revision: https://reviews.llvm.org/D38445 llvm-svn: 318739
* Fixups to FE tests affected by D36793Coby Tayree2017-08-241-59/+59
| | | | | | Differential Revision: https://reviews.llvm.org/D36794 llvm-svn: 311640
* [X86][Asm] Allow negative immediate to appear before bracketed expressionCoby Tayree2017-08-091-3/+9
| | | | | | | | | | | Currently, only non-negative immediate is allowed prior to a brac expression (memory reference). MASM / GAS does not have any problem cope with the left side of the real line, so we should be able to as well. llvm: D36229 Differential Revision: https://reviews.llvm.org/D36230 llvm-svn: 310529
* [X86][Ms-InlineAsm] Extend MS Dot operator to accept "this" + struct/class ↵Coby Tayree2017-08-091-2/+6
| | | | | | | | | | | pointers aliases MS InlineAsm Dot operator accepts "Bases" such as "this" (cpp) and class/struct pointer typedef. This patch enhance its implementation with this behavior. Differential Revision: https://reviews.llvm.org/D36450 llvm-svn: 310472
* [x86][inline-asm]Allow a pack of Control Debug to be properly pickedCoby Tayree2017-08-011-0/+13
| | | | | | | | Allows the incorporation of legit (x86) Debug Regs within inline asm stataements Differential Revision: https://reviews.llvm.org/D36074 llvm-svn: 309672
* [x86][inline-asm][ms-compat] legalize the use of "jc/jz short <op>"Coby Tayree2017-07-301-1/+3
| | | | | | | | | MS ignores the keyword "short" when used after a jc/jz instruction, LLVM ought to do the same. llvm: D35892 Differential Revision: https://reviews.llvm.org/D35893 llvm-svn: 309510
* [x86][inline-asm]Allow a pack of Control Regs to be properly pickedCoby Tayree2017-07-301-0/+11
| | | | | | | | Allows the incorporation of legit (x86) Control Regs within inline asm stataements Differential Revision: https://reviews.llvm.org/D35903 llvm-svn: 309508
* Revert "This patch enables the usage of constant Enum identifiers within ↵Eric Christopher2017-07-251-7/+7
| | | | | | | | Microsoft style inline assembly statements." as it is causing msan failures. This reverts commits r308985 and r308965 llvm-svn: 309004
* This patch enables the usage of constant Enum identifiers within Microsoft ↵Matan Haroush2017-07-251-7/+7
| | | | | | | | | | style inline assembly statements. Differential Revision: https://reviews.llvm.org/D33277 https://reviews.llvm.org/D33278 llvm-svn: 308965
* [inline asm] dot operator while using imm generates wrong ir + asm - clang partMarina Yatsina2017-06-261-0/+6
| | | | | | | | | | | | | | | | | | Inline asm dot operator while using imm generates wrong ir and asm This is the test for the llvm changes committed in revision 306300 This also fixes bugzilla 32987: https://bugs.llvm.org//show_bug.cgi?id=32987 The llvm part of the review that contains the test can be found here: https://reviews.llvm.org/D33039 commit on behald of zizhar Differential Revision: https://reviews.llvm.org/D33040 llvm-svn: 306301
* [ms-inline-asm] Use the frontend size only for ambiguous instructionsReid Kleckner2017-05-041-51/+88
| | | | | | | | | | | | | | | | | | This avoids problems on code like this: char buf[16]; __asm { movups xmm0, [buf] mov [buf], eax } The frontend size in this case (1) is wrong, and the register makes the instruction matching unambiguous. There are also enough bytes available that we shouldn't complain to the user that they are potentially using an incorrectly sized instruction to access the variable. Supersedes D32636 and D26586 and fixes PR28266 llvm-svn: 302179
* [X86][MS-compatability][clang] allow MS TYPE/SIZE/LENGTH operators as a part ↵Coby Tayree2017-03-211-0/+7
| | | | | | | | | | | | | | | of a compound expression This patch introduces X86AsmParser with the ability to handle the aforementioned ops within compound "MS" arithmetical expressions. Currently - only supported as a stand alone Operand, e.g.: "TYPE X" now allowed : "4 + TYPE X * 128" LLVM side: https://reviews.llvm.org/D31173 Differential Revision: https://reviews.llvm.org/D31174 llvm-svn: 298426
* MS inline asm: Filter MXCSR out of the inferred clobber listReid Kleckner2017-02-141-0/+8
| | | | | | | Since r295004, LLVM has started modelling this new register, but we don't have GCC constraint inline asm spellings for it yet. llvm-svn: 295107
* [X86][MS]Adjacent comments within multi-line inline assembly statementCoby Tayree2017-02-051-0/+6
| | | | | | | | Allowing adjacent comments within MS inline assembly multi-line statement Differential Revision: https://reviews.llvm.org/D28989 llvm-svn: 294120
* Use ${:uid} to generate unique MS asm labels, not {:uid}Reid Kleckner2016-11-291-7/+7
| | | | llvm-svn: 288093
* [MS] Mangle a unique ID into all MS inline asm labelsReid Kleckner2016-11-281-8/+10
| | | | | | | | | | | | This solves PR23715 in a way that is compatible with LTO. MSVC supports jumping to source-level labels and between inline asm blocks, but we don't. Also revert the old solution, r255201, which was to mark these calls as noduplicate. llvm-svn: 288059
* [x86][ms-inline-asm] use of "jmp short" in asm is not supportedMichael Zuckerman2016-10-141-0/+9
| | | | | | | | | | Test linked to: https://reviews.llvm.org/D24957 Committing in the name of Ziv Izhar: After check-all and LGTM . Differential Revision: https://reviews.llvm.org/D24958 llvm-svn: 284213
* (clang part) Implement MASM-flavor intel syntax behavior for inline MS asm ↵Yunzhong Gao2016-09-021-12/+12
| | | | | | | | | | | | | | block. Clang tests for verifying the following syntaxes: 1. 0xNN and NNh are accepted as valid hexadecimal numbers, but 0xNNh is not. 0xNN and NNh may come with optional U or L suffix. 2. NNb is accepted as a valid binary (base-2) number, but 0bNN is not. NNb may come with optional U or L suffix. Differential Revision: https://reviews.llvm.org/D22112 llvm-svn: 280556
* [ms-inline-asm][AVX512] Add ability to use k registers in MS inline asm + ↵Marina Yatsina2016-03-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | fix bag with curly braces Until now curly braces could only be used in MS inline assembly to mark block start/end. All curly braces were removed completely at a very early stage. This approach caused bugs like: "m{o}v eax, ebx" turned into "mov eax, ebx" without any error. In addition, AVX-512 added special operands (e.g., k registers), which are also surrounded by curly braces that mark them as such. Now, we need to keep the curly braces and identify at a later stage if they are marking block start/end (if so, ignore them), or surrounding special AVX-512 operands (if so, parse them as such). This patch fixes the bug described above and enables the use of AVX-512 special operands. This commit is the the clang part of the patch. The clang part of the review is: http://reviews.llvm.org/D17766 The llvm part of the review is: http://reviews.llvm.org/D17767 Differential Revision: http://reviews.llvm.org/D17766 llvm-svn: 262842
* [ms-inline-asm] Fixing bug in single asm statement supportMarina Yatsina2016-02-231-2/+11
| | | | | | | | | | | | | | Fixing a crash caused by trying to merge a single-line asm statement with an asm block that follows it, e.g: asm int 4 asm { int 5 } Now, only adjacent single-line asm statements that are not surrounded by braces will be merged into one asm call. Differential Revision: http://reviews.llvm.org/D17496 llvm-svn: 261618
* [ms inline asm] Add support for label names with '$' charsMarina Yatsina2015-12-291-0/+9
| | | | | | | | | In MS inline asm syntax a label with '$' char produces an error, while in AT&T it does not. In AT&T inline asm syntax Clang escapes the '$' char and replaces it with "$$". Adopted same approach for MS syntax. Differential Revision: http://reviews.llvm.org/D15795 llvm-svn: 256545
* [X86][ms-inline asm] Test case for adding support for memory operands that ↵Marina Yatsina2015-12-241-0/+32
| | | | | | | | | | include structs Test case for commit 256381 Differential Revision: http://reviews.llvm.org/D15749 llvm-svn: 256382
* [ms-inline-asm] Add support for composite structs in MS inline asmMarina Yatsina2015-12-171-0/+20
| | | | | | | | Add MS inline asm support for structs that contain fields that are also structs. Differential Revision: http://reviews.llvm.org/D15578 llvm-svn: 255890
* Mark MS inline ASM 'nodplicate' it it has labels (PR23715)Hans Wennborg2015-12-101-2/+5
| | | | | | | | Duplicating it can lead to labels being defined twice. Differential revision: http://reviews.llvm.org/D15399 llvm-svn: 255201
* [ms-inline-asm] Add field access to MS inline asm identifier lookupReid Kleckner2015-08-261-0/+18
| | | | | | | | | | | | | | Now we can parse code like this: struct A { int field; }; int f(A o) { __asm mov eax, o.field } Fixes PR19117. llvm-svn: 246088
* [X86] Recognize "flags" as an identifier, not a register in Intel-syntax ↵Michael Kuperstein2015-07-301-0/+8
| | | | | | | | | | | inline asm This contains the test-case for r243630. Patch by: marina.yatsina@intel.com Differential Revision: http://reviews.llvm.org/D11513 llvm-svn: 243632
* Add test for parsing the XOR operator in Intel syntax inline assembly.Michael Kuperstein2015-06-141-0/+2
| | | | | | | | | LLVM side of the patch was committed as r239695. Differential Revision: http://reviews.llvm.org/D10384 Patch by marina.yatsina@intel.com llvm-svn: 239696
* Update Clang tests to handle explicitly typed load changes in LLVM.David Blaikie2015-02-271-1/+1
| | | | llvm-svn: 230795
* ms-inline-asm: Add a test case for the usage of labels in bracket expressionsEhsan Akhgari2014-09-221-0/+9
| | | | | | | | | | | | Summary: This is a test for this patch: http://reviews.llvm.org/D5445. Reviewers: rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5446 llvm-svn: 218271
* ms-inline-asm: Scope inline asm labels to functionsEhsan Akhgari2014-09-221-1/+28
| | | | | | | | | | | | | | | | 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 llvm-svn: 218230
* MS inline asm: Allow __asm blocks to set a return valueReid Kleckner2014-09-041-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | If control falls off the end of a function after an __asm block, MSVC assumes that the inline assembly filled the EAX and possibly EDX registers with an appropriate return value. This functionality is used in inline functions returning 64-bit integers in system headers, so we need some amount of compatibility. This is implemented in Clang by adding extra output constraints to every inline asm block, and storing the resulting output registers into the return value slot. If we see an asm block somewhere in the function body, we emit a normal epilogue instead of marking the end of the function with a return type unreachable. Normal returns in functions not using this functionality will overwrite the return value slot, and in most cases LLVM should be able to eliminate the dead stores. Fixes PR17201. Reviewed By: majnemer Differential Revision: http://reviews.llvm.org/D5177 llvm-svn: 217187
* MS inline asm: Add a test for xgetbv clobbersReid Kleckner2014-09-041-0/+6
| | | | llvm-svn: 217174
* MS inline asm: Tests for r214550Reid Kleckner2014-08-011-2/+2
| | | | | | | | | These tests seem like an exception to the rule against assembly emitting tests in clang. I made an LLVM side change that can only be tested by setting up the inline assembly machinery that is only implemented by Clang. llvm-svn: 214552
* ms-inline-asm: Add a test to ensure that call doesn't clobber eax.Ehsan Akhgari2014-07-311-0/+6
| | | | | | | | | | | | | Note that it's not clear whether this is the right behavior, please see the review for the discussion. Reviewers: rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4577 llvm-svn: 214401
* Fix test/CodeGen/ms-inline-asm.c from r213916.Ehsan Akhgari2014-07-251-1/+1
| | | | llvm-svn: 213919
* clang-cl: Merge adjacent single-line __asm blocksEhsan Akhgari2014-07-251-125/+135
| | | | | | | | | | | | | | | | | 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 llvm-svn: 213916
* clang/test/CodeGen/ms-inline-asm.c: Fix for -Asserts.NAKAMURA Takumi2014-07-171-7/+9
| | | | llvm-svn: 213329
* Add a test for PR20343 after llvm r213303.Nico Weber2014-07-171-0/+16
| | | | llvm-svn: 213305
* Add support for nested blocks in Microsoft inline assemblyEhsan Akhgari2014-07-061-3/+8
| | | | | | This fixes http://llvm.org/PR20204. llvm-svn: 212389
* Add a test case for the tilde operator in Microsoft inline assemblyEhsan Akhgari2014-07-051-0/+2
| | | | llvm-svn: 212373
* MS asm: Filter out fpsw clobbersReid Kleckner2014-03-271-0/+9
| | | | | | | | | | | | | | | | When parsing MS inline assembly, we note that fpsw is an implicit def of most x87 FP operations, and add it to the clobber list. However, we don't recognize fpsw as a gcc register name, and we assert. Clang always adds an fpsr clobber, which means the same thing to LLVM, so we can just use that. This test case was broken by my LLVM change r196939. Reviewers: echristo Differential Revision: http://llvm-reviews.chandlerc.com/D2993 llvm-svn: 204878
* Add tests for MS inline asm change r203146Reid Kleckner2014-03-061-0/+15
| | | | llvm-svn: 203147
* Test case for clobbers on cpuid in ms inline asmReid Kleckner2014-01-281-0/+6
| | | | | | Tests r200279 in LLVM. llvm-svn: 200280
* Update clang MS inline asm tests for r196939Reid Kleckner2013-12-101-7/+8
| | | | llvm-svn: 196940
* clang/test: REQUIRES: s/x86-64-registered-target/x86-registered-target/NAKAMURA Takumi2013-12-041-1/+1
| | | | llvm-svn: 196350
* Don't pass -O0 to clang_cc1, it is the default.Rafael Espindola2013-09-041-1/+1
| | | | llvm-svn: 189910
* Fix typo.Chad Rosier2013-04-181-1/+1
| | | | llvm-svn: 179811
* Test cases for r179719.Chad Rosier2013-04-171-0/+6
| | | | llvm-svn: 179720
OpenPOWER on IntegriCloud