diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2010-11-24 18:51:21 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2010-11-24 18:51:21 +0000 |
commit | e98d483b717b9f81dcc49ea21746335841580395 (patch) | |
tree | 7280f571a96f214662f29bb0dc298a86c278a1be /llvm/test | |
parent | af9a7a3e928d6016e133cb9cd4c0b4e750b6e156 (diff) | |
download | bcm5719-llvm-e98d483b717b9f81dcc49ea21746335841580395.tar.gz bcm5719-llvm-e98d483b717b9f81dcc49ea21746335841580395.zip |
Fix and add tests for all cases in x86 and x86_64 where gnu as implicitly
sets the type of a symbol to STT_TLS.
llvm-svn: 120100
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/MC/ELF/tls-i386.s | 64 | ||||
-rw-r--r-- | llvm/test/MC/ELF/tls.s | 43 |
2 files changed, 96 insertions, 11 deletions
diff --git a/llvm/test/MC/ELF/tls-i386.s b/llvm/test/MC/ELF/tls-i386.s new file mode 100644 index 00000000000..459d4cc69df --- /dev/null +++ b/llvm/test/MC/ELF/tls-i386.s @@ -0,0 +1,64 @@ +// RUN: llvm-mc -filetype=obj -triple i386-pc-linux-gnu %s -o - | elf-dump | FileCheck %s + +// Test that all symbols are of type STT_TLS. + + movl foo1@NTPOFF(%eax), %eax + movl foo2@GOTNTPOFF(%eax), %eax + movl foo3@TLSGD(%eax), %eax + movl foo4@TLSLDM(%eax), %eax + movl foo5@TPOFF(%eax), %eax + movl foo6@DTPOFF(%eax), %eax + +// CHECK: (('st_name', 0x00000001) # 'foo1' +// CHECK-NEXT: ('st_value', 0x00000000) +// CHECK-NEXT: ('st_size', 0x00000000) +// CHECK-NEXT: ('st_bind', 0x00000001) +// CHECK-NEXT: ('st_type', 0x00000006) +// CHECK-NEXT: ('st_other', 0x00000000) +// CHECK-NEXT: ('st_shndx', 0x00000000) +// CHECK-NEXT: ), +// CHECK-NEXT: # Symbol 0x00000006 +// CHECK-NEXT: (('st_name', 0x00000006) # 'foo2' +// CHECK-NEXT: ('st_value', 0x00000000) +// CHECK-NEXT: ('st_size', 0x00000000) +// CHECK-NEXT: ('st_bind', 0x00000001) +// CHECK-NEXT: ('st_type', 0x00000006) +// CHECK-NEXT: ('st_other', 0x00000000) +// CHECK-NEXT: ('st_shndx', 0x00000000) +// CHECK-NEXT: ), +// CHECK-NEXT: # Symbol 0x00000007 +// CHECK-NEXT: (('st_name', 0x0000000b) # 'foo3' +// CHECK-NEXT: ('st_value', 0x00000000) +// CHECK-NEXT: ('st_size', 0x00000000) +// CHECK-NEXT: ('st_bind', 0x00000001) +// CHECK-NEXT: ('st_type', 0x00000006) +// CHECK-NEXT: ('st_other', 0x00000000) +// CHECK-NEXT: ('st_shndx', 0x00000000) +// CHECK-NEXT: ), +// CHECK-NEXT: # Symbol 0x00000008 +// CHECK-NEXT: (('st_name', 0x00000010) # 'foo4' +// CHECK-NEXT: ('st_value', 0x00000000) +// CHECK-NEXT: ('st_size', 0x00000000) +// CHECK-NEXT: ('st_bind', 0x00000001) +// CHECK-NEXT: ('st_type', 0x00000006) +// CHECK-NEXT: ('st_other', 0x00000000) +// CHECK-NEXT: ('st_shndx', 0x00000000) +// CHECK-NEXT: ), +// CHECK-NEXT: # Symbol 0x00000009 +// CHECK-NEXT: (('st_name', 0x00000015) # 'foo5' +// CHECK-NEXT: ('st_value', 0x00000000) +// CHECK-NEXT: ('st_size', 0x00000000) +// CHECK-NEXT: ('st_bind', 0x00000001) +// CHECK-NEXT: ('st_type', 0x00000006) +// CHECK-NEXT: ('st_other', 0x00000000) +// CHECK-NEXT: ('st_shndx', 0x00000000) +// CHECK-NEXT: ), +// CHECK-NEXT: # Symbol 0x0000000a +// CHECK-NEXT: (('st_name', 0x0000001a) # 'foo6' +// CHECK-NEXT: ('st_value', 0x00000000) +// CHECK-NEXT: ('st_size', 0x00000000) +// CHECK-NEXT: ('st_bind', 0x00000001) +// CHECK-NEXT: ('st_type', 0x00000006) +// CHECK-NEXT: ('st_other', 0x00000000) +// CHECK-NEXT: ('st_shndx', 0x00000000) +// CHECK-NEXT: ), diff --git a/llvm/test/MC/ELF/tls.s b/llvm/test/MC/ELF/tls.s index 19e0c763e04..2591659f7eb 100644 --- a/llvm/test/MC/ELF/tls.s +++ b/llvm/test/MC/ELF/tls.s @@ -1,14 +1,16 @@ // RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | elf-dump | FileCheck %s -// Test that foo and foobar is of type STT_TLS. +// Test that all symbols are of type STT_TLS. - leaq foo@TLSGD(%rip), %rdi + leaq foo1@TLSGD(%rip), %rdi + leaq foo2@GOTTPOFF(%rip), %rdi + leaq foo3@TLSLD(%rip), %rdi .section .zed,"awT",@progbits foobar: .long 43 -// CHECK: (('st_name', 0x00000005) # 'foobar' +// CHECK: (('st_name', 0x00000010) # 'foobar' // CHECK-NEXT: ('st_bind', 0x00000000) // CHECK-NEXT: ('st_type', 0x00000006) // CHECK-NEXT: ('st_other', 0x00000000) @@ -17,11 +19,30 @@ foobar: // CHECK-NEXT: ('st_size', 0x00000000) // CHECK-NEXT: ), -// CHECK: (('st_name', 0x00000001) # 'foo' -// CHECK-NEXT: ('st_bind', 0x00000001) -// CHECK-NEXT: ('st_type', 0x00000006) -// CHECK-NEXT: ('st_other', 0x00000000) -// CHECK-NEXT: ('st_shndx', 0x00000000) -// CHECK-NEXT: ('st_value', 0x00000000) -// CHECK-NEXT: ('st_size', 0x00000000) -// CHECK-NEXT: ), +// CHECK: # Symbol 0x00000007 +// CHECK-NEXT: (('st_name', 0x00000001) # 'foo1' +// CHECK-NEXT: ('st_bind', 0x00000001) +// CHECK-NEXT: ('st_type', 0x00000006) +// CHECK-NEXT: ('st_other', 0x00000000) +// CHECK-NEXT: ('st_shndx', 0x00000000) +// CHECK-NEXT: ('st_value', 0x00000000) +// CHECK-NEXT: ('st_size', 0x00000000) +// CHECK-NEXT: ), +// CHECK-NEXT: # Symbol 0x00000008 +// CHECK-NEXT: (('st_name', 0x00000006) # 'foo2' +// CHECK-NEXT: ('st_bind', 0x00000001) +// CHECK-NEXT: ('st_type', 0x00000006) +// CHECK-NEXT: ('st_other', 0x00000000) +// CHECK-NEXT: ('st_shndx', 0x00000000) +// CHECK-NEXT: ('st_value', 0x00000000) +// CHECK-NEXT: ('st_size', 0x00000000) +// CHECK-NEXT: ), +// CHECK-NEXT: # Symbol 0x00000009 +// CHECK-NEXT: (('st_name', 0x0000000b) # 'foo3' +// CHECK-NEXT: ('st_bind', 0x00000001) +// CHECK-NEXT: ('st_type', 0x00000006) +// CHECK-NEXT: ('st_other', 0x00000000) +// CHECK-NEXT: ('st_shndx', 0x00000000) +// CHECK-NEXT: ('st_value', 0x00000000) +// CHECK-NEXT: ('st_size', 0x00000000) +// CHECK-NEXT: ), |