clangupc / clang-upc

Clang UPC Front-End
https://clangupc.github.io/
Other
16 stars 5 forks source link

Clang test RecursiveASTVisitorTest.cpp failure #34

Closed nenadv closed 10 years ago

nenadv commented 10 years ago

The following test produces an error:

TEST(RecursiveASTVisitor, VisitsCompoundLiteralType) {                          
  TypeLocVisitor Visitor;                                                       
  Visitor.ExpectMatch("struct S", 1, 26);                                       
  EXPECT_TRUE(Visitor.runOver(                                                  
      "int f() { return (struct S { int a; }){.a = 0}.a; }",                    
      TypeLocVisitor::Lang_C));                                                 
}

I think this is the reported error:

error: invalid argument '-std=c99' not allowed with 'C++/ObjC++'

nenadv commented 10 years ago

gary-funck added the following under upc2c issue:

After running tests against a recent head revision, seeing this test failure:

[ RUN      ] RecursiveASTVisitor.VisitsCompoundLiteralType
error: invalid argument '-std=c99' not allowed with 'C++/ObjC++'
/eng/upc/dev/gary/clang/src/llvm/tools/clang/unittests/Tooling/RecursiveASTVisi
torTest.cpp:530: Failure
Value of: Visitor.runOver( "int f() { return (struct S { int a; }){.a = 0}.a; }
", TypeLocVisitor::Lang_C)
  Actual: false
Expected: true
/eng/upc/dev/gary/clang/src/llvm/tools/clang/unittests/Tooling/TestVisitor.h:20
5: Failure
Value of: Found
  Actual: false
Expected: true
Expected "struct S" at 1:26
[  FAILED  ] RecursiveASTVisitor.VisitsCompoundLiteralType (3 ms)

Ran bisect on this and came up with the following commit which triggers the failure: https://github.com/Intrepid/clang-upc/commit/a8b05615807e6b3f88631b88e59d1484b6f5f5eb

Steps to reproduce:

cd bld/tools/clang
make -j >& make.log
make -C unittests/Tooling ToolingTests >& make-test.log
unittests/Tooling/ToolingTests >& test.log
swatanabe commented 10 years ago

On 02/26/2014 11:41 AM, Nenad Vukicevic wrote:

[ RUN      ] RecursiveASTVisitor.VisitsCompoundLiteralType
error: invalid argument '-std=c99' not allowed with 'C++/ObjC++'
/eng/upc/dev/gary/clang/src/llvm/tools/clang/unittests/Tooling/RecursiveASTVisi
torTest.cpp:530: Failure
Value of: Visitor.runOver( "int f() { return (struct S { int a; }){.a = 0}.a; }
", TypeLocVisitor::Lang_C)

This looks like a bug in the test case, which was exposed by my fix. (Previously errors in command line arguments were ignored.)