Skip to content

[NFC][analyzer][test][z3] Move test cases requiring Z3 to the Analysis/z3/ subdirectory#183724

Merged
steakhal merged 1 commit intollvm:mainfrom
Snape3058:issue-181581-2
Mar 2, 2026
Merged

[NFC][analyzer][test][z3] Move test cases requiring Z3 to the Analysis/z3/ subdirectory#183724
steakhal merged 1 commit intollvm:mainfrom
Snape3058:issue-181581-2

Conversation

@Snape3058
Copy link
Member

Addressing #181581, continuing #183034

This enables executing all test cases with the REQUIRES: z3 tag via the check-clang-analysis-z3 target.

…is/z3/` subdirectory

Addressing llvm#181581, continuing llvm#183034

This enables executing all test cases with the `REQUIRES: z3` tag via the
`check-clang-analysis-z3` target.
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:static analyzer labels Feb 27, 2026
@llvmbot
Copy link
Member

llvmbot commented Feb 27, 2026

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clang-static-analyzer-1

Author: Ella Ma (Snape3058)

Changes

Addressing #181581, continuing #183034

This enables executing all test cases with the REQUIRES: z3 tag via the check-clang-analysis-z3 target.


Full diff: https://github.com/llvm/llvm-project/pull/183724.diff

8 Files Affected:

  • (renamed) clang/test/Analysis/z3/PR37855.c ()
  • (renamed) clang/test/Analysis/z3/bitint-z3.c ()
  • (renamed) clang/test/Analysis/z3/cstring-addrspace.c ()
  • (renamed) clang/test/Analysis/z3/unary-sym-expr-z3-refutation.c ()
  • (renamed) clang/test/Analysis/z3/z3-crosscheck-max-attempts.cpp ()
  • (renamed) clang/test/Analysis/z3/z3-crosscheck.c (+1-1)
  • (renamed) clang/test/Analysis/z3/z3-refute-enum-crash.cpp ()
  • (renamed) clang/test/Analysis/z3/z3-unarysymexpr.c ()
diff --git a/clang/test/Analysis/PR37855.c b/clang/test/Analysis/z3/PR37855.c
similarity index 100%
rename from clang/test/Analysis/PR37855.c
rename to clang/test/Analysis/z3/PR37855.c
diff --git a/clang/test/Analysis/bitint-z3.c b/clang/test/Analysis/z3/bitint-z3.c
similarity index 100%
rename from clang/test/Analysis/bitint-z3.c
rename to clang/test/Analysis/z3/bitint-z3.c
diff --git a/clang/test/Analysis/cstring-addrspace.c b/clang/test/Analysis/z3/cstring-addrspace.c
similarity index 100%
rename from clang/test/Analysis/cstring-addrspace.c
rename to clang/test/Analysis/z3/cstring-addrspace.c
diff --git a/clang/test/Analysis/unary-sym-expr-z3-refutation.c b/clang/test/Analysis/z3/unary-sym-expr-z3-refutation.c
similarity index 100%
rename from clang/test/Analysis/unary-sym-expr-z3-refutation.c
rename to clang/test/Analysis/z3/unary-sym-expr-z3-refutation.c
diff --git a/clang/test/Analysis/z3-crosscheck-max-attempts.cpp b/clang/test/Analysis/z3/z3-crosscheck-max-attempts.cpp
similarity index 100%
rename from clang/test/Analysis/z3-crosscheck-max-attempts.cpp
rename to clang/test/Analysis/z3/z3-crosscheck-max-attempts.cpp
diff --git a/clang/test/Analysis/z3-crosscheck.c b/clang/test/Analysis/z3/z3-crosscheck.c
similarity index 99%
rename from clang/test/Analysis/z3-crosscheck.c
rename to clang/test/Analysis/z3/z3-crosscheck.c
index 8cbe7dd2975d0..41ecaee5529e0 100644
--- a/clang/test/Analysis/z3-crosscheck.c
+++ b/clang/test/Analysis/z3/z3-crosscheck.c
@@ -4,7 +4,7 @@
 
 void clang_analyzer_dump(float);
 
-int foo(int x) 
+int foo(int x)
 {
   int *z = 0;
   if ((x & 1) && ((x & 1) ^ 1))
diff --git a/clang/test/Analysis/z3-refute-enum-crash.cpp b/clang/test/Analysis/z3/z3-refute-enum-crash.cpp
similarity index 100%
rename from clang/test/Analysis/z3-refute-enum-crash.cpp
rename to clang/test/Analysis/z3/z3-refute-enum-crash.cpp
diff --git a/clang/test/Analysis/z3-unarysymexpr.c b/clang/test/Analysis/z3/z3-unarysymexpr.c
similarity index 100%
rename from clang/test/Analysis/z3-unarysymexpr.c
rename to clang/test/Analysis/z3/z3-unarysymexpr.c

@Snape3058
Copy link
Member Author

Are the files on the list correct?

Besides, when I was working on this PR, I found that missing-z3-nocrash.c declares REQUIRES: no-z3, while print-ranges.cpp and PR24184.cpp declare UNSUPPORTED: z3. What are their differences?

@steakhal
Copy link
Contributor

This enables executing all test cases with the REQUIRES: z3 tag via the check-clang-analysis-z3 target.

I like the move, but I didn't get what you are saying here. Where is the logic adding the check-clang-analysis-z3 target and how are the tests skipped under that directory if the REQUIRES: z3 is not satisfied?

@steakhal
Copy link
Contributor

Are the files on the list correct?

Besides, when I was working on this PR, I found that missing-z3-nocrash.c declares REQUIRES: no-z3

So these properties that REQUIRES can check against are defined as the available_features inside clang/test/lit.cfg.py. You can look for z3 there. And I guess, it should add the no-z3 if it's not present (and it actually does!).

We can move the missing-z3-nocrash.c under the z3 directory.

[...] while print-ranges.cpp and PR24184.cpp declare UNSUPPORTED: z3. What are their differences?

AFAIK nothing. They are practically the same.
You should probably drop the no-z3 logic and use UNSUPPORTED: z3 instead. Nice catch.

@Snape3058
Copy link
Member Author

This enables executing all test cases with the REQUIRES: z3 tag via the check-clang-analysis-z3 target.

I like the move, but I didn't get what you are saying here. Where is the logic adding the check-clang-analysis-z3 target and how are the tests skipped under that directory if the REQUIRES: z3 is not satisfied?

The check-clang-analysis-z3 target already exists (automatically added for subdirectories by function add_lit_testsuites in llvm/cmake/modules/AddLLVM.cmake), but it will only execute the tests in the Analysis/z3/ subdirectory. With this move, all z3-related tests can be run directly with this target.

We can move the missing-z3-nocrash.c under the z3 directory.

The explanation above is also why I did not move this file: when building the check-clang-analysis-z3 target, it will always get skipped as 'UNSUPPORTED'.
Or, do you mean the check-clang-analysis-z3 target can also be used to check the UNSUPPORTED: z3 tests when Z3 is disabled? This is also reasonable to me. If so, should I also move the other two, i.e., print-ranges.cpp and PR24184.cpp?

You should probably drop the no-z3 logic and use UNSUPPORTED: z3 instead. Nice catch.

I will do this for missing-z3-nocrash.c. But together with removing the no-z3 feature in clang/test/lit.cfg.py?

@steakhal
Copy link
Contributor

This enables executing all test cases with the REQUIRES: z3 tag via the check-clang-analysis-z3 target.

I like the move, but I didn't get what you are saying here. Where is the logic adding the check-clang-analysis-z3 target and how are the tests skipped under that directory if the REQUIRES: z3 is not satisfied?

The check-clang-analysis-z3 target already exists (automatically added for subdirectories by function add_lit_testsuites in llvm/cmake/modules/AddLLVM.cmake), but it will only execute the tests in the Analysis/z3/ subdirectory. With this move, all z3-related tests can be run directly with this target.

We can move the missing-z3-nocrash.c under the z3 directory.

The explanation above is also why I did not move this file: when building the check-clang-analysis-z3 target, it will always get skipped as 'UNSUPPORTED'. Or, do you mean the check-clang-analysis-z3 target can also be used to check the UNSUPPORTED: z3 tests when Z3 is disabled? This is also reasonable to me. If so, should I also move the other two, i.e., print-ranges.cpp and PR24184.cpp?

You should probably drop the no-z3 logic and use UNSUPPORTED: z3 instead. Nice catch.

I will do this for missing-z3-nocrash.c. But together with removing the no-z3 feature in clang/test/lit.cfg.py?

I didn't know about this build target. I think your judgment and decisions are correct and makes sense.

@steakhal
Copy link
Contributor

You should probably drop the no-z3 logic and use UNSUPPORTED: z3 instead. Nice catch.

I will do this for missing-z3-nocrash.c. But together with removing the no-z3 feature in clang/test/lit.cfg.py?

Makes sense to do it separately, yes.

Copy link
Contributor

steakhal commented Mar 2, 2026

I believe you have commit access, right?

@Snape3058
Copy link
Member Author

@steakhal, I resigned from that list last year. Maybe I should apply for it again.

@steakhal
Copy link
Contributor

steakhal commented Mar 2, 2026

@steakhal, I resigned from that list last year. Maybe I should apply for it again.

I'm looking for you coming back one day :)
I'll merge this then.

@steakhal steakhal merged commit 88693c4 into llvm:main Mar 2, 2026
13 checks passed
Snape3058 added a commit to Snape3058/llvm-patch-revision that referenced this pull request Mar 3, 2026
…: z3"

Fixing D120325, continuing llvm#183724

Lit feature "no-z3" is the opposite of "z3", requiring "no-z3" is the
same as unsupporting "z3".
nasherm pushed a commit to nasherm/llvm-project that referenced this pull request Mar 3, 2026
…is/z3/` subdirectory (llvm#183724)

Addressing llvm#181581, continuing llvm#183034

This enables executing all test cases with the `REQUIRES: z3` tag via
the `check-clang-analysis-z3` target.
steakhal pushed a commit that referenced this pull request Mar 4, 2026
…: z3" (#184349)

Fixing D120325, continuing #183724

Lit feature "no-z3" is the opposite of "z3", requiring "no-z3" is the
same as unsupporting "z3".
sahas3 pushed a commit to sahas3/llvm-project that referenced this pull request Mar 4, 2026
…is/z3/` subdirectory (llvm#183724)

Addressing llvm#181581, continuing llvm#183034

This enables executing all test cases with the `REQUIRES: z3` tag via
the `check-clang-analysis-z3` target.
sahas3 pushed a commit to sahas3/llvm-project that referenced this pull request Mar 4, 2026
…: z3" (llvm#184349)

Fixing D120325, continuing llvm#183724

Lit feature "no-z3" is the opposite of "z3", requiring "no-z3" is the
same as unsupporting "z3".
sujianIBM pushed a commit to sujianIBM/llvm-project that referenced this pull request Mar 5, 2026
…is/z3/` subdirectory (llvm#183724)

Addressing llvm#181581, continuing llvm#183034

This enables executing all test cases with the `REQUIRES: z3` tag via
the `check-clang-analysis-z3` target.
sujianIBM pushed a commit to sujianIBM/llvm-project that referenced this pull request Mar 5, 2026
…: z3" (llvm#184349)

Fixing D120325, continuing llvm#183724

Lit feature "no-z3" is the opposite of "z3", requiring "no-z3" is the
same as unsupporting "z3".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:static analyzer clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants