diff options
Diffstat (limited to 'llvm/test/CodeGen/X86')
| -rw-r--r-- | llvm/test/CodeGen/X86/coff-comdat.ll | 92 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/coff-comdat.s | 156 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/coff-comdat2.ll | 9 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/coff-comdat3.ll | 8 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/elf-comdat.ll | 11 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/elf-comdat2.ll | 12 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/macho-comdat.ll | 6 |
7 files changed, 294 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/coff-comdat.ll b/llvm/test/CodeGen/X86/coff-comdat.ll new file mode 100644 index 00000000000..bf27b2fff1f --- /dev/null +++ b/llvm/test/CodeGen/X86/coff-comdat.ll @@ -0,0 +1,92 @@ +; RUN: llc -mtriple i386-pc-win32 < %s | FileCheck %s + +$f1 = comdat any +@v1 = global i32 0, comdat $f1 +define void @f1() comdat $f1 { + ret void +} + +$f2 = comdat exactmatch +@v2 = global i32 0, comdat $f2 +define void @f2() comdat $f2 { + ret void +} + +$f3 = comdat largest +@v3 = global i32 0, comdat $f3 +define void @f3() comdat $f3 { + ret void +} + +$f4 = comdat noduplicates +@v4 = global i32 0, comdat $f4 +define void @f4() comdat $f4 { + ret void +} + +$f5 = comdat samesize +@v5 = global i32 0, comdat $f5 +define void @f5() comdat $f5 { + ret void +} + +$f6 = comdat samesize +@v6 = global i32 0, comdat $f6 +@f6 = global i32 0, comdat $f6 + +$"\01@f7@0" = comdat any +define x86_fastcallcc void @"\01@v7@0"() comdat $"\01@f7@0" { + ret void +} +define x86_fastcallcc void @"\01@f7@0"() comdat $"\01@f7@0" { + ret void +} + +$f8 = comdat any +define x86_fastcallcc void @v8() comdat $f8 { + ret void +} +define x86_fastcallcc void @f8() comdat $f8 { + ret void +} + +$vftable = comdat largest + +@some_name = private unnamed_addr constant [2 x i8*] zeroinitializer, comdat $vftable +@vftable = alias getelementptr([2 x i8*]* @some_name, i32 0, i32 1) + +; CHECK: .section .text,"xr",discard,_f1 +; CHECK: .globl _f1 +; CHECK: .section .text,"xr",same_contents,_f2 +; CHECK: .globl _f2 +; CHECK: .section .text,"xr",largest,_f3 +; CHECK: .globl _f3 +; CHECK: .section .text,"xr",one_only,_f4 +; CHECK: .globl _f4 +; CHECK: .section .text,"xr",same_size,_f5 +; CHECK: .globl _f5 +; CHECK: .section .text,"xr",associative,@f7@0 +; CHECK: .globl @v7@0 +; CHECK: .section .text,"xr",discard,@f7@0 +; CHECK: .globl @f7@0 +; CHECK: .section .text,"xr",associative,@f8@0 +; CHECK: .globl @v8@0 +; CHECK: .section .text,"xr",discard,@f8@0 +; CHECK: .globl @f8@0 +; CHECK: .section .bss,"bw",associative,_f1 +; CHECK: .globl _v1 +; CHECK: .section .bss,"bw",associative,_f2 +; CHECK: .globl _v2 +; CHECK: .section .bss,"bw",associative,_f3 +; CHECK: .globl _v3 +; CHECK: .section .bss,"bw",associative,_f4 +; CHECK: .globl _v4 +; CHECK: .section .bss,"bw",associative,_f5 +; CHECK: .globl _v5 +; CHECK: .section .bss,"bw",associative,_f6 +; CHECK: .globl _v6 +; CHECK: .section .bss,"bw",same_size,_f6 +; CHECK: .globl _f6 +; CHECK: .section .rdata,"rd",largest,_vftable +; CHECK: .globl _vftable +; CHECK: _vftable = L_some_name+4 diff --git a/llvm/test/CodeGen/X86/coff-comdat.s b/llvm/test/CodeGen/X86/coff-comdat.s new file mode 100644 index 00000000000..aca0488c47a --- /dev/null +++ b/llvm/test/CodeGen/X86/coff-comdat.s @@ -0,0 +1,156 @@ + .text + .def @feat.00; + .scl 3; + .type 0; + .endef + .globl @feat.00 +@feat.00 = 1 + .def _f1; + .scl 2; + .type 32; + .endef + .section .text,"xr",discard,_f1 + .globl _f1 + .align 16, 0x90 +_f1: # @f1 +# BB#0: + retl + + .def _f2; + .scl 2; + .type 32; + .endef + .section .text,"xr",same_contents,_f2 + .globl _f2 + .align 16, 0x90 +_f2: # @f2 +# BB#0: + retl + + .def _f3; + .scl 2; + .type 32; + .endef + .section .text,"xr",largest,_f3 + .globl _f3 + .align 16, 0x90 +_f3: # @f3 +# BB#0: + retl + + .def _f4; + .scl 2; + .type 32; + .endef + .section .text,"xr",one_only,_f4 + .globl _f4 + .align 16, 0x90 +_f4: # @f4 +# BB#0: + retl + + .def _f5; + .scl 2; + .type 32; + .endef + .section .text,"xr",same_size,_f5 + .globl _f5 + .align 16, 0x90 +_f5: # @f5 +# BB#0: + retl + + .def @v7@0; + .scl 2; + .type 32; + .endef + .section .text,"xr",associative,@f7@0 + .globl @v7@0 + .align 16, 0x90 +@v7@0: # @"\01@v7@0" +# BB#0: + retl + + .def @f7@0; + .scl 2; + .type 32; + .endef + .section .text,"xr",discard,@f7@0 + .globl @f7@0 + .align 16, 0x90 +@f7@0: # @"\01@f7@0" +# BB#0: + retl + + .def @v8@0; + .scl 2; + .type 32; + .endef + .section .text,"xr",associative,@f8@0 + .globl @v8@0 + .align 16, 0x90 +@v8@0: # @v8 +# BB#0: + retl + + .def @f8@0; + .scl 2; + .type 32; + .endef + .section .text,"xr",discard,@f8@0 + .globl @f8@0 + .align 16, 0x90 +@f8@0: # @f8 +# BB#0: + retl + + .section .bss,"bw",associative,_f1 + .globl _v1 # @v1 + .align 4 +_v1: + .long 0 # 0x0 + + .section .bss,"bw",associative,_f2 + .globl _v2 # @v2 + .align 4 +_v2: + .long 0 # 0x0 + + .section .bss,"bw",associative,_f3 + .globl _v3 # @v3 + .align 4 +_v3: + .long 0 # 0x0 + + .section .bss,"bw",associative,_f4 + .globl _v4 # @v4 + .align 4 +_v4: + .long 0 # 0x0 + + .section .bss,"bw",associative,_f5 + .globl _v5 # @v5 + .align 4 +_v5: + .long 0 # 0x0 + + .section .bss,"bw",associative,_f6 + .globl _v6 # @v6 + .align 4 +_v6: + .long 0 # 0x0 + + .section .bss,"bw",same_size,_f6 + .globl _f6 # @f6 + .align 4 +_f6: + .long 0 # 0x0 + + .section .rdata,"rd" + .align 4 # @some_name +L_some_name: + .zero 8 + + + .globl _vftable +_vftable = L_some_name+4 diff --git a/llvm/test/CodeGen/X86/coff-comdat2.ll b/llvm/test/CodeGen/X86/coff-comdat2.ll new file mode 100644 index 00000000000..6744b5b02ad --- /dev/null +++ b/llvm/test/CodeGen/X86/coff-comdat2.ll @@ -0,0 +1,9 @@ +; RUN: not llc %s -o /dev/null 2>&1 | FileCheck %s + +target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32" +target triple = "i686-pc-windows-msvc" + +$foo = comdat largest +@foo = global i32 0 +@bar = global i32 0, comdat $foo +; CHECK: Associative COMDAT symbol 'foo' is not a key for it's COMDAT. diff --git a/llvm/test/CodeGen/X86/coff-comdat3.ll b/llvm/test/CodeGen/X86/coff-comdat3.ll new file mode 100644 index 00000000000..76e464b2754 --- /dev/null +++ b/llvm/test/CodeGen/X86/coff-comdat3.ll @@ -0,0 +1,8 @@ +; RUN: not llc %s -o /dev/null 2>&1 | FileCheck %s + +target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32" +target triple = "i686-pc-windows-msvc" + +$foo = comdat largest +@bar = global i32 0, comdat $foo +; CHECK: Associative COMDAT symbol 'foo' does not exist. diff --git a/llvm/test/CodeGen/X86/elf-comdat.ll b/llvm/test/CodeGen/X86/elf-comdat.ll new file mode 100644 index 00000000000..c7e6df7d64f --- /dev/null +++ b/llvm/test/CodeGen/X86/elf-comdat.ll @@ -0,0 +1,11 @@ +; RUN: llc -mtriple x86_64-pc-linux-gnu < %s | FileCheck %s + +$f = comdat any +@v = global i32 0, comdat $f +define void @f() comdat $f { + ret void +} +; CHECK: .section .text.f,"axG",@progbits,f,comdat +; CHECK: .globl f +; CHECK: .section .bss.v,"aGw",@nobits,f,comdat +; CHECK: .globl v diff --git a/llvm/test/CodeGen/X86/elf-comdat2.ll b/llvm/test/CodeGen/X86/elf-comdat2.ll new file mode 100644 index 00000000000..209da39ed88 --- /dev/null +++ b/llvm/test/CodeGen/X86/elf-comdat2.ll @@ -0,0 +1,12 @@ +; RUN: llc -mtriple x86_64-pc-linux-gnu < %s | FileCheck %s + +$foo = comdat any +@bar = global i32 42, comdat $foo +@foo = global i32 42 + +; CHECK: .type bar,@object +; CHECK-NEXT: .section .data.bar,"aGw",@progbits,foo,comdat +; CHECK-NEXT: .globl bar +; CHECK: .type foo,@object +; CHECK-NEXT: .data +; CHECK-NEXT: .globl foo diff --git a/llvm/test/CodeGen/X86/macho-comdat.ll b/llvm/test/CodeGen/X86/macho-comdat.ll new file mode 100644 index 00000000000..3c2d997b459 --- /dev/null +++ b/llvm/test/CodeGen/X86/macho-comdat.ll @@ -0,0 +1,6 @@ +; RUN: not llc -mtriple x86_64-apple-darwin < %s 2> %t +; RUN: FileCheck < %t %s + +$f = comdat any +@v = global i32 0, comdat $f +; CHECK: LLVM ERROR: MachO doesn't support COMDATs, 'f' cannot be lowered. |

