r339918 - [ASTImporter] Add test for importing CompoundAssignOperators
Raphael Isemann via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 16 11:21:33 PDT 2018
Author: teemperor
Date: Thu Aug 16 11:21:33 2018
New Revision: 339918
URL: http://llvm.org/viewvc/llvm-project?rev=339918&view=rev
Log:
[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
Added:
cfe/trunk/test/Import/compound-assign-op/
cfe/trunk/test/Import/compound-assign-op/Inputs/
cfe/trunk/test/Import/compound-assign-op/Inputs/F.cpp
cfe/trunk/test/Import/compound-assign-op/test.cpp
Added: cfe/trunk/test/Import/compound-assign-op/Inputs/F.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Import/compound-assign-op/Inputs/F.cpp?rev=339918&view=auto
==============================================================================
--- cfe/trunk/test/Import/compound-assign-op/Inputs/F.cpp (added)
+++ cfe/trunk/test/Import/compound-assign-op/Inputs/F.cpp Thu Aug 16 11:21:33 2018
@@ -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;
+}
Added: cfe/trunk/test/Import/compound-assign-op/test.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Import/compound-assign-op/test.cpp?rev=339918&view=auto
==============================================================================
--- cfe/trunk/test/Import/compound-assign-op/test.cpp (added)
+++ cfe/trunk/test/Import/compound-assign-op/test.cpp Thu Aug 16 11:21:33 2018
@@ -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();
+}
More information about the cfe-commits
mailing list