[TTI] getTypeBasedIntrinsicInstrCost - add basic handling for strided load/store...
[llvm-project.git] / llvm / test / CodeGen / AArch64 / ptrauth-sign-personality.ll
blobef0e203b55ee2d792535a8ee0b919b051adfef6b
1 ; RUN: rm -rf %t && split-file %s %t && cd %t
2 ; RUN: cat common.ll authflag.ll   > auth.ll
3 ; RUN: cat common.ll noauthflag.ll > noauth1.ll
4 ; RUN: cat common.ll               > noauth2.ll
6 ; RUN: llc -mtriple=aarch64-linux -filetype=asm auth.ll -o - | \
7 ; RUN:   FileCheck --check-prefix=AUTH-ASM %s
8 ; RUN: llc -mtriple=aarch64-linux -filetype=obj auth.ll -o - | \
9 ; RUN:   llvm-readelf -r -x .data.DW.ref.__gxx_personality_v0 - | \
10 ; RUN:   FileCheck --check-prefix=AUTH-RELOC %s
12 ; AUTH-ASM:      DW.ref.__gxx_personality_v0:
13 ; AUTH-ASM-NEXT:     .xword  __gxx_personality_v0@AUTH(ia,32429,addr)
15 ; AUTH-RELOC:      Relocation section '.rela.data.DW.ref.__gxx_personality_v0' at offset 0x2a0 contains 1 entries:
16 ; AUTH-RELOC-NEXT:     Offset             Info             Type               Symbol's Value  Symbol's Name + Addend
17 ; AUTH-RELOC-NEXT: 0000000000000000  0000000f00000244 R_AARCH64_AUTH_ABS64   0000000000000000 __gxx_personality_v0 + 0
19 ; AUTH-RELOC:      Hex dump of section '.data.DW.ref.__gxx_personality_v0':
20 ; AUTH-RELOC-NEXT: 0x00000000 00000000 ad7e0080
21 ;                                      ^^^^ 0x7EAD = discriminator
22 ;                                            ^^ 0b10000000: bit 63 = 1 -> address diversity enabled, bits 61:60 = 0b00 -> key is IA
24 ; RUN: llc -mtriple=aarch64-linux -filetype=asm noauth1.ll -o - | \
25 ; RUN:   FileCheck --check-prefix=NOAUTH-ASM %s
26 ; RUN: llc -mtriple=aarch64-linux -filetype=obj noauth1.ll -o - | \
27 ; RUN:   llvm-readelf -r -x .data.DW.ref.__gxx_personality_v0 - | \
28 ; RUN:   FileCheck --check-prefix=NOAUTH-RELOC %s
30 ; RUN: llc -mtriple=aarch64-linux -filetype=asm noauth2.ll -o - | \
31 ; RUN:   FileCheck --check-prefix=NOAUTH-ASM %s
32 ; RUN: llc -mtriple=aarch64-linux -filetype=obj noauth2.ll -o - | \
33 ; RUN:   llvm-readelf -r -x .data.DW.ref.__gxx_personality_v0 - | \
34 ; RUN:   FileCheck --check-prefix=NOAUTH-RELOC %s
36 ; NOAUTH-ASM:      DW.ref.__gxx_personality_v0:
37 ; NOAUTH-ASM-NEXT:     .xword  __gxx_personality_v0{{$}}
39 ; NOAUTH-RELOC:      Relocation section '.rela.data.DW.ref.__gxx_personality_v0' at offset 0x2a0 contains 1 entries:
40 ; NOAUTH-RELOC-NEXT:     Offset             Info             Type               Symbol's Value  Symbol's Name + Addend
41 ; NOAUTH-RELOC-NEXT: 0000000000000000  0000000f00000101 R_AARCH64_ABS64   0000000000000000 __gxx_personality_v0 + 0
43 ; NOAUTH-RELOC:      Hex dump of section '.data.DW.ref.__gxx_personality_v0':
44 ; NOAUTH-RELOC-NEXT: 0x00000000 00000000 00000000
46 ;--- common.ll
47 @_ZTISt9exception = external constant ptr
49 define i32 @main() personality ptr @__gxx_personality_v0 {
50 entry:
51   invoke void @foo() to label %cont unwind label %lpad
53 lpad:
54   %0 = landingpad { ptr, i32 }
55     catch ptr null
56     catch ptr @_ZTISt9exception
57   ret i32 0
59 cont:
60   ret i32 0
63 declare i32 @__gxx_personality_v0(...)
65 declare void @foo()
67 ;--- authflag.ll
68 !llvm.module.flags = !{!0}
69 !0 = !{i32 8, !"ptrauth-sign-personality", i32 1}
71 ;--- noauthflag.ll
72 !llvm.module.flags = !{!0}
73 !0 = !{i32 8, !"ptrauth-sign-personality", i32 0}