File: tls-pic.ll

package info (click to toggle)
llvm-2.9 2.9%2Bdfsg-7
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 69,236 kB
  • sloc: cpp: 439,289; ansic: 16,211; asm: 13,295; sh: 12,912; python: 4,459; ml: 4,274; perl: 2,093; makefile: 1,808; pascal: 1,481; exp: 427; objc: 334; xml: 283; ada: 235; lisp: 187; csh: 117; f90: 36
file content (67 lines) | stat: -rw-r--r-- 1,191 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu -relocation-model=pic | FileCheck -check-prefix=X32 %s
; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu -relocation-model=pic | FileCheck -check-prefix=X64 %s

@i = thread_local global i32 15

define i32 @f1() {
entry:
	%tmp1 = load i32* @i
	ret i32 %tmp1
}

; X32: f1:
; X32:   leal i@TLSGD(,%ebx), %eax
; X32:   calll ___tls_get_addr@PLT

; X64: f1:
; X64:   leaq i@TLSGD(%rip), %rdi
; X64:   callq __tls_get_addr@PLT


@i2 = external thread_local global i32

define i32* @f2() {
entry:
	ret i32* @i
}

; X32: f2:
; X32:   leal i@TLSGD(,%ebx), %eax
; X32:   calll ___tls_get_addr@PLT

; X64: f2:
; X64:   leaq i@TLSGD(%rip), %rdi
; X64:   callq __tls_get_addr@PLT



define i32 @f3() {
entry:
	%tmp1 = load i32* @i		; <i32> [#uses=1]
	ret i32 %tmp1
}

; X32: f3:
; X32:   leal	i@TLSGD(,%ebx), %eax
; X32:   calll ___tls_get_addr@PLT

; X64: f3:
; X64:   leaq i@TLSGD(%rip), %rdi
; X64:   callq __tls_get_addr@PLT


define i32* @f4() nounwind {
entry:
	ret i32* @i
}

; X32: f4:
; X32:   leal	i@TLSGD(,%ebx), %eax
; X32:   calll ___tls_get_addr@PLT

; X64: f4:
; X64:   leaq i@TLSGD(%rip), %rdi
; X64:   callq __tls_get_addr@PLT