File: speculation-hardening-sls-boththunks.ll

package info (click to toggle)
llvm-toolchain-17 1%3A17.0.6-22
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,799,624 kB
  • sloc: cpp: 6,428,607; ansic: 1,383,196; asm: 793,408; python: 223,504; objc: 75,364; f90: 60,502; lisp: 33,869; pascal: 15,282; sh: 9,684; perl: 7,453; ml: 4,937; awk: 3,523; makefile: 2,889; javascript: 2,149; xml: 888; fortran: 619; cs: 573
file content (23 lines) | stat: -rw-r--r-- 965 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
; RUN: llc -mattr=harden-sls-retbr -mattr=harden-sls-blr -verify-machineinstrs -mtriple=armv8-linux-gnueabi -stop-after=arm-sls-hardening %s -o - | FileCheck %s

; Given both Arm and Thumb functions in the same compilation unit, we should
; get both arm and thumb thunks.

define i32 @test1(i32 %a, i32 %b) {
  ret i32 %a
}

define i32 @test2(i32 %a, i32 %b) "target-features"="+thumb-mode" {
  ret i32 %a
}

; CHECK: define i32 @test1(i32 %a, i32 %b) #0
; CHECK: define i32 @test2(i32 %a, i32 %b) #1
; CHECK: define linkonce_odr hidden void @__llvm_slsblr_thunk_arm_sp() #2 comdat
; CHECK: define linkonce_odr hidden void @__llvm_slsblr_thunk_thumb_sp() #3 comdat

; CHECK: attributes #0 = { "target-features"="+harden-sls-retbr,+harden-sls-blr" }
; CHECK: attributes #1 = { "target-features"="+thumb-mode,+harden-sls-retbr,+harden-sls-blr" }
; CHECK: attributes #2 = { naked nounwind }
; CHECK: attributes #3 = { naked nounwind "target-features"="+thumb-mode" }