1 // RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
3 int leading
, trailing
, pop
;
5 void test_i16(short P
) {
6 leading
= __builtin_clzs(P
);
7 trailing
= __builtin_ctzs(P
);
10 // CHECK: call i16 @llvm.ctlz.i16
11 // CHECK: call i16 @llvm.cttz.i16
14 void test_i32(int P
) {
15 leading
= __builtin_clz(P
);
16 trailing
= __builtin_ctz(P
);
17 pop
= __builtin_popcount(P
);
20 // CHECK: call i32 @llvm.ctlz.i32
21 // CHECK: call i32 @llvm.cttz.i32
22 // CHECK: call i32 @llvm.ctpop.i32
25 void test_i64(float P
) {
26 leading
= __builtin_clzll(P
);
27 trailing
= __builtin_ctzll(P
);
28 pop
= __builtin_popcountll(P
);
30 // CHECK: call i64 @llvm.ctlz.i64
31 // CHECK: call i64 @llvm.cttz.i64
32 // CHECK: call i64 @llvm.ctpop.i64