brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.0 KiB · ef0e203 Raw
74 lines · plain
1; RUN: rm -rf %t && split-file %s %t && cd %t2; RUN: cat common.ll authflag.ll   > auth.ll3; RUN: cat common.ll noauthflag.ll > noauth1.ll4; RUN: cat common.ll               > noauth2.ll5 6; RUN: llc -mtriple=aarch64-linux -filetype=asm auth.ll -o - | \7; RUN:   FileCheck --check-prefix=AUTH-ASM %s8; 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 %s11 12; AUTH-ASM:      DW.ref.__gxx_personality_v0:13; AUTH-ASM-NEXT:     .xword  __gxx_personality_v0@AUTH(ia,32429,addr)14 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 + Addend17; AUTH-RELOC-NEXT: 0000000000000000  0000000f00000244 R_AARCH64_AUTH_ABS64   0000000000000000 __gxx_personality_v0 + 018 19; AUTH-RELOC:      Hex dump of section '.data.DW.ref.__gxx_personality_v0':20; AUTH-RELOC-NEXT: 0x00000000 00000000 ad7e008021;                                      ^^^^ 0x7EAD = discriminator22;                                            ^^ 0b10000000: bit 63 = 1 -> address diversity enabled, bits 61:60 = 0b00 -> key is IA23 24; RUN: llc -mtriple=aarch64-linux -filetype=asm noauth1.ll -o - | \25; RUN:   FileCheck --check-prefix=NOAUTH-ASM %s26; 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 %s29 30; RUN: llc -mtriple=aarch64-linux -filetype=asm noauth2.ll -o - | \31; RUN:   FileCheck --check-prefix=NOAUTH-ASM %s32; 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 %s35 36; NOAUTH-ASM:      DW.ref.__gxx_personality_v0:37; NOAUTH-ASM-NEXT:     .xword  __gxx_personality_v0{{$}}38 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 + Addend41; NOAUTH-RELOC-NEXT: 0000000000000000  0000000f00000101 R_AARCH64_ABS64   0000000000000000 __gxx_personality_v0 + 042 43; NOAUTH-RELOC:      Hex dump of section '.data.DW.ref.__gxx_personality_v0':44; NOAUTH-RELOC-NEXT: 0x00000000 00000000 0000000045 46;--- common.ll47@_ZTISt9exception = external constant ptr48 49define i32 @main() personality ptr @__gxx_personality_v0 {50entry:51  invoke void @foo() to label %cont unwind label %lpad52 53lpad:54  %0 = landingpad { ptr, i32 }55    catch ptr null56    catch ptr @_ZTISt9exception57  ret i32 058 59cont:60  ret i32 061}62 63declare i32 @__gxx_personality_v0(...)64 65declare void @foo()66 67;--- authflag.ll68!llvm.module.flags = !{!0}69!0 = !{i32 8, !"ptrauth-sign-personality", i32 1}70 71;--- noauthflag.ll72!llvm.module.flags = !{!0}73!0 = !{i32 8, !"ptrauth-sign-personality", i32 0}74