diff options
author | Joerg Sonnenberger <joerg@bec.de> | 2011-02-24 21:59:22 +0000 |
---|---|---|
committer | Joerg Sonnenberger <joerg@bec.de> | 2011-02-24 21:59:22 +0000 |
commit | 93c65e6e661eda75711363bdd5ca15909920e1f0 (patch) | |
tree | e81730c5095f094b742ad43c74514fbfb002908a /test/MC | |
parent | 12d18a07a084b073b768e47b9afe45cc3c6a92f2 (diff) | |
download | external_llvm-93c65e6e661eda75711363bdd5ca15909920e1f0.zip external_llvm-93c65e6e661eda75711363bdd5ca15909920e1f0.tar.gz external_llvm-93c65e6e661eda75711363bdd5ca15909920e1f0.tar.bz2 |
Restore r125595 (reverted in r126336) with modifications:
Introduce a variable in the AsmParserExtension whether [] is valid in an
expression. If it is true, parse them like (). Enable this for ELF only.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126443 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC')
-rw-r--r-- | test/MC/ARM/bracket-darwin.s | 5 | ||||
-rw-r--r-- | test/MC/ELF/bracket-exprs.s | 16 | ||||
-rw-r--r-- | test/MC/ELF/bracket.s | 8 |
3 files changed, 29 insertions, 0 deletions
diff --git a/test/MC/ARM/bracket-darwin.s b/test/MC/ARM/bracket-darwin.s new file mode 100644 index 0000000..dc8b348 --- /dev/null +++ b/test/MC/ARM/bracket-darwin.s @@ -0,0 +1,5 @@ +// RUN: not llvm-mc -triple arm-apple-darwin %s 2> %t +// RUN: FileCheck -input-file %t %s + +// CHECK: error: brackets expression not supported on this target +.byte [4-3] diff --git a/test/MC/ELF/bracket-exprs.s b/test/MC/ELF/bracket-exprs.s new file mode 100644 index 0000000..c428651 --- /dev/null +++ b/test/MC/ELF/bracket-exprs.s @@ -0,0 +1,16 @@ +// RUN: llvm-mc -triple i386-unknown-unknown %s | FileCheck %s +// RUN: llvm-mc -triple arm-unknown-linux %s | FileCheck %s + +// CHECK: .byte 1 +.if [~0 >> 1] == -1 +.byte 1 +.else +.byte 2 +.endif + +// CHECK: .byte 3 +.if 4 * [4 + (3 + [2 * 2] + 1)] == 48 +.byte 3 +.else +.byte 4 +.endif diff --git a/test/MC/ELF/bracket.s b/test/MC/ELF/bracket.s new file mode 100644 index 0000000..702e309 --- /dev/null +++ b/test/MC/ELF/bracket.s @@ -0,0 +1,8 @@ +// RUN: not llvm-mc -triple i386-unknown-unknown %s 2> %t1 > %t2 +// RUN: FileCheck < %t1 %s + +// CHECK: error: expected ']' in brackets expression +.size x, [.-x) + +// CHECK: error: expected ')' in parentheses expression +.size y, (.-y] |