[AVX512] Enabling bit logic lowering
[oota-llvm.git] / test / CodeGen / X86 / cfi_simple_indirect_call.ll
1 ; RUN: llc -fcfi -cfi-type=sub <%s | FileCheck --check-prefix=SUB %s
2 ; RUN: llc -fcfi -cfi-type=add <%s | FileCheck --check-prefix=ADD %s
3 ; RUN: llc -fcfi -cfi-type=ror <%s | FileCheck --check-prefix=ROR %s
4
5 target triple = "x86_64-unknown-linux-gnu"
6
7 define void @indirect_fun() unnamed_addr jumptable {
8   ret void
9 }
10
11 define i32 @m(void ()* %fun) {
12   call void ()* %fun()
13 ; SUB: subl    
14 ; SUB: andq    $8
15 ; SUB-LABEL: leaq    __llvm_jump_instr_table_0_1
16 ; SUB-LABEL: callq   __llvm_cfi_pointer_warning
17
18 ; ROR: subq
19 ; ROR: rolq    $61
20 ; ROR: testq
21 ; ROR-LABEL: callq   __llvm_cfi_pointer_warning
22
23 ; ADD: andq    $8
24 ; ADD-LABEL: leaq    __llvm_jump_instr_table_0_1
25 ; ADD: cmpq
26 ; ADD-LABEL: callq   __llvm_cfi_pointer_warning
27 ret i32 0
28 }
29
30 define void ()* @get_fun() {
31   ret void ()* @indirect_fun
32 }
33
34 define i32 @main(i32 %argc, i8** %argv) {
35   %f = call void ()* ()* @get_fun()
36   %a = call i32 @m(void ()* %f)
37   ret i32 %a
38 }
39 ; SUB: .text
40 ; SUB: .align 8
41 ; SUB-LABEL: .type __llvm_jump_instr_table_0_1,@function
42 ; SUB-LABEL:__llvm_jump_instr_table_0_1:
43 ; SUB-LABEL: jmp indirect_fun@PLT