diff --git a/lib/asm-parser.js b/lib/asm-parser.js index 1f0bf4e6f..68756ba5b 100644 --- a/lib/asm-parser.js +++ b/lib/asm-parser.js @@ -40,7 +40,7 @@ class AsmParser extends AsmRegex { this.instructionRe = /^\s*[a-zA-Z]+/; this.identifierFindRe = /[.a-zA-Z_$@][a-zA-z0-9_]*/g; this.hasNvccOpcodeRe = /^\s*[a-zA-Z|@]/; - this.definesFunction = /^\s*\.(type.*,\s*[@%]function|proc\s+[.a-zA-Z_][a-zA-Z0-9$_.]*:.*)$/; + this.definesFunction = /^\s*\.(type.*,\s*[@%#]function|proc\s+[.a-zA-Z_][a-zA-Z0-9$_.]*:.*)$/; this.definesGlobal = /^\s*\.globa?l\s*([.a-zA-Z_][a-zA-Z0-9$_.]*)/; this.indentedLabelDef = /^\s*([.a-zA-Z_$][a-zA-Z0-9$_.]*):/; this.assignmentDef = /^\s*([.a-zA-Z_$][a-zA-Z0-9$_.]+)\s*=/; diff --git a/test/cases/bug-1989_sparc.asm b/test/cases/bug-1989_sparc.asm new file mode 100644 index 000000000..7d5f596f1 --- /dev/null +++ b/test/cases/bug-1989_sparc.asm @@ -0,0 +1,18 @@ + .file "example.d" + .section ".text" + .align 4 + .weak issue1989 + .type issue1989, #function + .proc 00 +issue1989: +.LFB0: + add %o1, %o0, %o1 + mov 0, %g1 + cmp %o1, %o0 + movg %icc, 1, %g1 + jmp %o7+8 + mov %g1, %o0 +.LFE0: + .size issue1989, .-issue1989 + .ident "GCC: (GNU) 9.0.1 20190425 (experimental)" + .section .note.GNU-stack,"",@progbits diff --git a/test/cases/bug-1989_sparc.asm.directives.labels b/test/cases/bug-1989_sparc.asm.directives.labels new file mode 100644 index 000000000..fbd825b6a --- /dev/null +++ b/test/cases/bug-1989_sparc.asm.directives.labels @@ -0,0 +1,7 @@ +issue1989: + add %o1, %o0, %o1 + mov 0, %g1 + cmp %o1, %o0 + movg %icc, 1, %g1 + jmp %o7+8 + mov %g1, %o0