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