1 ; RUN: opt < %s -mtriple aarch64-linux-android29 -passes=hwasan -S | FileCheck %s --check-prefixes=COMMON,LP,ARM
2 ; RUN: opt < %s -mtriple x86_64-linux -hwasan-instrument-landing-pads -passes=hwasan -S | FileCheck %s --check-prefixes=COMMON,LP,X86
3 ; RUN: opt < %s -mtriple aarch64-linux-android30 -passes=hwasan -S | FileCheck %s --check-prefixes=COMMON,NOLP
5 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
6 target triple = "aarch64-unknown-linux-android"
8 define i32 @f() local_unnamed_addr sanitize_hwaddress personality ptr @__gxx_personality_v0 {
11 to label %return unwind label %lpad
14 ; COMMON: landingpad { ptr, i32 }
15 ; COMMON-NEXT: catch ptr null
16 %0 = landingpad { ptr, i32 }
19 ; NOLP-NOT: call void @__hwasan_handle_vfork
20 ; LP-NEXT: %[[X:[^ ]*]] = call i64 @llvm.read_register.i64(metadata ![[META:[^ ]*]])
21 ; LP-NEXT: call void @__hwasan_handle_vfork(i64 %[[X]])
23 %1 = extractvalue { ptr, i32 } %0, 0
24 %2 = tail call ptr @__cxa_begin_catch(ptr %1)
25 tail call void @__cxa_end_catch()
28 %retval.0 = phi i32 [ 1, %lpad ], [ 0, %entry ]
32 declare void @g() local_unnamed_addr
34 declare i32 @__gxx_personality_v0(...)
35 declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr
36 declare void @__cxa_end_catch() local_unnamed_addr
38 ; ARM: ![[META]] = !{!"sp"}
39 ; X86: ![[META]] = !{!"rsp"}