diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-10-16 01:34:54 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-10-16 01:34:54 +0000 |
commit | 86cd1e91b877072006f660b7a8baaa96c4e5597a (patch) | |
tree | b824567033767ad857eca8b2ccbddd1228796ad0 /test/MC | |
parent | e824b0813023c66cc8b4cd7c6cf4d7623750f779 (diff) | |
download | external_llvm-86cd1e91b877072006f660b7a8baaa96c4e5597a.zip external_llvm-86cd1e91b877072006f660b7a8baaa96c4e5597a.tar.gz external_llvm-86cd1e91b877072006f660b7a8baaa96c4e5597a.tar.bz2 |
MC: When parsing a variable reference, substitute absolute variables immediately
since they are allowed to be redefined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84230 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC')
-rw-r--r-- | test/MC/AsmParser/labels.s | 18 | ||||
-rw-r--r-- | test/MC/AsmParser/variables.s | 15 |
2 files changed, 24 insertions, 9 deletions
diff --git a/test/MC/AsmParser/labels.s b/test/MC/AsmParser/labels.s index 53da7ed..456d61f 100644 --- a/test/MC/AsmParser/labels.s +++ b/test/MC/AsmParser/labels.s @@ -12,21 +12,21 @@ a: .long 0 .text -foo: +foo: // CHECK: addl $24, a$b(%eax) - addl $24, "a$b"(%eax) + addl $24, "a$b"(%eax) // CHECK: addl $24, a$b+10(%eax) addl $24, ("a$b" + 10)(%eax) - + // CHECK: b$c = 10 "b$c" = 10 -// CHECK: addl $b$c, %eax +// CHECK: addl $10, %eax addl "b$c", %eax - + // CHECK: "a 0" = 11 .set "a 0", 11 - -// CHECK: .long "a 0" + +// CHECK: .long 11 .long "a 0" // XXCHCK: .section "a 1,a 2" @@ -48,12 +48,12 @@ foo: .lcomm "a 7", 1 // FIXME: We don't bother to support .lsym. - + // CHECX: .lsym "a 8",1 // .lsym "a 8", 1 // CHECK: "a 9" = a-b .set "a 9", a - b - + // CHECK: .long "a 9" .long "a 9" diff --git a/test/MC/AsmParser/variables.s b/test/MC/AsmParser/variables.s new file mode 100644 index 0000000..86fea27 --- /dev/null +++ b/test/MC/AsmParser/variables.s @@ -0,0 +1,15 @@ +// RUN: llvm-mc %s + + .data + t0_v0 = 1 + t0_v1 = t0_v0 + .if t0_v1 != 1 + .abort "invalid value" + .endif + + t1_v0 = 1 + t1_v1 = t0_v0 + t1_v0 = 2 + .if t0_v1 != 1 + .abort "invalid value" + .endif |