-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[inline-asm] Fixed issue no. 164973 #167316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| /// Test that inline asm source location corresponds to the actual | ||
| /// instruction line, not the first line of the asm block. | ||
| /// | ||
| /// RUN: not %clang_cc1 -triple x86_64-pc-linux-gnu -emit-obj %s 2>&1 | FileCheck %s | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add Needs |
||
|
|
||
| // #include <stdint.h> | ||
| // #include <string.h> | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unnecessary comments. |
||
|
|
||
| void *memset(void *dest, int c, int n)__attribute__((naked)); | ||
| void *memset(void *dest, int c, int n) { | ||
| __asm__( | ||
| "\t" // <-- line with only a tab | ||
| "xchg %eax, %eax\n" // <-- A valid instruction | ||
| "\t" // <-- line with only a tab | ||
| "mov rdi, 1\n" // <-- An invalid instruction | ||
| ); | ||
| } | ||
|
|
||
| int main() { return 0; } | ||
|
|
||
| // CHECK: error: unknown use of instruction mnemonic | ||
| // CHECK-NEXT: mov rdi, 1 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The CHECK lines here don't seem to actually check the line numbers. |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you rearrange the loop so you don't have to duplicate the code for the first line?