1; RUN: llc -mtriple i686-windows-itanium -filetype asm -o - %s | FileCheck %s -check-prefix CHECK-ASM
2; RUN: llc -mtriple i686-windows-itanium -filetype obj -o - %s | llvm-readobj -relocations - | FileCheck %s -check-prefix CHECK-OBJ
3
4@get_count_incremented.count = internal thread_local unnamed_addr global i32 0, align 4
5
6define i32 @get_count_incremented() {
7entry:
8  %0 = load i32, i32* @get_count_incremented.count, align 4
9  %inc = add i32 %0, 1
10  store i32 %inc, i32* @get_count_incremented.count, align 4
11  ret i32 %inc
12}
13
14; CHECK-ASM-LABEL: _get_count_incremented:
15; CHECK-ASM: movl __tls_index, %eax
16; CHECK-ASM: movl %fs:__tls_array, %ecx
17; CHECK-ASM: movl (%ecx,%eax,4), %ecx
18; CHECK-ASM: _get_count_incremented.count@SECREL32(%ecx), %eax
19; CHECK-ASM: incl %eax
20; CHECK-ASM: movl %eax, _get_count_incremented.count@SECREL32(%ecx)
21; CHECK-ASM: retl
22
23; CHECK-OBJ: Relocations [
24; CHECK-OBJ:   Section ({{[0-9]+}}) .text {
25; CHECK-OBJ:     0x1 IMAGE_REL_I386_DIR32 __tls_index
26; CHECK-OBJ:     0x8 IMAGE_REL_I386_DIR32 __tls_array
27; CHECK-OBJ:     0x11 IMAGE_REL_I386_SECREL _get_count_incremented.count
28; CHECK-OBJ:     0x18 IMAGE_REL_I386_SECREL _get_count_incremented.count
29; CHECK-OBJ:   }
30; CHECK-OBJ: ]
31