1 ; RUN: llc < %s -asm-verbose=false | FileCheck %s
3 target triple = "wasm32-unknown-emscripten"
5 ; This tests the implementation of __builtin_return_address on emscripten
7 ; CHECK-LABEL: test_returnaddress:
8 ; CHECK-NEXT: .functype test_returnaddress () -> (i32){{$}}
9 ; CHECK-NEXT: {{^}} i32.const 0{{$}}
10 ; CHECK-NEXT: {{^}} call emscripten_return_address{{$}}
11 ; CHECK-NEXT: {{^}} end_function{{$}}
12 define i8* @test_returnaddress() {
13 %r = call i8* @llvm.returnaddress(i32 0)
17 ; LLVM represents __builtin_return_address as call to this function in IR.
18 declare i8* @llvm.returnaddress(i32 immarg)