annotate clang/test/Sema/builtins-x86.cpp @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -triple=x86_64-apple-darwin -fsyntax-only -verify %s
anatofuz
parents:
diff changeset
2 //
anatofuz
parents:
diff changeset
3 // Ensure that when we use builtins in C++ code with templates that compute the
anatofuz
parents:
diff changeset
4 // valid immediate, the dead code with the invalid immediate doesn't error.
anatofuz
parents:
diff changeset
5 // expected-no-diagnostics
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 typedef short __v8hi __attribute__((__vector_size__(16)));
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 template <int Imm>
anatofuz
parents:
diff changeset
10 __v8hi test(__v8hi a) {
anatofuz
parents:
diff changeset
11 if (Imm < 4)
anatofuz
parents:
diff changeset
12 return __builtin_ia32_pshuflw(a, 0x55 * Imm);
anatofuz
parents:
diff changeset
13 else
anatofuz
parents:
diff changeset
14 return __builtin_ia32_pshuflw(a, 0x55 * (Imm - 4));
anatofuz
parents:
diff changeset
15 }
anatofuz
parents:
diff changeset
16
anatofuz
parents:
diff changeset
17 template __v8hi test<0>(__v8hi);
anatofuz
parents:
diff changeset
18 template __v8hi test<1>(__v8hi);
anatofuz
parents:
diff changeset
19 template __v8hi test<2>(__v8hi);
anatofuz
parents:
diff changeset
20 template __v8hi test<3>(__v8hi);
anatofuz
parents:
diff changeset
21 template __v8hi test<4>(__v8hi);
anatofuz
parents:
diff changeset
22 template __v8hi test<5>(__v8hi);
anatofuz
parents:
diff changeset
23 template __v8hi test<6>(__v8hi);
anatofuz
parents:
diff changeset
24 template __v8hi test<7>(__v8hi);