• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; 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}
20