Put each jump table in an independent section if the function is too.
[oota-llvm.git] / test / CodeGen / X86 / global-sections-comdat.ll
1 ; RUN: llc < %s -mtriple=i386-unknown-linux | FileCheck %s -check-prefix=LINUX
2 ; RUN: llc < %s -mtriple=i386-unknown-linux -data-sections -function-sections | FileCheck %s -check-prefix=LINUX-SECTIONS
3
4 $F1 = comdat any
5 define void @F1(i32 %y) comdat {
6 bb0:
7 switch i32 %y, label %bb5 [
8     i32 1, label %bb1
9     i32 2, label %bb2
10     i32 3, label %bb3
11     i32 4, label %bb4
12   ]
13 bb1:
14   ret void
15 bb2:
16   ret void
17 bb3:
18   ret void
19 bb4:
20   ret void
21 bb5:
22   ret void
23 }
24
25 ; LINUX: .section        .text.F1,"axG",@progbits,F1,comdat
26 ; LINUX: .size   F1,
27 ; LINUX-NEXT: .cfi_endproc
28 ; LINUX-NEXT: .section        .rodata.F1,"aG",@progbits,F1,comdat
29
30 ; LINUX-SECTIONS: .section        .text.F1,"axG",@progbits,F1,comdat
31 ; LINUX-SECTIONS: .size   F1,
32 ; LINUX-SECTIONS-NEXT: .cfi_endproc
33 ; LINUX-SECTIONS-NEXT: .section        .rodata.F1,"aG",@progbits,F1,comdat
34
35 $G16 = comdat any
36 @G16 = unnamed_addr constant i32 42, comdat
37
38 ; LINUX: .section       .rodata.G16,"aG",@progbits,G16,comdat
39 ; LINUX-SECTIONS: .section      .rodata.G16,"aG",@progbits,G16,comdat