From cceba838935b5018fddf7118bb8b9e6f50bbbe45 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Fri, 17 Sep 2010 02:47:07 +0000 Subject: MC/AsmParser: Add support for 'a + 4@GOTPCREL' and friends, by reconsing the expression to include the modifier. - Gross, but this a corner case we don't expect to see often in practice, but it is worth accepting. - Also improves diagnostics on invalid modifiers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114154 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/MC/AsmParser/expr_symbol_modifiers.s | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/MC/AsmParser/expr_symbol_modifiers.s (limited to 'test') diff --git a/test/MC/AsmParser/expr_symbol_modifiers.s b/test/MC/AsmParser/expr_symbol_modifiers.s new file mode 100644 index 0000000000..7371c97cbd --- /dev/null +++ b/test/MC/AsmParser/expr_symbol_modifiers.s @@ -0,0 +1,14 @@ +// RUN: not llvm-mc -triple x86_64-unknown-unknown %s > %t 2> %t.err +// RUN: FileCheck < %t %s +// RUN: FileCheck -check-prefix=CHECK-STDERR < %t.err %s + +// CHECK: .long 1 +.long 1 +// CHECK-STDERR: invalid modifier 'GOTPCREL' (no symbols present) +.long 10 + 4@GOTPCREL +// CHECK: .long a@GOTPCREL+4 +.long a + 4@GOTPCREL +// CHECK: .long a@GOTPCREL+b@GOTPCREL +.long (a + b)@GOTPCREL +// CHECK: .long (10+b@GOTPCREL)+4 +.long 10 + b + 4@GOTPCREL -- cgit v1.2.3