1 ; RUN: opt < %s -mtriple aarch64-linux-android29 -passes=hwasan -S | FileCheck %s --check-prefix=NOPERS
2 ; RUN: opt < %s -mtriple aarch64-linux-android30 -passes=hwasan -S | FileCheck %s --check-prefix=PERS
4 ; NOPERS: define void @nostack() #{{[0-9]+}} {
5 ; PERS: define void @nostack() #{{[0-9]+}} {
6 define void @nostack() sanitize_hwaddress {
10 ; NOPERS: define void @stack1() #{{[0-9]+}} {
11 ; PERS: personality {{.*}} @__hwasan_personality_thunk
12 define void @stack1() sanitize_hwaddress {
14 call void @sink(ptr %p)
19 ; NOPERS: personality ptr @global
20 ; PERS: personality {{.*}} @__hwasan_personality_thunk.global
21 define void @stack2() sanitize_hwaddress personality ptr @global {
23 call void @sink(ptr %p)
27 define internal void @local() {
31 @local_alias = internal alias void (), ptr @local
33 ; NOPERS: personality ptr @local
34 ; PERS: personality {{.*}} @__hwasan_personality_thunk.local
35 define void @stack3() sanitize_hwaddress personality ptr @local {
37 call void @sink(ptr %p)
41 ; NOPERS: personality ptr @local_alias
42 ; PERS: personality {{.*}} @__hwasan_personality_thunk.local_alias
43 define void @stack4() sanitize_hwaddress personality ptr @local_alias {
45 call void @sink(ptr %p)
49 ; NOPERS: personality ptr inttoptr (i64 1 to ptr)
50 ; PERS: personality ptr @__hwasan_personality_thunk.
51 define void @stack5() sanitize_hwaddress personality ptr inttoptr (i64 1 to ptr) {
53 call void @sink(ptr %p)
57 ; NOPERS: personality ptr inttoptr (i64 2 to ptr)
58 ; PERS: personality ptr @__hwasan_personality_thunk..1
59 define void @stack6() sanitize_hwaddress personality ptr inttoptr (i64 2 to ptr) {
61 call void @sink(ptr %p)
65 declare void @global()
66 declare void @sink(ptr)
68 ; PERS: define linkonce_odr hidden i32 @__hwasan_personality_thunk(i32 %0, i32 %1, i64 %2, ptr %3, ptr %4) comdat
69 ; PERS: %5 = tail call i32 @__hwasan_personality_wrapper(i32 %0, i32 %1, i64 %2, ptr %3, ptr %4, ptr null, ptr @_Unwind_GetGR, ptr @_Unwind_GetCFA)
72 ; PERS: define linkonce_odr hidden i32 @__hwasan_personality_thunk.global(i32 %0, i32 %1, i64 %2, ptr %3, ptr %4) comdat
73 ; PERS: %5 = tail call i32 @__hwasan_personality_wrapper(i32 %0, i32 %1, i64 %2, ptr %3, ptr %4, ptr @global, ptr @_Unwind_GetGR, ptr @_Unwind_GetCFA)
76 ; PERS: define internal i32 @__hwasan_personality_thunk.local(i32 %0, i32 %1, i64 %2, ptr %3, ptr %4)
77 ; PERS: %5 = tail call i32 @__hwasan_personality_wrapper(i32 %0, i32 %1, i64 %2, ptr %3, ptr %4, ptr @local, ptr @_Unwind_GetGR, ptr @_Unwind_GetCFA)
80 ; PERS: define internal i32 @__hwasan_personality_thunk.local_alias(i32 %0, i32 %1, i64 %2, ptr %3, ptr %4)
81 ; PERS: %5 = tail call i32 @__hwasan_personality_wrapper(i32 %0, i32 %1, i64 %2, ptr %3, ptr %4, ptr @local_alias, ptr @_Unwind_GetGR, ptr @_Unwind_GetCFA)
84 ; PERS: define internal i32 @__hwasan_personality_thunk.(i32 %0, i32 %1, i64 %2, ptr %3, ptr %4) {
85 ; PERS: %5 = tail call i32 @__hwasan_personality_wrapper(i32 %0, i32 %1, i64 %2, ptr %3, ptr %4, ptr inttoptr (i64 1 to ptr), ptr @_Unwind_GetGR, ptr @_Unwind_GetCFA)
88 ; PERS: define internal i32 @__hwasan_personality_thunk..1(i32 %0, i32 %1, i64 %2, ptr %3, ptr %4) {
89 ; PERS: %5 = tail call i32 @__hwasan_personality_wrapper(i32 %0, i32 %1, i64 %2, ptr %3, ptr %4, ptr inttoptr (i64 2 to ptr), ptr @_Unwind_GetGR, ptr @_Unwind_GetCFA)