1 // RUN: %check_clang_tidy %s performance-no-int-to-ptr %t
2
t0(char x)3 void *t0(char x) {
4 return x;
5 // CHECK-MESSAGES: [[@LINE-1]]:10: warning: integer to pointer cast pessimizes optimization opportunities [performance-no-int-to-ptr]
6 }
t1(signed char x)7 void *t1(signed char x) {
8 return x;
9 // CHECK-MESSAGES: [[@LINE-1]]:10: warning: integer to pointer cast pessimizes optimization opportunities [performance-no-int-to-ptr]
10 }
t2(unsigned char x)11 void *t2(unsigned char x) {
12 return x;
13 // CHECK-MESSAGES: [[@LINE-1]]:10: warning: integer to pointer cast pessimizes optimization opportunities [performance-no-int-to-ptr]
14 }
15
t3(short x)16 void *t3(short x) {
17 return x;
18 // CHECK-MESSAGES: [[@LINE-1]]:10: warning: integer to pointer cast pessimizes optimization opportunities [performance-no-int-to-ptr]
19 }
t4(unsigned short x)20 void *t4(unsigned short x) {
21 return x;
22 // CHECK-MESSAGES: [[@LINE-1]]:10: warning: integer to pointer cast pessimizes optimization opportunities [performance-no-int-to-ptr]
23 }
t5(signed short x)24 void *t5(signed short x) {
25 return x;
26 // CHECK-MESSAGES: [[@LINE-1]]:10: warning: integer to pointer cast pessimizes optimization opportunities [performance-no-int-to-ptr]
27 }
28
t6(int x)29 void *t6(int x) {
30 return x;
31 // CHECK-MESSAGES: [[@LINE-1]]:10: warning: integer to pointer cast pessimizes optimization opportunities [performance-no-int-to-ptr]
32 }
t7(unsigned int x)33 void *t7(unsigned int x) {
34 return x;
35 // CHECK-MESSAGES: [[@LINE-1]]:10: warning: integer to pointer cast pessimizes optimization opportunities [performance-no-int-to-ptr]
36 }
t8(signed int x)37 void *t8(signed int x) {
38 return x;
39 // CHECK-MESSAGES: [[@LINE-1]]:10: warning: integer to pointer cast pessimizes optimization opportunities [performance-no-int-to-ptr]
40 }
41
t9(long x)42 void *t9(long x) {
43 return x;
44 // CHECK-MESSAGES: [[@LINE-1]]:10: warning: integer to pointer cast pessimizes optimization opportunities [performance-no-int-to-ptr]
45 }
t10(unsigned long x)46 void *t10(unsigned long x) {
47 return x;
48 // CHECK-MESSAGES: [[@LINE-1]]:10: warning: integer to pointer cast pessimizes optimization opportunities [performance-no-int-to-ptr]
49 }
t11(signed long x)50 void *t11(signed long x) {
51 return x;
52 // CHECK-MESSAGES: [[@LINE-1]]:10: warning: integer to pointer cast pessimizes optimization opportunities [performance-no-int-to-ptr]
53 }
54
t12(long long x)55 void *t12(long long x) {
56 return x;
57 // CHECK-MESSAGES: [[@LINE-1]]:10: warning: integer to pointer cast pessimizes optimization opportunities [performance-no-int-to-ptr]
58 }
t13(unsigned long long x)59 void *t13(unsigned long long x) {
60 return x;
61 // CHECK-MESSAGES: [[@LINE-1]]:10: warning: integer to pointer cast pessimizes optimization opportunities [performance-no-int-to-ptr]
62 }
t14(signed long long x)63 void *t14(signed long long x) {
64 return x;
65 // CHECK-MESSAGES: [[@LINE-1]]:10: warning: integer to pointer cast pessimizes optimization opportunities [performance-no-int-to-ptr]
66 }
67