teemperor created this revision. Herald added subscribers: cfe-commits, martong. Herald added a reviewer: a.sidorin.
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. Repository: rC Clang https://reviews.llvm.org/D51115 Files: test/Import/array-init-loop-expr/Inputs/S.cpp test/Import/array-init-loop-expr/test.cpp Index: test/Import/array-init-loop-expr/test.cpp =================================================================== --- test/Import/array-init-loop-expr/test.cpp +++ test/Import/array-init-loop-expr/test.cpp @@ -6,6 +6,5 @@ // CHECK: ArrayInitIndexExpr void expr() { - S s; - S copy = s; + f(); } Index: test/Import/array-init-loop-expr/Inputs/S.cpp =================================================================== --- test/Import/array-init-loop-expr/Inputs/S.cpp +++ test/Import/array-init-loop-expr/Inputs/S.cpp @@ -1,3 +1,8 @@ class S { int a[10]; }; + +void f() { + S s; + S copy = s; +}
Index: test/Import/array-init-loop-expr/test.cpp =================================================================== --- test/Import/array-init-loop-expr/test.cpp +++ test/Import/array-init-loop-expr/test.cpp @@ -6,6 +6,5 @@ // CHECK: ArrayInitIndexExpr void expr() { - S s; - S copy = s; + f(); } Index: test/Import/array-init-loop-expr/Inputs/S.cpp =================================================================== --- test/Import/array-init-loop-expr/Inputs/S.cpp +++ test/Import/array-init-loop-expr/Inputs/S.cpp @@ -1,3 +1,8 @@ class S { int a[10]; }; + +void f() { + S s; + S copy = s; +}
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits