• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -s | FileCheck %s
2// RUN: llvm-mc -filetype=obj -triple x86_64-apple-darwin14.0.0-elf %s -o - | llvm-readobj -s | FileCheck %s -check-prefix=DARWIN
3// RUN: llvm-mc -filetype=obj -triple x86_64-pc-win32-elf %s -o - | llvm-readobj -s | FileCheck %s -check-prefix=WINDOWS
4
5// Check that we can create ELF files for darwin/windows, even though
6// it is not the default file format.
7
8// DARWIN:       Format: ELF64-x86-64
9// WINDOWS:      Format: ELF64-x86-64
10// DARWIN-NEXT:  Arch: x86_64
11// WINDOWS-NEXT: Arch: x86_64
12
13// Test that we create text by default. Also test that symtab and strtab are
14// listed.
15
16// CHECK:        Section {
17// CHECK:          Name: .strtab
18// CHECK-NEXT:     Type: SHT_STRTAB
19// CHECK-NEXT:     Flags [
20// CHECK-NEXT:     ]
21// CHECK-NEXT:     Address: 0x0
22// CHECK-NEXT:     Offset:
23// CHECK-NEXT:     Size: 23
24// CHECK-NEXT:     Link: 0
25// CHECK-NEXT:     Info: 0
26// CHECK-NEXT:     AddressAlignment: 1
27// CHECK-NEXT:     EntrySize: 0
28// CHECK-NEXT:   }
29// CHECK:        Section {
30// CHECK:          Name: .text
31// CHECK-NEXT:     Type: SHT_PROGBITS
32// CHECK-NEXT:     Flags [
33// CHECK-NEXT:       SHF_ALLOC
34// CHECK-NEXT:       SHF_EXECINSTR
35// CHECK-NEXT:     ]
36// CHECK-NEXT:     Address: 0x0
37// CHECK-NEXT:     Offset: 0x40
38// CHECK-NEXT:     Size: 0
39// CHECK-NEXT:     Link: 0
40// CHECK-NEXT:     Info: 0
41// CHECK-NEXT:     AddressAlignment: 4
42// CHECK-NEXT:     EntrySize: 0
43// CHECK-NEXT:   }
44// CHECK:        Section {
45// CHECK:          Name: .symtab
46// CHECK-NEXT:     Type: SHT_SYMTAB
47// CHECK-NEXT:     Flags [
48// CHECK-NEXT:     ]
49// CHECK-NEXT:     Address: 0x0
50// CHECK-NEXT:     Offset:
51// CHECK-NEXT:     Size: 24
52// CHECK-NEXT:     Link:
53// CHECK-NEXT:     Info: 1
54// CHECK-NEXT:     AddressAlignment: 8
55// CHECK-NEXT:     EntrySize: 24
56// CHECK-NEXT:   }
57