at-pseudo-variable.s 921 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # RUN: llvm-mc -triple i386-unknown-unknown %s | FileCheck %s
  2. .macro A
  3. add $1\@, %eax
  4. .endm
  5. .macro B
  6. sub $1\@, %eax
  7. .endm
  8. A
  9. # CHECK: addl $10, %eax
  10. A
  11. # CHECK: addl $11, %eax
  12. B
  13. # CHECK: subl $12, %eax
  14. B
  15. # CHECK: subl $13, %eax
  16. # The following uses of \@ are undocumented, but valid:
  17. .irpc foo,234
  18. add $\foo\@, %eax
  19. .endr
  20. # CHECK: addl $24, %eax
  21. # CHECK: addl $34, %eax
  22. # CHECK: addl $44, %eax
  23. .irp reg,%eax,%ebx
  24. sub $2\@, \reg
  25. .endr
  26. # CHECK: subl $24, %eax
  27. # CHECK: subl $24, %ebx
  28. # Test that .irp(c) and .rep(t) do not increase \@.
  29. # Only the use of A should increase \@, so we can test that it increases by 1
  30. # each time.
  31. .irpc foo,123
  32. sub $\foo, %eax
  33. .endr
  34. A
  35. # CHECK: addl $14, %eax
  36. .irp reg,%eax,%ebx
  37. sub $4, \reg
  38. .endr
  39. A
  40. # CHECK: addl $15, %eax
  41. .rept 2
  42. sub $5, %eax
  43. .endr
  44. A
  45. # CHECK: addl $16, %eax
  46. .rep 3
  47. sub $6, %eax
  48. .endr
  49. A
  50. # CHECK: addl $17, %eax