1; RUN: llvm-as %s -o %t.o
2; RUN: ld -plugin %llvmshlibdir/LLVMgold.so -m elf_x86_64 \
3; RUN:    --plugin-opt=-jump-table-type=arity \
4; RUN:    --plugin-opt=-mattr=+aes \
5; RUN:    --plugin-opt=mcpu=core-avx2 \
6; RUN:    -shared %t.o -o %t2.o
7; RUN: llvm-nm %t2.o | FileCheck %s
8
9; CHECK: t __llvm_jump_instr_table_0_1
10; CHECK: t __llvm_jump_instr_table_1_1
11
12target triple = "x86_64-unknown-linux-gnu"
13define i32 @g(i32 %a) unnamed_addr jumptable {
14  ret i32 %a
15}
16
17define i32 (i32)* @get_g() {
18  ret i32 (i32)* @g
19}
20
21define i32 @f() unnamed_addr jumptable {
22  ret i32 0
23}
24
25define i32 ()* @get_f() {
26  ret i32 ()* @f
27}
28
29define <2 x i64> @test_aes(<2 x i64> %a0, <2 x i64> %a1) {
30  %res = call <2 x i64> @llvm.x86.aesni.aesenc(<2 x i64> %a0, <2 x i64> %a1)
31  ret <2 x i64> %res
32}
33declare <2 x i64> @llvm.x86.aesni.aesenc(<2 x i64>, <2 x i64>) nounwind readnone
34
35define <32 x i8> @test_avx2(<16 x i16> %a0, <16 x i16> %a1) {
36  %res = call <32 x i8> @llvm.x86.avx2.packuswb(<16 x i16> %a0, <16 x i16> %a1)
37  ret <32 x i8> %res
38}
39declare <32 x i8> @llvm.x86.avx2.packuswb(<16 x i16>, <16 x i16>) nounwind readnone
40