1;; Test jump table generation with Indirect Branch Tracking on x86. 2; RUN: opt -S -passes=lowertypetests -mtriple=i686 %s | FileCheck --check-prefixes=X86,X86_32 %s 3; RUN: opt -S -passes=lowertypetests -mtriple=x86_64 %s | FileCheck --check-prefixes=X86,X86_64 %s 4 5@0 = private unnamed_addr constant [2 x ptr] [ptr @f, ptr @g], align 16 6 7define void @f() !type !0 { 8 ret void 9} 10 11define internal void @g() !type !0 { 12 ret void 13} 14 15declare i1 @llvm.type.test(ptr %ptr, metadata %bitset) nounwind readnone 16 17define i1 @foo(ptr %p) { 18 %x = call i1 @llvm.type.test(ptr %p, metadata !"typeid1") 19 ret i1 %x 20} 21 22!llvm.module.flags = !{!1} 23!0 = !{i32 0, !"typeid1"} 24!1 = !{i32 8, !"cf-protection-branch", i32 1} 25 26; X86: define private void @.cfi.jumptable() #[[#ATTR:]] align 16 { 27; X86-NEXT: entry: 28; X86_32-NEXT: call void asm sideeffect "endbr32\0Ajmp ${0:c}@plt\0A.balign 16, 0xcc\0Aendbr32\0Ajmp ${1:c}@plt\0A.balign 16, 0xcc\0A", "s,s"(ptr @f.cfi, ptr @g.cfi) 29; X86_64-NEXT: call void asm sideeffect "endbr64\0Ajmp ${0:c}@plt\0A.balign 16, 0xcc\0Aendbr64\0Ajmp ${1:c}@plt\0A.balign 16, 0xcc\0A", "s,s"(ptr @f.cfi, ptr @g.cfi) 30 31; X86_64: attributes #[[#ATTR]] = { naked nocf_check noinline } 32