diff options
author | Fangrui Song <i@maskray.me> | 2020-01-20 15:52:38 -0800 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2020-01-24 10:38:40 -0800 |
commit | 0e2eea29cc4f360fc95638fbfc8aca24cec3fc5f (patch) | |
tree | 569796329fbe8c6afc5c93f1a29a65cdac707cd4 /llvm/test/CodeGen/AArch64 | |
parent | 6c1e479db225897cbbff7894ffe77824c03ab8fd (diff) | |
download | bcm5719-llvm-0e2eea29cc4f360fc95638fbfc8aca24cec3fc5f.tar.gz bcm5719-llvm-0e2eea29cc4f360fc95638fbfc8aca24cec3fc5f.zip |
[AsmPrinter] Don't emit __patchable_function_entries entry if "patchable-function-entry"="0"
Add improve tests
(cherry picked from commit d232c215669cb57f5eb4ead40a4a336220dbc429)
Diffstat (limited to 'llvm/test/CodeGen/AArch64')
-rw-r--r-- | llvm/test/CodeGen/AArch64/patchable-function-entry-bti.ll | 13 | ||||
-rw-r--r-- | llvm/test/CodeGen/AArch64/patchable-function-entry.ll | 27 |
2 files changed, 24 insertions, 16 deletions
diff --git a/llvm/test/CodeGen/AArch64/patchable-function-entry-bti.ll b/llvm/test/CodeGen/AArch64/patchable-function-entry-bti.ll index 9b406d45da6..00b9b2329fd 100644 --- a/llvm/test/CodeGen/AArch64/patchable-function-entry-bti.ll +++ b/llvm/test/CodeGen/AArch64/patchable-function-entry-bti.ll @@ -2,22 +2,21 @@ define i32 @f0() "patchable-function-entry"="0" "branch-target-enforcement" { ; CHECK-LABEL: f0: -; CHECK-NEXT: .Lfunc_begin0: -; CHECK: hint #34 +; CHECK-NEXT: .Lfunc_begin0: +; CHECK: %bb.0: +; CHECK-NEXT: hint #34 ; CHECK-NEXT: mov w0, wzr -; CHECK: .section __patchable_function_entries,"awo",@progbits,f0,unique,0 -; CHECK-NEXT: .p2align 3 -; CHECK-NEXT: .xword .Lfunc_begin0 +; CHECK-NOT: .section __patchable_function_entries ret i32 0 } define i32 @f1() "patchable-function-entry"="1" "branch-target-enforcement" { ; CHECK-LABEL: f1: -; CHECK-NEXT: .Lfunc_begin1: +; CHECK-NEXT: .Lfunc_begin1: ; CHECK: hint #34 ; CHECK-NEXT: nop ; CHECK-NEXT: mov w0, wzr -; CHECK: .section __patchable_function_entries,"awo",@progbits,f0,unique,0 +; CHECK: .section __patchable_function_entries,"awo",@progbits,f1,unique,0 ; CHECK-NEXT: .p2align 3 ; CHECK-NEXT: .xword .Lfunc_begin1 ret i32 0 diff --git a/llvm/test/CodeGen/AArch64/patchable-function-entry.ll b/llvm/test/CodeGen/AArch64/patchable-function-entry.ll index 12b8a35cb93..6d84f23ba5e 100644 --- a/llvm/test/CodeGen/AArch64/patchable-function-entry.ll +++ b/llvm/test/CodeGen/AArch64/patchable-function-entry.ll @@ -10,9 +10,7 @@ define i32 @f0() "patchable-function-entry"="0" { ; CHECK-NEXT: .Lfunc_begin0: ; CHECK-NOT: nop ; CHECK: mov w0, wzr -; CHECK: .section __patchable_function_entries,"awo",@progbits,f0,unique,0 -; CHECK-NEXT: .p2align 3 -; CHECK-NEXT: .xword .Lfunc_begin0 +; CHECK-NOT: .section __patchable_function_entries ret i32 0 } @@ -21,36 +19,47 @@ define i32 @f1() "patchable-function-entry"="1" { ; CHECK-NEXT: .Lfunc_begin1: ; CHECK: nop ; CHECK-NEXT: mov w0, wzr -; NOFSECT: .section __patchable_function_entries,"awo",@progbits,f0,unique,0 -; FSECT: .section __patchable_function_entries,"awo",@progbits,f1,unique,1 +; CHECK: .section __patchable_function_entries,"awo",@progbits,f1,unique,0 ; CHECK-NEXT: .p2align 3 ; CHECK-NEXT: .xword .Lfunc_begin1 ret i32 0 } +define void @f2() "patchable-function-entry"="2" { +; CHECK-LABEL: f2: +; CHECK-NEXT: .Lfunc_begin2: +; CHECK-COUNT-2: nop +; CHECK-NEXT: ret +; NOFSECT: .section __patchable_function_entries,"awo",@progbits,f1,unique,0 +; FSECT: .section __patchable_function_entries,"awo",@progbits,f2,unique,1 +; CHECK-NEXT: .p2align 3 +; CHECK-NEXT: .xword .Lfunc_begin2 + ret void +} + $f3 = comdat any define void @f3() "patchable-function-entry"="3" comdat { ; CHECK-LABEL: f3: -; CHECK-NEXT: .Lfunc_begin2: +; CHECK-NEXT: .Lfunc_begin3: ; CHECK-COUNT-3: nop ; CHECK-NEXT: ret ; NOFSECT: .section __patchable_function_entries,"aGwo",@progbits,f3,comdat,f3,unique,1 ; FSECT: .section __patchable_function_entries,"aGwo",@progbits,f3,comdat,f3,unique,2 ; CHECK-NEXT: .p2align 3 -; CHECK-NEXT: .xword .Lfunc_begin2 +; CHECK-NEXT: .xword .Lfunc_begin3 ret void } $f5 = comdat any define void @f5() "patchable-function-entry"="5" comdat { ; CHECK-LABEL: f5: -; CHECK-NEXT: .Lfunc_begin3: +; CHECK-NEXT: .Lfunc_begin4: ; CHECK-COUNT-5: nop ; CHECK-NEXT: sub sp, sp, #16 ; NOFSECT .section __patchable_function_entries,"aGwo",@progbits,f5,comdat,f5,unique,2 ; FSECT: .section __patchable_function_entries,"aGwo",@progbits,f5,comdat,f5,unique,3 ; CHECK: .p2align 3 -; CHECK-NEXT: .xword .Lfunc_begin3 +; CHECK-NEXT: .xword .Lfunc_begin4 %frame = alloca i8, i32 16 ret void } |