xref: /llvm-project/clang/test/SemaOpenMP/atomic-capture-const-no-crash.c (revision d180cfb37d0d1ae1e9dadd13debc49c80d52eda4)
1 // RUN: %clang_cc1 -fopenmp-simd -fsyntax-only -verify %s
2 // see https://github.com/llvm/llvm-project/issues/69069
3 // or https://github.com/llvm/llvm-project/pull/71480
4 
test()5 void test() {
6   int v; const int x; // expected-note {{variable 'x' declared const here}}
7 #pragma omp atomic capture
8   {
9     v = x;
10     x = 1; // expected-error {{cannot assign to variable 'x' with const-qualified type 'const int'}}
11   }
12 }