diff options
| author | Michael Matz <matz@suse.de> | 2016-08-25 16:40:50 +0200 |
|---|---|---|
| committer | Michael Matz <matz@suse.de> | 2016-12-15 17:47:11 +0100 |
| commit | dd57a348664d0fac46a0f4c822f70c80bbf97774 (patch) | |
| tree | 6925b44de13fdeed66eca1bce75fa6c618ef9da8 /tests | |
| parent | e7ef087598d74e3329a7f0b24af8430faf639606 (diff) | |
| download | tinycc-dd57a348664d0fac46a0f4c822f70c80bbf97774.tar.gz tinycc-dd57a348664d0fac46a0f4c822f70c80bbf97774.tar.bz2 | |
tccasm: Don't ignore # in preprocessor directives
Our preprocessor throws away # line-comments in asm mode.
It did so also inside preprocessor directives, thereby
removing stringification. Parse defines in non-asm mode (but
retain '.' as identifier character inside macro definitions).
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/asmtest.S | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/tests/asmtest.S b/tests/asmtest.S index 59deb06..280aeaf 100644 --- a/tests/asmtest.S +++ b/tests/asmtest.S @@ -16,10 +16,17 @@ .skip 3 .skip 15, 0x90 .string "hello\0world" +/* Macro expansion should work like with C, the #n shouldn't be parsed + as asm line comment */ +#define __stringify(n) #n +#define stringify(n) __stringify(n) + .skip 8,0x90 + .asciz stringify(BLA) + .skip 8,0x90 +# 28 "asmtest.S" # a line directive (and a line comment) + movl %eax, %ebx # some more asm comment /* some label tests */ - - movl %eax, %ebx L1: movl %eax, %ebx mov 0x10000, %eax @@ -572,8 +579,8 @@ int $0x10 pusha popa #endif - clc - cld + clc # another comment + cld # a comment with embedded ' tick cli clts cmc @@ -676,8 +683,10 @@ int $0x10 lar %eax,%dx lar %ax,%edx lar %eax,%edx +#ifdef __x86_64__ lar %ax,%rdx lar %eax,%rdx +#endif emms movd %edx, %mm3 movd 0x1000, %mm2 @@ -820,7 +829,11 @@ nop .long 145 + 2b .word 164, 0 .org 2b+32 +#ifdef __x86_64__ .quad 1b +#else + .long 1b +#endif .popsection 3: mov %eax,%ecx 4: |
