1 # Check that BOLT inserts trap instruction at entry to functions that use AVX-512.
2 # Check that AVX-512 instruction is updated correctly when -trap-avx512=0 is passed.
4 RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-unknown -o %t.o \
5 RUN: %S/Inputs/avx512.s
6 RUN: ld.lld %t.o -o %t -q
7 RUN: llvm-objdump -d --disassemble-symbols=use_avx512 %t | \
8 RUN: FileCheck %s --check-prefix=CHECK-DIS-NO-TRAP
10 RUN: llvm-bolt %t --trap-avx512=1 -o %t.bolt --lite=0 2>&1 | FileCheck %s
11 RUN: llvm-objdump -d --disassemble-symbols=use_avx512 %t.bolt | \
12 RUN: FileCheck %s --check-prefix=CHECK-DIS
14 RUN: llvm-bolt %t --trap-avx512=0 -o %t.bolt --lite=0
15 RUN: llvm-objdump -d --disassemble-symbols=use_avx512 %t.bolt | \
16 RUN: FileCheck %s --check-prefix=CHECK-DIS-NO-TRAP
18 CHECK: BOLT-WARNING: 1 function will trap on entry
20 # Check that we have two ud2 instructions - one per entry.
25 # Check that we generate correct AVX-512
26 CHECK-DIS-NO-TRAP: use_avx512
27 CHECK-DIS-NO-TRAP: 62 e2 f5 70 2c da vscalefpd