H.J. Lu noted that all .section options are separated by a comma.
This patch changes the syntax of unique to require one.
llvm-svn: 234174
.. code-block:: gas
- .section .text,"ax",@progbits,unique 1
+ .section .text,"ax",@progbits,unique,1
nop
- .section .text,"ax",@progbits,unique 2
+ .section .text,"ax",@progbits,unique,2
nop
return TokError("expected identifier in directive");
if (UniqueStr != "unique")
return TokError("expected 'unique'");
+ if (getLexer().isNot(AsmToken::Comma))
+ return TokError("expected commma");
+ Lex();
if (getParser().parseAbsoluteExpression(UniqueID))
return true;
if (UniqueID < 0)
}
if (isUnique())
- OS << ",unique " << UniqueID;
+ OS << ",unique," << UniqueID;
OS << '\n';
// CHECK: error: expected absolute expression
- .section .text,"ax",@progbits,unique "abc"
+ .section .text,"ax",@progbits,unique, "abc"
// CHECK: error: unique id must be positive
- .section .text,"ax",@progbits,unique -1
+ .section .text,"ax",@progbits,unique, -1
// CHECK: error: unique id is too large
- .section .text,"ax",@progbits,unique 4294967295
+ .section .text,"ax",@progbits,unique, 4294967295
--- /dev/null
+// RUN: not llvm-mc -triple x86_64-pc-linux-gnu %s -o - 2>&1 | FileCheck %s
+
+// CHECK: error: expected commma
+
+ .section .text,"ax",@progbits,unique 1
// RUN: llvm-mc -triple x86_64-pc-linux-gnu %s -o - | FileCheck %s
// RUN: llvm-mc -triple x86_64-pc-linux-gnu %s -filetype=obj -o - | llvm-readobj -t | FileCheck %s --check-prefix=OBJ
- .section .text,"ax",@progbits,unique 4294967293
+ .section .text,"ax",@progbits,unique, 4294967293
.globl f
f:
nop
- .section .text,"ax",@progbits,unique 4294967294
+ .section .text,"ax",@progbits,unique, 4294967294
.globl g
g:
nop
// test that f and g are in different sections.
-// CHECK: .section .text,"ax",@progbits,unique 4294967293
+// CHECK: .section .text,"ax",@progbits,unique,4294967293
// CHECK: f:
-// CHECK: .section .text,"ax",@progbits,unique 4294967294
+// CHECK: .section .text,"ax",@progbits,unique,4294967294
// CHECK: g:
// OBJ: Symbol {