1 ; RUN: llc < %s | FileCheck %s
3 ; Check that we come up with appropriate section names that link.exe sorts
6 ; CHECK: .section .CRT$XTA00042,"dr"
9 ; CHECK: .section .CRT$XTT12345,"dr"
12 ; CHECK: .section .CRT$XTT23456,"dr",associative,h
15 ; CHECK: .section .CRT$XTX,"dr"
17 ; CHECK: .quad str3_dtor
19 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
20 target triple = "x86_64-pc-windows-msvc19.14.26433"
24 @h = linkonce_odr global i8 55, comdat, align 1
26 @str0 = private dso_local unnamed_addr constant [6 x i8] c"later\00", align 1
27 @str1 = private dso_local unnamed_addr constant [6 x i8] c"first\00", align 1
28 @str2 = private dso_local unnamed_addr constant [5 x i8] c"main\00", align 1
29 @str3 = private dso_local unnamed_addr constant [8 x i8] c"default\00", align 1
31 @llvm.global_dtors = appending global [4 x { i32, ptr, ptr }] [
32 { i32, ptr, ptr } { i32 12345, ptr @g, ptr null },
33 { i32, ptr, ptr } { i32 42, ptr @f, ptr null },
34 { i32, ptr, ptr } { i32 23456, ptr @init_h, ptr @h },
35 { i32, ptr, ptr } { i32 65535, ptr @str3_dtor, ptr null }
38 declare dso_local i32 @puts(ptr nocapture readonly) local_unnamed_addr
40 define dso_local void @g() {
42 %call = tail call i32 @puts(ptr @str0)
46 define dso_local void @f() {
48 %call = tail call i32 @puts(ptr @str1)
52 define dso_local void @str3_dtor() {
54 %call = tail call i32 @puts(ptr @str3)
58 define dso_local void @init_h() {
65 ; Function Attrs: nounwind uwtable
66 define dso_local i32 @main() local_unnamed_addr {
68 %call = tail call i32 @puts(ptr @str2)