1 // RUN: %clang_cc1 -triple avr-unknown-unknown -emit-llvm -o - %s | FileCheck %s
3 // Check that the parameter types match. This verifies pr43309.
4 // RUN: %clang_cc1 -triple avr-unknown-unknown -Wconversion -verify %s
5 // expected-no-diagnostics
7 unsigned char bitrev8(unsigned char data
) {
8 return __builtin_bitreverse8(data
);
11 // CHECK: define{{.*}} i8 @bitrev8
12 // CHECK: i8 @llvm.bitreverse.i8(i8
14 unsigned int bitrev16(unsigned int data
) {
15 return __builtin_bitreverse16(data
);
18 // CHECK: define{{.*}} i16 @bitrev16
19 // CHECK: i16 @llvm.bitreverse.i16(i16
21 unsigned long bitrev32(unsigned long data
) {
22 return __builtin_bitreverse32(data
);
24 // CHECK: define{{.*}} i32 @bitrev32
25 // CHECK: i32 @llvm.bitreverse.i32(i32
27 unsigned long long bitrev64(unsigned long long data
) {
28 return __builtin_bitreverse64(data
);
31 // CHECK: define{{.*}} i64 @bitrev64
32 // CHECK: i64 @llvm.bitreverse.i64(i64
34 unsigned char rotleft8(unsigned char x
, unsigned char y
) {
35 return __builtin_rotateleft8(x
, y
);
38 // CHECK: define{{.*}} i8 @rotleft8
39 // CHECK: i8 @llvm.fshl.i8(i8
41 unsigned int rotleft16(unsigned int x
, unsigned int y
) {
42 return __builtin_rotateleft16(x
, y
);
45 // CHECK: define{{.*}} i16 @rotleft16
46 // CHECK: i16 @llvm.fshl.i16(i16
48 unsigned long rotleft32(unsigned long x
, unsigned long y
) {
49 return __builtin_rotateleft32(x
, y
);
51 // CHECK: define{{.*}} i32 @rotleft32
52 // CHECK: i32 @llvm.fshl.i32(i32
54 unsigned long long rotleft64(unsigned long long x
, unsigned long long y
) {
55 return __builtin_rotateleft64(x
, y
);
58 // CHECK: define{{.*}} i64 @rotleft64
59 // CHECK: i64 @llvm.fshl.i64(i64
61 unsigned char rotright8(unsigned char x
, unsigned char y
) {
62 return __builtin_rotateright8(x
, y
);
65 // CHECK: define{{.*}} i8 @rotright8
66 // CHECK: i8 @llvm.fshr.i8(i8
68 unsigned int rotright16(unsigned int x
, unsigned int y
) {
69 return __builtin_rotateright16(x
, y
);
72 // CHECK: define{{.*}} i16 @rotright16
73 // CHECK: i16 @llvm.fshr.i16(i16
75 unsigned long rotright32(unsigned long x
, unsigned long y
) {
76 return __builtin_rotateright32(x
, y
);
78 // CHECK: define{{.*}} i32 @rotright32
79 // CHECK: i32 @llvm.fshr.i32(i32
81 unsigned long long rotright64(unsigned long long x
, unsigned long long y
) {
82 return __builtin_rotateright64(x
, y
);
85 // CHECK: define{{.*}} i64 @rotright64
86 // CHECK: i64 @llvm.fshr.i64(i64
88 unsigned int byteswap16(unsigned int x
) {
89 return __builtin_bswap16(x
);
92 // CHECK: define{{.*}} i16 @byteswap16
93 // CHECK: i16 @llvm.bswap.i16(i16
95 unsigned long byteswap32(unsigned long x
) {
96 return __builtin_bswap32(x
);
98 // CHECK: define{{.*}} i32 @byteswap32
99 // CHECK: i32 @llvm.bswap.i32(i32
101 unsigned long long byteswap64(unsigned long long x
) {
102 return __builtin_bswap64(x
);
105 // CHECK: define{{.*}} i64 @byteswap64
106 // CHECK: i64 @llvm.bswap.i64(i64
108 double powi(double x
, int y
) {
109 return __builtin_powi(x
, y
);
112 // CHECK: define{{.*}} float @powi
113 // CHECK: float @llvm.powi.f32.i16(float %0, i16 %1)
115 float powif(float x
, int y
) {
116 return __builtin_powif(x
, y
);
119 // CHECK: define{{.*}} float @powif
120 // CHECK: float @llvm.powi.f32.i16(float %0, i16 %1)
122 long double powil(long double x
, int y
) {
123 return __builtin_powil(x
, y
);
126 // CHECK: define{{.*}} float @powil
127 // CHECK: float @llvm.powi.f32.i16(float %0, i16 %1)