1 ; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
4 @tlsvar = thread_local addrspace(1) global i32 0
6 define void @fail0(ptr %arg) {
7 ; CHECK: llvm.threadlocal.address first argument must be a GlobalValue
8 %p0 = call ptr @llvm.threadlocal.address(ptr %arg)
9 store i32 42, ptr %p0, align 4
13 define void @fail1() {
14 ; CHECK: llvm.threadlocal.address first argument must be a GlobalValue
15 %p0 = call ptr @llvm.threadlocal.address.p0(ptr addrspacecast (ptr addrspace(1) @tlsvar to ptr addrspace(0)))
16 store i32 42, ptr %p0, align 4
22 define void @fail2() {
23 ; CHECK: llvm.threadlocal.address operand isThreadLocal() must be true
24 %p0 = call ptr @llvm.threadlocal.address(ptr @var)
25 store i32 42, ptr %p0, align 4
29 define void @fail3() {
30 ; CHECK: llvm.threadlocal.address operand isThreadLocal() must be true
31 %p0 = call ptr @llvm.threadlocal.address(ptr @fail2)
32 store i32 42, ptr %p0, align 4