1 ; RUN: llc -mtriple=wasm32-unknown-emscripten < %s -asm-verbose=false | FileCheck -DPTR=32 %s
2 ; RUN: llc -mtriple=wasm64-unknown-emscripten < %s -asm-verbose=false | FileCheck -DPTR=64 %s
4 ; This tests the implementation of __builtin_return_address on emscripten
6 ; CHECK-LABEL: test_returnaddress:
7 ; CHECK-NEXT: .functype test_returnaddress () -> (i[[PTR]]){{$}}
8 ; CHECK-NEXT: {{^}} i32.const 0{{$}}
9 ; CHECK-NEXT: {{^}} call emscripten_return_address{{$}}
10 ; CHECK-NEXT: {{^}} end_function{{$}}
11 define ptr @test_returnaddress() {
12 %r = call ptr @llvm.returnaddress(i32 0)
16 ; LLVM represents __builtin_return_address as call to this function in IR.
17 declare ptr @llvm.returnaddress(i32 immarg)