Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clean up tests without calls to clang #348

Merged

Conversation

kyleheadley
Copy link
Member

I added calls to clang in tests returned by grep -L "clang" *, or an explanation of why it cannot be done at this time. I also removed some dashes as requested in #346 while there, and removed commented lines in lit.local.cfg since they referred to a private file system. Post-merge tests were run on my local Mac.

There were some files that I did not (yet) change:

  • lowerboundBUG.c & lowerbound.c
    • these are identical and don't fail as indicated by comments inside
  • basic_local_ntarr.c
    • variable c is commented as different from the test script, and bounds don't match
  • basic_inter_field_ntarr.c
    • clang complains about an incompatible type

@kyleheadley
Copy link
Member Author

I needed to reorder some statements in arrboundsadvanced.c because FL was declared before FooLen which was used in its itype. Is this a change our users will need to do manually or is it an error that needs its own issue?

@mwhicks1
Copy link
Member

mwhicks1 commented Dec 9, 2020

I needed to reorder some statements in arrboundsadvanced.c because FL was declared before FooLen which was used in its itype. Is this a change our users will need to do manually or is it an error that needs its own issue?

Yes, users will have to make this change manually. It's a "feature" of 3C to infer the length even for variables that are defined in the wrong order. Fine to move them in this case.

@mwhicks1
Copy link
Member

mwhicks1 commented Dec 9, 2020

There were some files that I did not (yet) change:

  • lowerboundBUG.c & lowerbound.c

    • these are identical and don't fail as indicated by comments inside

We should delete lowerboundBUG.c and if the test is expected to failure, we can include it in the expected failures list (is that the case already?).

  • basic_local_ntarr.c

    • variable c is commented as different from the test script, and bounds don't match

Is this another test that we are expecting to fail?

  • basic_inter_field_ntarr.c

    • clang complains about an incompatible type

Same question? Perhaps make an issue for addressing/fixing these tests.

@@ -1,4 +1,5 @@
// RUN: 3c -alltypes %s -- | FileCheck -match-full-lines --check-prefixes="CHECK" %s
// RUN: 3c -alltypes %s | FileCheck -match-full-lines --check-prefixes="CHECK" %s
// RUN: 3c -alltypes %s | %clang -c -f3c-tool -fcheckedc-extension -x c -o /dev/null -
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we discussed dropping use of /dev/null entirely and using %t instead? Doing so is to enhance Windows compatibility. This way, we would be indicating this is a temp file, it will get removed by FileCheck automatically, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't realize it was more than a bugfix when piping on windows. But this seems reasonable. I'll change it and add it to the other list of test changes.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think /dev/null is a problem here. llvm-lit is supposed to automatically substitute temp files for /dev/null on Windows, but was not doing this correctly when dealing with pipes and io redirection.

// RUN: 3c -addcr %s | FileCheck -match-full-lines --check-prefixes="CHECK" %s

// Currently not running clang on the output,
// since it cannot find "dummy.h", even with -L%S
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no dummy.h in the test directory? If that's right, I think we should delete its usage.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a dummy.h in the test directory, required for the test as it is. I couldn't get clang to recognize it from the testing harness.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's a problem then we should just get rid of it. I don't see the benefit of having it when you can just inline its contents in the test.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed it

Copy link
Member

@mwhicks1 mwhicks1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question and comment; might require small changes.

@mattmccutchen-cci mattmccutchen-cci changed the title add clang call in tests add clang call in tests (and more) Dec 10, 2020
@mattmccutchen-cci
Copy link
Member

@kyleheadley I hope you're OK with me editing your PR title so people aren't misled that it only adds clang calls. Feel free to edit it further.

@mattmccutchen-cci
Copy link
Member

@kyleheadley Please follow these instructions to ensure that all your future commits for CCI get your CCI email address.

If it were me, I would go ahead and fix this PR branch too via the "Using Interactive Rebase" method here and a force-push, but since the default branch already has a few commits from you with the other email address and it's impractical to do anything about them now, I don't feel strongly about adding a few more.

@kyleheadley kyleheadley changed the title add clang call in tests (and more) clean up tests without calls to clang Dec 10, 2020
@kyleheadley
Copy link
Member Author

after using -f3c-tool, the files I highlighted above compile. The reasons were to do with array bounds, though not directly, and they were older tests, so I've rolled them into the rest and dealt with them.

I also updated for the recent comments here and changes in #346. This is ready for review again.

@@ -1,5 +1,5 @@
// RUN: 3c -alltypes %s | FileCheck -match-full-lines --check-prefixes="CHECK" %s
// RUN: 3c -alltypes %s | %clang -c -f3c-tool -fcheckedc-extension -x c -o /dev/null -
// RUN: 3c -alltypes %s | %clang -c -f3c-tool -fcheckedc-extension -x c -o %t1.unused -
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need the .unused bit at the end? I presume you've confirmed that this file is deleted after all the tests are run?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't need it, but I wanted an indication of what this particular temp file is used for.

Copy link
Member

@mwhicks1 mwhicks1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Merge when ready (be sure to use your correctcomputation.com address).

@kyleheadley kyleheadley merged commit 531e239 into correctcomputation:master-post-microsoft Dec 16, 2020
@kyleheadley kyleheadley deleted the addclang branch December 16, 2020 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants