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 3 4; This tests the implementation of __builtin_return_address on emscripten 5 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{{$}} 11define ptr @test_returnaddress() { 12 %r = call ptr @llvm.returnaddress(i32 0) 13 ret ptr %r 14} 15 16; LLVM represents __builtin_return_address as call to this function in IR. 17declare ptr @llvm.returnaddress(i32 immarg) 18