Skip to content

Commit

Permalink
add a test case of infinite looping on 'static_cast<foo>(::bar)'
Browse files Browse the repository at this point in the history
This test cases passes with LLVM 14 and 15, and fails with LLVM 18 and 19,
though I am not sure what the exact failure condition is.

Github: #269 “handle libclang looping”
  • Loading branch information
Smattr committed Dec 12, 2024
1 parent c2fb9a5 commit 137b636
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions test/cases/global-qualified.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/// does static cast of a globally qualified thing cause an infinite loop?

void baz() { static_cast<foo>(::bar); }

// XFAIL: version.parse(os.environ["LLVM_VERSION"]) >= version.parse("16.0.0")
// RUN: {%timeout} 5s env ASAN_OPTIONS=detect_leaks=0 clink --build-only --database={%t} --debug --parse-c=clang --parse-cxx=clang {%s}
2 changes: 1 addition & 1 deletion test/integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def lit(tmp: Path, source: Path):
cases = sorted(
x.name
for x in root.iterdir()
if x.suffix in (".c", ".cc", ".def", ".l", ".py", ".td", ".y")
if x.suffix in (".c", ".cc", ".def", ".h", ".l", ".py", ".td", ".y")
)


Expand Down

0 comments on commit 137b636

Please sign in to comment.