]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
macro nesting testcases
authorAlan Modra <amodra@gmail.com>
Fri, 3 Jan 2025 02:18:51 +0000 (12:48 +1030)
committerAlan Modra <amodra@gmail.com>
Fri, 3 Jan 2025 02:51:47 +0000 (13:21 +1030)
Fix a bunch of regressions.  Don't start anything besides a label in
first column, don't name macros the same as directives, and make
labels global.

gas/testsuite/gas/macros/nesting1.s
gas/testsuite/gas/macros/nesting2.s
gas/testsuite/gas/macros/nesting3.s

index 3d415e1ef62a61de3651ad7999b4463e457e470b..dda24800756dcaed0f28e9da88307b2cd15860b1 100644 (file)
@@ -1,14 +1,15 @@
        .text
-.macro entry fname
+ .macro entry fname
+       .global \fname
 \fname:
-.endm
+ .endm
 
-.macro func fname, t
- entry \fname
- .macro data
-  .dc.\()\t 0
+ .macro func1 fname, t
+       entry \fname
+ .macro data1
+       .dc.\()\t 0
+ .endm
+       data1
  .endm
- data
-.endm
 
-func foo, a
+       func1 foo, a
index ff8a7f4f75af9f6c838d59e4c8d5b0da31f65546..af9e1bb35c4258f11715b84d8defe2afe712ee30 100644 (file)
@@ -1,10 +1,11 @@
-.macro function name
- .macro endfunc
+ .macro function name
+ .macro endfunction
  .endm
        .text
+       .global \name
 \name:
-.endm
+ .endm
 
-function foo
+       function foo
        .dc.a 0
-endfunc
+       endfunction
index 4488009dd5f9fafb042f399ceb0c785d037de736..befc06fc9acfe89dcc1dce66573c0ae4d7c50af5 100644 (file)
@@ -1,13 +1,14 @@
        .text
-.macro func
+ .macro func1
        foo
-.endm
+ .endm
 
-.macro do_foo
-.macro foo
+ .macro do_foo
+ .macro foo
+       .global foo
 foo:
        .dc.a 0
-.endm
-.endm
-do_foo
-func
+ .endm
+ .endm
+       do_foo
+       func1