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, void ()*, i8* }] [
32 { i32, void ()*, i8* } { i32 12345, void ()* @g, i8* null },
33 { i32, void ()*, i8* } { i32 42, void ()* @f, i8* null },
34 { i32, void ()*, i8* } { i32 23456, void ()* @init_h, i8* @h },
35 { i32, void ()*, i8* } { i32 65535, void ()* @str3_dtor, i8* null }
38 declare dso_local i32 @puts(i8* nocapture readonly) local_unnamed_addr
40 define dso_local void @g() {
42 %call = tail call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str0, i64 0, i64 0))
46 define dso_local void @f() {
48 %call = tail call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str1, i64 0, i64 0))
52 define dso_local void @str3_dtor() {
54 %call = tail call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str3, i64 0, i64 0))
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(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str2, i64 0, i64 0))