brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 7f508ec Raw
36 lines · cpp
1// clang-format off2// REQUIRES: lld, x863 4// Make sure we can read variables from BSS5// RUN: %clang_cl --target=x86_64-windows-msvc -Od -Z7 -c /Fo%t.obj -- %s6// RUN: lld-link -debug:full -nodefaultlib -entry:main %t.obj -out:%t.exe -pdb:%t.pdb7// RUN: llvm-readobj -S %t.exe | FileCheck --check-prefix=BSS %s8// RUN: %lldb -f %t.exe -s \9// RUN:     %p/Inputs/globals-bss.lldbinit 2>&1 | FileCheck %s10 11int GlobalVariable = 0;12 13int main(int argc, char **argv) {14  return 0;15}16 17// BSS:       Section {18// BSS:         Number: 319// BSS:         Name: .data20// BSS-NEXT:    VirtualSize: 0x421// BSS-NEXT:    VirtualAddress:22// BSS-NEXT:    RawDataSize: 023// BSS-NEXT:    PointerToRawData: 0x024// BSS-NEXT:    PointerToRelocations: 0x025// BSS-NEXT:    PointerToLineNumbers: 0x026// BSS-NEXT:    RelocationCount: 027// BSS-NEXT:    LineNumberCount: 028// BSS-NEXT:    Characteristics [ (0xC0000040)29// BSS-NEXT:      IMAGE_SCN_CNT_INITIALIZED_DATA (0x40)30// BSS-NEXT:      IMAGE_SCN_MEM_READ (0x40000000)31// BSS-NEXT:      IMAGE_SCN_MEM_WRITE (0x80000000)32// BSS-NEXT:    ]33// BSS-NEXT:  }34 35// CHECK: (int) GlobalVariable = 036