• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
clang assembler macro expansion failing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: Any Way To Make XCode 4 search XIB files?
  • Next by Date: Re: Still no diff for model version in Xcode 4?
  • Previous by thread: Re: Any Way To Make XCode 4 search XIB files?
  • Next by thread: Re: clang assembler macro expansion failing
  • Index(es):
    • Date
    • Thread