1 ; Test that weak functions and globals are placed into selectany COMDAT
\r
2 ; sections with the mangled name as suffix. Ensure that the weak linkage
\r
3 ; type is not ignored by the backend if the section was specialized.
\r
5 ; RUN: llc -mtriple=i686-pc-win32 %s -o - | FileCheck %s --check-prefix=X86
\r
6 ; RUN: llc -mtriple=i686-pc-mingw32 %s -o - | FileCheck %s --check-prefix=X86
\r
7 ; RUN: llc -mtriple=x86_64-pc-win32 %s -o - | FileCheck %s --check-prefix=X64
\r
8 ; RUN: llc -mtriple=x86_64-pc-mingw32 %s -o - | FileCheck %s --check-prefix=X64
\r
11 ; X86: .section .text,"xr",discard,__Z3foo
\r
12 ; X86: .globl __Z3foo
\r
14 ; X64: .section .text,"xr",discard,_Z3foo
\r
15 ; X64: .globl _Z3foo
\r
16 define weak void @_Z3foo() {
\r
20 ; Unmangled function
\r
21 ; X86: .section .sect,"xr",discard,_f
\r
24 ; X64: .section .sect,"xr",discard,f
\r
26 define weak void @f() section ".sect" {
\r
31 ; X86: .section .data,"rd",discard,_a
\r
35 ; X64: .section .data,"rd",discard,a
\r
38 @a = weak unnamed_addr constant { i32, i32, i32 } { i32 0, i32 0, i32 0}, section ".data"
\r
40 ; X86: .section .tls$,"wd",discard,_b
\r
44 ; X64: .section .tls$,"wd",discard,b
\r
48 @b = weak_odr thread_local global i32 0, align 4
\r