1; We manually create these here if we're not linking against
2; the CRT which would usually provide these.
3
4target triple = "i686-pc-windows-msvc"
5
6%IMAGE_TLS_DIRECTORY32 = type {
7    i32,    ; StartAddressOfRawData
8    i32,    ; EndAddressOfRawData
9    i32,    ; AddressOfIndex
10    i32,    ; AddressOfCallBacks
11    i32,    ; SizeOfZeroFill
12    i32     ; Characteristics
13}
14
15@_tls_start = global i8 zeroinitializer, section ".tls"
16@_tls_end = global i8 zeroinitializer, section ".tls$ZZZ"
17@_tls_index = global i32 0
18
19@_tls_used = global %IMAGE_TLS_DIRECTORY32 {
20    i32 ptrtoint (i8* @_tls_start to i32),
21    i32 ptrtoint (i8* @_tls_end to i32),
22    i32 ptrtoint (i32* @_tls_index to i32),
23    i32 0,
24    i32 0,
25    i32 0
26}, section ".rdata$T"
27
28; MSVC target uses a direct offset (0x58) for x86-64 but expects
29; __tls_array to hold the offset (0x2C) on x86.
30module asm ".global __tls_array"
31module asm "__tls_array = 44"