88426dd43d50e166c9e3bd6f2691aa26cde5f046
[oota-llvm.git] / test / CodeGen / X86 / tls14.ll
1 ; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu > %t
2 ; RUN: grep {movsbl     %gs:i@NTPOFF, %eax} %t
3 ; RUN: grep {movzbl     %gs:j@NTPOFF, %eax} %t
4 ; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu > %t2
5 ; RUN: grep {movsbl     %fs:i@TPOFF, %edi} %t2
6 ; RUN: grep {movzbl     %fs:j@TPOFF, %edi} %t2
7
8 @i = thread_local global i8 0
9 @j = thread_local global i8 0
10
11 define void @f() nounwind optsize {
12 entry:
13         %0 = load i8* @i, align 2
14         %1 = sext i8 %0 to i32
15         tail call void @g(i32 %1) nounwind
16         %2 = load i8* @j, align 2
17         %3 = zext i8 %2 to i32
18         tail call void @h(i32 %3) nounwind
19         ret void
20 }
21
22 declare void @g(i32)
23
24 declare void @h(i32)