xref: /minix3/external/bsd/llvm/dist/llvm/test/MC/ELF/set.s (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -t | FileCheck  %s
2f4a2713aSLionel Sambuc
3f4a2713aSLionel Sambuc// Test that we emit the correct value.
4f4a2713aSLionel Sambuc
5f4a2713aSLionel Sambuc.set kernbase,0xffffffff80000000
6f4a2713aSLionel Sambuc
7f4a2713aSLionel Sambuc// CHECK:        Symbol {
8*0a6a1f1dSLionel Sambuc// CHECK:          Name: kernbase
9f4a2713aSLionel Sambuc// CHECK-NEXT:     Value: 0xFFFFFFFF80000000
10f4a2713aSLionel Sambuc// CHECK-NEXT:     Size: 0
11f4a2713aSLionel Sambuc// CHECK-NEXT:     Binding: Local
12f4a2713aSLionel Sambuc// CHECK-NEXT:     Type: None
13f4a2713aSLionel Sambuc// CHECK-NEXT:     Other: 0
14*0a6a1f1dSLionel Sambuc// CHECK-NEXT:     Section: Absolute (0xFFF1)
15f4a2713aSLionel Sambuc// CHECK-NEXT:   }
16f4a2713aSLionel Sambuc
17f4a2713aSLionel Sambuc// Test that we accept .set of a symbol after it has been used in a statement.
18f4a2713aSLionel Sambuc
19f4a2713aSLionel Sambuc        jmp foo
20f4a2713aSLionel Sambuc        .set foo, bar
21f4a2713aSLionel Sambuc
22f4a2713aSLionel Sambuc// or a .quad
23f4a2713aSLionel Sambuc
24f4a2713aSLionel Sambuc        .quad	foo2
25f4a2713aSLionel Sambuc	.set	foo2,bar2
26f4a2713aSLionel Sambuc
27f4a2713aSLionel Sambuc// Test that there is an undefined reference to bar
28f4a2713aSLionel Sambuc// CHECK:        Symbol {
29*0a6a1f1dSLionel Sambuc// CHECK:          Name: bar
30f4a2713aSLionel Sambuc// CHECK-NEXT:     Value: 0x0
31f4a2713aSLionel Sambuc// CHECK-NEXT:     Size: 0
32f4a2713aSLionel Sambuc// CHECK-NEXT:     Binding: Global
33f4a2713aSLionel Sambuc// CHECK-NEXT:     Type: None
34f4a2713aSLionel Sambuc// CHECK-NEXT:     Other: 0
35*0a6a1f1dSLionel Sambuc// CHECK-NEXT:     Section: Undefined (0x0)
36f4a2713aSLionel Sambuc// CHECK-NEXT:   }
37