• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: llvm-mc -filetype=obj -triple x86_64-pc-win32 %s -o %t.o
2// RUN: llvm-readobj --symbols %t.o | FileCheck %s
3
4// Test that the weak symbol is properly undefined, while originally being
5// the leader symbol for a comdat. (This can easily happen if building with
6// -ffunction-sections).
7
8        .section .text$func,"xr",one_only,func
9        .weak   func
10func:
11        ret
12
13// CHECK:       Symbol {
14// CHECK:         Name: func
15// CHECK-NEXT:    Value: 0
16// CHECK-NEXT:    Section: IMAGE_SYM_UNDEFINED (0)
17// CHECK-NEXT:    BaseType: Null (0x0)
18// CHECK-NEXT:    ComplexType: Null (0x0)
19// CHECK-NEXT:    StorageClass: WeakExternal (0x69)
20// CHECK-NEXT:    AuxSymbolCount: 1
21// CHECK-NEXT:    AuxWeakExternal {
22// CHECK-NEXT:      Linked: .weak.func.default (10)
23// CHECK-NEXT:      Search: Alias (0x3)
24// CHECK-NEXT:    }
25// CHECK-NEXT:  }
26// CHECK-NEXT:  Symbol {
27// CHECK-NEXT:    Name: .weak.func.default
28// CHECK-NEXT:    Value: 0
29// CHECK-NEXT:    Section: .text$func (4)
30// CHECK-NEXT:    BaseType: Null (0x0)
31// CHECK-NEXT:    ComplexType: Null (0x0)
32// CHECK-NEXT:    StorageClass: External (0x2)
33// CHECK-NEXT:    AuxSymbolCount: 0
34// CHECK-NEXT:  }
35