[PATCH] D50793: [ASTImporter] Add test for importing CompoundAssignOperators
Raphael Isemann via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 16 11:22:22 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL339918: [ASTImporter] Add test for importing CompoundAssignOperators (authored by teemperor, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D50793?vs=160862&id=161076#toc
Repository:
rL LLVM
https://reviews.llvm.org/D50793
Files:
cfe/trunk/test/Import/compound-assign-op/Inputs/F.cpp
cfe/trunk/test/Import/compound-assign-op/test.cpp
Index: cfe/trunk/test/Import/compound-assign-op/Inputs/F.cpp
===================================================================
--- cfe/trunk/test/Import/compound-assign-op/Inputs/F.cpp
+++ cfe/trunk/test/Import/compound-assign-op/Inputs/F.cpp
@@ -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;
+}
Index: cfe/trunk/test/Import/compound-assign-op/test.cpp
===================================================================
--- cfe/trunk/test/Import/compound-assign-op/test.cpp
+++ cfe/trunk/test/Import/compound-assign-op/test.cpp
@@ -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();
+}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50793.161076.patch
Type: text/x-patch
Size: 1842 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180816/b0887e93/attachment-0001.bin>
More information about the cfe-commits
mailing list