blob: 3af1d44987faa5595e64937be3345660ee667b6b [file] [log] [blame]
Michael Kuperstein46f7d522015-01-08 11:50:58 +00001; RUN: llc < %s | FileCheck %s
2; Don't try to emit a direct call through a TLS global.
3; This fixes PR22103
4
5target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
6target triple = "x86_64-unknown-linux-gnu"
7
8@a = external thread_local global i64
9
10; Function Attrs: nounwind
11define void @_Z1fv() {
12; CHECK-NOT: callq *$a
13; CHECK: movq %fs:0, [[RAX:%r..]]
14; CHECK-NEXT: addq a@GOTTPOFF(%rip), [[RAX]]
Michael Kuperstein381dc082015-01-08 12:05:02 +000015; CHECK-NEXT: callq *[[RAX]]
Michael Kuperstein46f7d522015-01-08 11:50:58 +000016entry:
17 call void bitcast (i64* @a to void ()*)()
18 ret void
19}