1# REQUIRES: x86
2
3# RUN: llvm-mc -triple=i686-windows-gnu %s -defsym stdcall=0 -filetype=obj -o %t.obj
4
5# RUN: lld-link -lldmingw -entry:main %t.obj -out:%t.exe
6# RUN: llvm-objdump -s %t.exe | FileCheck %s
7
8# RUN: llvm-mc -triple=i686-windows-gnu %s -defsym stdcall=1 -filetype=obj -o %t.stdcall.obj
9# RUN: lld-link -lldmingw -entry:main %t.stdcall.obj -out:%t.stdcall.exe
10# RUN: llvm-objdump -s %t.stdcall.exe | FileCheck %s
11
12# Check that the .eh_frame comdat was included, even if it had no symbols,
13# due to associativity with the symbol _foo.
14
15# CHECK: Contents of section .eh_fram:
16# CHECK:  403000 42
17
18        .text
19        .def            _main;
20        .scl            2;
21        .type           32;
22        .endef
23        .globl          _main
24        .p2align        4, 0x90
25_main:
26.if stdcall==0
27        call            _foo
28.else
29        call            _foo@0
30.endif
31        ret
32
33        .section        .eh_frame$foo,"dr"
34        .linkonce       discard
35        .byte           0x42
36
37.if stdcall==0
38        .def            _foo;
39.else
40        .def            _foo@0;
41.endif
42        .scl            2;
43        .type           32;
44        .endef
45.if stdcall==0
46        .section        .text$foo,"xr",discard,_foo
47        .globl          _foo
48        .p2align        4
49_foo:
50.else
51        .section        .text$foo,"xr",discard,_foo@0
52        .globl          _foo@0
53        .p2align        4
54_foo@0:
55.endif
56        ret
57