Add back tests that were reverted in r204203.

They pass again with the fix in r204581.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204582 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2014-03-24 03:48:15 +00:00
parent 0bce3343cc
commit 0259b8e14f

View File

@ -3,25 +3,70 @@
// Test that a variable declared with "var = other_var + cst" is in the same
// section as other_var and its value is the value of other_var + cst.
.data
.globl sym_a
.byte 42
.type sym_a, @object
sym_a:
sym_d = sym_a + 1
// CHECK: Symbol {
// CHECK: Name: sym_a
// CHECK-NEXT: Value: 0x0
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Local (0x0)
// CHECK-NEXT: Type: None (0x0)
// CHECK-NEXT: Other: 0
// CHECK-NEXT: Section: .text (0x1)
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
// CHECK-NEXT: Name: sym_d
// CHECK-NEXT: Value: 0x1
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Local (0x0)
// CHECK-NEXT: Type: None (0x0)
// CHECK-NEXT: Binding: Global
// CHECK-NEXT: Type: Object
// CHECK-NEXT: Other: 0
// CHECK-NEXT: Section: .text (0x1)
// CHECK-NEXT: Section: .data
// CHECK-NEXT: }
.long 42
.globl sym_b
sym_b:
.globl sym_c
sym_c = sym_a
// CHECK: Symbol {
// CHECK: Name: sym_c
// CHECK-NEXT: Value: 0x1
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Global
// CHECK-NEXT: Type: Object
// CHECK-NEXT: Other: 0
// CHECK-NEXT: Section: .data
// CHECK-NEXT: }
.globl sym_d
sym_d = sym_a + 1
// CHECK: Symbol {
// CHECK: Name: sym_d
// CHECK-NEXT: Value: 0x2
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Global
// CHECK-NEXT: Type: Object
// CHECK-NEXT: Other: 0
// CHECK-NEXT: Section: .data
// CHECK-NEXT: }
.globl sym_e
sym_e = sym_a + (sym_b - sym_a) * 3
// CHECK: Symbol {
// CHECK: Name: sym_e
// CHECK-NEXT: Value: 0xD
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Global
// CHECK-NEXT: Type: Object
// CHECK-NEXT: Other: 0
// CHECK-NEXT: Section: .data
// CHECK-NEXT: }
.globl sym_f
sym_f = sym_a + (1 - 1)
// CHECK: Symbol {
// CHECK: Name: sym_f
// CHECK-NEXT: Value: 0x1
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Global
// CHECK-NEXT: Type: Object
// CHECK-NEXT: Other: 0
// CHECK-NEXT: Section: .data
// CHECK-NEXT: }