Skip to content

[analyzer] Add missing expected-warning after #151908 #152162

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

Merged
merged 1 commit into from
Aug 5, 2025

Conversation

steakhal
Copy link
Contributor

@steakhal steakhal commented Aug 5, 2025

This should fix the bots like:
https://lab.llvm.org/buildbot/#/builders/10/builds/10899/steps/7/logs/FAIL__Clang__cxx23-assume-attribute_cpp

******************** TEST 'Clang :: Analysis/cxx23-assume-attribute.cpp' FAILED ********************
Exit Code: 1
Command Output (stderr):
--
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/clang -cc1 -internal-isystem /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib/clang/22/include -nostdsysteminc -analyze -setup-static-analyzer -std=c++23 -triple x86_64-pc-linux-gnu    -analyzer-checker=core,debug.ExprInspection -verify /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/Analysis/cxx23-assume-attribute.cpp # RUN: at line 1
+ /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/clang -cc1 -internal-isystem /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib/clang/22/include -nostdsysteminc -analyze -setup-static-analyzer -std=c++23 -triple x86_64-pc-linux-gnu -analyzer-checker=core,debug.ExprInspection -verify /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/Analysis/cxx23-assume-attribute.cpp
error: 'expected-warning' diagnostics seen but not expected: 
  File /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/Analysis/cxx23-assume-attribute.cpp Line 75: assumption is ignored because it contains (potential) side-effects
1 error generated.
--
********************

@steakhal steakhal added clang:static analyzer skip-precommit-approval PR for CI feedback, not intended for review labels Aug 5, 2025
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Aug 5, 2025
@llvmbot
Copy link
Member

llvmbot commented Aug 5, 2025

@llvm/pr-subscribers-clang

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

Author: Balazs Benics (steakhal)

Changes

This should fix the bots like:
https://lab.llvm.org/buildbot/#/builders/10/builds/10899/steps/7/logs/FAIL__Clang__cxx23-assume-attribute_cpp

******************** TEST 'Clang :: Analysis/cxx23-assume-attribute.cpp' FAILED ********************
Exit Code: 1
Command Output (stderr):
--
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/clang -cc1 -internal-isystem /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib/clang/22/include -nostdsysteminc -analyze -setup-static-analyzer -std=c++23 -triple x86_64-pc-linux-gnu    -analyzer-checker=core,debug.ExprInspection -verify /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/Analysis/cxx23-assume-attribute.cpp # RUN: at line 1
+ /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/clang -cc1 -internal-isystem /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib/clang/22/include -nostdsysteminc -analyze -setup-static-analyzer -std=c++23 -triple x86_64-pc-linux-gnu -analyzer-checker=core,debug.ExprInspection -verify /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/Analysis/cxx23-assume-attribute.cpp
error: 'expected-warning' diagnostics seen but not expected: 
  File /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/Analysis/cxx23-assume-attribute.cpp Line 75: assumption is ignored because it contains (potential) side-effects
1 error generated.
--
********************

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

1 Files Affected:

  • (modified) clang/test/Analysis/cxx23-assume-attribute.cpp (+1)
diff --git a/clang/test/Analysis/cxx23-assume-attribute.cpp b/clang/test/Analysis/cxx23-assume-attribute.cpp
index dd15ff5d43505..4cc16446572dc 100644
--- a/clang/test/Analysis/cxx23-assume-attribute.cpp
+++ b/clang/test/Analysis/cxx23-assume-attribute.cpp
@@ -73,4 +73,5 @@ int assume_and_fallthrough_at_the_same_attrstmt(int a, int b) {
 void assume_opaque_gh151854_no_crash() {
   extern bool opaque();
   [[assume(opaque())]]; // no-crash
+  // expected-warning@-1 {{assumption is ignored because it contains (potential) side-effects}}
 }

@steakhal
Copy link
Contributor Author

steakhal commented Aug 5, 2025

This should fix the test failure introduced by #151908

@steakhal steakhal merged commit 6c9f1ce into llvm:main Aug 5, 2025
13 checks passed
@steakhal steakhal deleted the bb/fix-test-after-gh-151908 branch August 5, 2025 16:05
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 skip-precommit-approval PR for CI feedback, not intended for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants