]> granicus.if.org Git - clang/commitdiff
[ASTImporter] Actually test ArrayInitLoopExpr in the array-init-loop-expr test.
authorRaphael Isemann <teemperor@gmail.com>
Wed, 22 Aug 2018 22:50:45 +0000 (22:50 +0000)
committerRaphael Isemann <teemperor@gmail.com>
Wed, 22 Aug 2018 22:50:45 +0000 (22:50 +0000)
Summary:
The `array-init-loop-expr` test is currently not testing the importing of ArrayInitLoopExprs.

This is because we import the `S` struct into the `test.cpp` context
and only do a copy-assignment in `test.cpp`, so the actual ArrayInitLoopExpr we wanted to
import is generated by clang directly in the target context. This means we actually
never test the importing of ArrayInitLoopExpr with this test, which becomes obvious
when looking at the missing test coverage for the respective  VisitArrayInitLoopExpr method.

This patch moves the copy-assignment of our struct to the `S.cpp` context, which means
that `test.cpp` now actually has to import the ArrayInitLoopExpr.

Reviewers: a.sidorin, a_sidorin

Reviewed By: a_sidorin

Subscribers: a_sidorin, martong, cfe-commits

Differential Revision: https://reviews.llvm.org/D51115

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340467 91177308-0d34-0410-b5e6-96231b3b80d8

test/Import/array-init-loop-expr/Inputs/S.cpp
test/Import/array-init-loop-expr/test.cpp

index bf80439834b8007178fa4ed123dc2b17da9f6db4..5ca3ad47b278ff993cccdb8be090e602c43cc17a 100644 (file)
@@ -1,3 +1,8 @@
 class S {
   int a[10];
 };
+
+void f() {
+  S s;
+  S copy = s;
+}
index ac12ecc0361c1cced802aa4ab47d0e9044c24584..7fe109c305ddd95c6e82a74f275d2c70ff012aa6 100644 (file)
@@ -6,6 +6,5 @@
 // CHECK: ArrayInitIndexExpr
 
 void expr() {
-  S s;
-  S copy = s;
+  f();
 }