aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/CodeGen/WebAssembly/fake-use.ll
blob: a18ce33566df0bef65fd6952babcb7ef0aa85a77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
; RUN: llc < %s | llvm-mc -triple=wasm32-unknown-unknown

target triple = "wasm32-unknown-unknown"

define void @fake_use() {
  %t = call i32 @foo()
  tail call void (...) @llvm.fake.use(i32 %t)
  ret void
}

; %t shouldn't be converted to TEE in RegStackify, because the FAKE_USE will be
; deleted in the beginning of ExplicitLocals.
define void @fake_use_no_tee() {
  %t = call i32 @foo()
  tail call void (...) @llvm.fake.use(i32 %t)
  call void @use(i32 %t)
  ret void
}

declare i32 @foo()
declare void @use(i32 %t)
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite)
declare void @llvm.fake.use(...) #0

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) }