aboutsummaryrefslogtreecommitdiffstats
path: root/test/MC/COFF/weak.s
blob: 0f99313c9c034b98d30a958fb572c0e81d0f63bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// This tests that default-null weak symbols (a GNU extension) are created
// properly via the .weak directive.

// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 < %s | coff-dump.py | FileCheck %s

    .def    _main;
    .scl    2;
    .type   32;
    .endef
    .text
    .globl  _main
    .align  16, 0x90
_main:                                  # @main
# BB#0:                                 # %entry
    subl    $4, %esp
    movl    $_test_weak, %eax
    testl   %eax, %eax
    je      LBB0_2
# BB#1:                                 # %if.then
    calll   _test_weak
    movl    $1, %eax
    addl    $4, %esp
    ret
LBB0_2:                                 # %return
    xorl    %eax, %eax
    addl    $4, %esp
    ret

    .weak   _test_weak

// CHECK: Symbols = [

// CHECK:      Name               = _test_weak
// CHECK-NEXT: Value              = 0
// CHECK-NEXT: SectionNumber      = 0
// CHECK-NEXT: SimpleType         = IMAGE_SYM_TYPE_NULL (0)
// CHECK-NEXT: ComplexType        = IMAGE_SYM_DTYPE_NULL (0)
// CHECK-NEXT: StorageClass       = IMAGE_SYM_CLASS_WEAK_EXTERNAL (105)
// CHECK-NEXT: NumberOfAuxSymbols = 1
// CHECK-NEXT: AuxillaryData      =
// CHECK-NEXT: 05 00 00 00 02 00 00 00 - 00 00 00 00 00 00 00 00 |................|
// CHECK-NEXT: 00 00                                             |..|

// CHECK:      Name               = .weak._test_weak.default
// CHECK-NEXT: Value              = 0
// CHECK-NEXT: SectionNumber      = 65535
// CHECK-NEXT: SimpleType         = IMAGE_SYM_TYPE_NULL (0)
// CHECK-NEXT: ComplexType        = IMAGE_SYM_DTYPE_NULL (0)
// CHECK-NEXT: StorageClass       = IMAGE_SYM_CLASS_EXTERNAL (2)
// CHECK-NEXT: NumberOfAuxSymbols = 0
// CHECK-NEXT: AuxillaryData      =