1 | // RUN: %check_clang_tidy %s performance-no-int-to-ptr %t -- -- -Wno-int-conversion |
2 | |
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 | } |
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 | } |
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 | |
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 | } |
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 | } |
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 | |
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 | } |
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 | } |
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 | |
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 | } |
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 | } |
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 | |
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 | } |
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 | } |
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 | |