1 ; RUN: opt < %s -mtriple aarch64-linux-android -hwasan -S | FileCheck %s --check-prefixes=COMMON,ARM
2 ; RUN: opt < %s -mtriple x86_64-linux -hwasan -S | FileCheck %s --check-prefixes=COMMON,X86
4 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
5 target triple = "aarch64-unknown-linux-android"
7 define i32 @f() local_unnamed_addr sanitize_hwaddress personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
10 to label %return unwind label %lpad
13 ; COMMON: landingpad { i8*, i32 }
14 ; COMMON-NEXT: catch i8* null
15 %0 = landingpad { i8*, i32 }
18 ; COMMON-NEXT: %[[X:[^ ]*]] = call i64 @llvm.read_register.i64(metadata ![[META:[^ ]*]])
19 ; COMMON-NEXT: call void @__hwasan_handle_vfork(i64 %[[X]])
21 %1 = extractvalue { i8*, i32 } %0, 0
22 %2 = tail call i8* @__cxa_begin_catch(i8* %1)
23 tail call void @__cxa_end_catch()
26 %retval.0 = phi i32 [ 1, %lpad ], [ 0, %entry ]
30 declare void @g() local_unnamed_addr
32 declare i32 @__gxx_personality_v0(...)
33 declare i8* @__cxa_begin_catch(i8*) local_unnamed_addr
34 declare void @__cxa_end_catch() local_unnamed_addr
36 ; ARM: ![[META]] = !{!"sp"}
37 ; X86: ![[META]] = !{!"rsp"}