forked from OSchip/llvm-project
[ASTImporter] Add test for importing CompoundAssignOperators
Reviewers: a.sidorin, martong Reviewed By: martong Subscribers: rnkovacs, cfe-commits, martong Differential Revision: https://reviews.llvm.org/D50793 llvm-svn: 339918
This commit is contained in:
parent
5fd7f152c8
commit
5440fee09f
|
@ -0,0 +1,18 @@
|
|||
void f() {
|
||||
unsigned iadd_eq = 0U;
|
||||
iadd_eq += 1U;
|
||||
unsigned isub_eq = 0U;
|
||||
isub_eq -= 1U;
|
||||
unsigned imul_eq = 0U;
|
||||
imul_eq *= 1U;
|
||||
unsigned idiv_eq = 0U;
|
||||
idiv_eq /= 1U;
|
||||
unsigned iand_eq = 0U;
|
||||
iand_eq &= 1U;
|
||||
unsigned ixor_eq = 0U;
|
||||
ixor_eq ^= 1U;
|
||||
unsigned ilsh_eq = 0U;
|
||||
ilsh_eq <<= 1U;
|
||||
unsigned irsh_eq = 0U;
|
||||
irsh_eq >>= 1U;
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
// RUN: clang-import-test -dump-ast -import %S/Inputs/F.cpp -expression %s | FileCheck %s
|
||||
|
||||
// CHECK: VarDecl
|
||||
// CHECK-NEXT: Integer
|
||||
// CHECK-NEXT: CompoundAssignOperator
|
||||
// CHECK-SAME: '+='
|
||||
|
||||
// CHECK: VarDecl
|
||||
// CHECK-NEXT: Integer
|
||||
// CHECK-NEXT: CompoundAssignOperator
|
||||
// CHECK-SAME: '-='
|
||||
|
||||
// CHECK: VarDecl
|
||||
// CHECK-NEXT: Integer
|
||||
// CHECK-NEXT: CompoundAssignOperator
|
||||
// CHECK-SAME: '*='
|
||||
|
||||
// CHECK: VarDecl
|
||||
// CHECK-NEXT: Integer
|
||||
// CHECK-NEXT: CompoundAssignOperator
|
||||
// CHECK-SAME: '/='
|
||||
|
||||
// CHECK: VarDecl
|
||||
// CHECK-NEXT: Integer
|
||||
// CHECK-NEXT: CompoundAssignOperator
|
||||
// CHECK-SAME: '&='
|
||||
|
||||
// CHECK: VarDecl
|
||||
// CHECK-NEXT: Integer
|
||||
// CHECK-NEXT: CompoundAssignOperator
|
||||
// CHECK-SAME: '^='
|
||||
|
||||
// CHECK: VarDecl
|
||||
// CHECK-NEXT: Integer
|
||||
// CHECK-NEXT: CompoundAssignOperator
|
||||
// CHECK-SAME: '<<='
|
||||
|
||||
// CHECK: VarDecl
|
||||
// CHECK-NEXT: Integer
|
||||
// CHECK-NEXT: CompoundAssignOperator
|
||||
// CHECK-SAME: '>>='
|
||||
|
||||
void expr() {
|
||||
f();
|
||||
}
|
Loading…
Reference in New Issue