Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / Index / binop.cpp
blob576fd73cc2abfe7495fdc52a65206969c2fe14ac
1 // RUN: c-index-test -test-print-binops %s | FileCheck %s
3 struct C {
4 int m;
5 };
7 void func(void) {
8 #pragma clang diagnostic push
9 #pragma clang diagnostic ignored "-Wunused-value"
10 int a, b;
11 int C::*p = &C::m;
13 C c;
14 c.*p;
16 C *pc;
17 pc->*p;
19 a *b;
20 a / b;
21 a % b;
22 a + b;
23 a - b;
25 a << b;
26 a >> b;
28 a < b;
29 a > b;
31 a <= b;
32 a >= b;
33 a == b;
34 a != b;
36 a &b;
37 a ^ b;
38 a | b;
40 a &&b;
41 a || b;
43 a = b;
45 a *= b;
46 a /= b;
47 a %= b;
48 a += b;
49 a -= b;
51 a <<= b;
52 a >>= b;
54 a &= b;
55 a ^= b;
56 a |= b;
57 a, b;
58 #pragma clang diagnostic pop
61 // CHECK: BinaryOperator=.* BinOp=.* 1
62 // CHECK: BinaryOperator=->* BinOp=->* 2
63 // CHECK: BinaryOperator=* BinOp=* 3
64 // CHECK: BinaryOperator=/ BinOp=/ 4
65 // CHECK: BinaryOperator=% BinOp=% 5
66 // CHECK: BinaryOperator=+ BinOp=+ 6
67 // CHECK: BinaryOperator=- BinOp=- 7
68 // CHECK: BinaryOperator=<< BinOp=<< 8
69 // CHECK: BinaryOperator=>> BinOp=>> 9
70 // CHECK: BinaryOperator=< BinOp=< 11
71 // CHECK: BinaryOperator=> BinOp=> 12
72 // CHECK: BinaryOperator=<= BinOp=<= 13
73 // CHECK: BinaryOperator=>= BinOp=>= 14
74 // CHECK: BinaryOperator=== BinOp=== 15
75 // CHECK: BinaryOperator=!= BinOp=!= 16
76 // CHECK: BinaryOperator=& BinOp=& 17
77 // CHECK: BinaryOperator=^ BinOp=^ 18
78 // CHECK: BinaryOperator=| BinOp=| 19
79 // CHECK: BinaryOperator=&& BinOp=&& 20
80 // CHECK: BinaryOperator=|| BinOp=|| 21
81 // CHECK: BinaryOperator== BinOp== 22
82 // CHECK: CompoundAssignOperator=*= BinOp=*= 23
83 // CHECK: CompoundAssignOperator=/= BinOp=/= 24
84 // CHECK: CompoundAssignOperator=%= BinOp=%= 25
85 // CHECK: CompoundAssignOperator=+= BinOp=+= 26
86 // CHECK: CompoundAssignOperator=-= BinOp=-= 27
87 // CHECK: CompoundAssignOperator=<<= BinOp=<<= 28
88 // CHECK: CompoundAssignOperator=>>= BinOp=>>= 29
89 // CHECK: CompoundAssignOperator=&= BinOp=&= 30
90 // CHECK: CompoundAssignOperator=^= BinOp=^= 31
91 // CHECK: CompoundAssignOperator=|= BinOp=|= 32
92 // CHECK: BinaryOperator=, BinOp=, 33