clang assembler macro expansion failing
clang assembler macro expansion failing
- Subject: clang assembler macro expansion failing
- From: Arun <email@hidden>
- Date: Tue, 11 Dec 2012 09:17:43 +0530
Hi All
I have a small assembly code "test.S" as below.
.globl _return_value
#define IF_LAST .if ($1==0)
#define ELSEÂ Â Â .else
#define ENDIFÂ Â .endif
.macro test_macro zero, one, two
       IF_LAST
               mov $1, êx
       ELSE
               mov $2, êx
       ENDIF
       ret
.endm
_return_value:
       test_macro 0, 1, 2
When i use LLVM compiler "clang" and produce a object file using the command "clang -c test.S", and disassemble the object file using "otool", i see the below output.
otool -tV test.o
test.o:
(__TEXT,__text) section
_return_value:
0000000000000000   movl   $0x00000001,êx
0000000000000005   movl   $0x00000002,êx
000000000000000a   ret
When i use GCC compiler "gcc" and produce a object file using
the command "gcc -c test.S", and disassemble the object file using
"otool", i see the below output.
Â
otool -tV test.o
test.o:
(__TEXT,__text) section
_return_value:
0000000000000000   movl   0x00000002,êx
0000000000000007Â Â Â ret
Looks like the object code generated by the GCC is correct and as expected. But in case of clang, the assembler macro expansion is not proper.
Can anyone help me with clangs macro expansion here?
Thanks in advance
Arun KA
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden