aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/CodeGen/WebAssembly/thread_pointer.ll
blob: 18716988673db999c1f3a7e0d553dcd10bc48a70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=wasm32-unknown-unknown | FileCheck %s --check-prefix=WASM32
; RUN: llc < %s -mtriple=wasm64-unknown-unknown | FileCheck %s --check-prefix=WASM64

declare ptr @llvm.thread.pointer()

define ptr @thread_pointer() nounwind {
; WASM32-LABEL: thread_pointer:
; WASM32:         .functype thread_pointer () -> (i32)
; WASM32-NEXT:  # %bb.0:
; WASM32-NEXT:    global.get __tls_base
; WASM32-NEXT:    # fallthrough-return
;
; WASM64-LABEL: thread_pointer:
; WASM64:         .functype thread_pointer () -> (i64)
; WASM64-NEXT:  # %bb.0:
; WASM64-NEXT:    global.get __tls_base
; WASM64-NEXT:    # fallthrough-return
  %1 = tail call ptr @llvm.thread.pointer()
  ret ptr %1
}