blob: 77c0751e219d7bfe8b25f9964c5be6d947eacb8f [file] [log] [blame]
Chandler Carruthc491f722015-01-11 01:36:20 +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]]
15; CHECK-NEXT: callq *[[RAX]]
16entry:
17 call void bitcast (i64* @a to void ()*)()
18 ret void
19}