mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-03 11:23:58 +00:00
[Clang][OpenMP] Emit unroll directive w/o captured stmt (#65862)
The front end doesn't create captured stmt for unroll directive. This leads to a crash when `-fopenmp-simd` is used, as reported in #63570. Fix #63570.
This commit is contained in:
parent
6f5ebfb987
commit
52b4bec939
@ -8064,7 +8064,8 @@ void CodeGenFunction::EmitSimpleOMPExecutableDirective(
|
||||
D.getDirectiveKind() == OMPD_critical ||
|
||||
D.getDirectiveKind() == OMPD_section ||
|
||||
D.getDirectiveKind() == OMPD_master ||
|
||||
D.getDirectiveKind() == OMPD_masked) {
|
||||
D.getDirectiveKind() == OMPD_masked ||
|
||||
D.getDirectiveKind() == OMPD_unroll) {
|
||||
EmitStmt(D.getAssociatedStmt());
|
||||
} else {
|
||||
auto LPCRegion =
|
||||
|
10
clang/test/OpenMP/bug63570.c
Normal file
10
clang/test/OpenMP/bug63570.c
Normal file
@ -0,0 +1,10 @@
|
||||
// RUN: %clang_cc1 -verify -fopenmp -x c -triple x86_64-apple-darwin10 %s
|
||||
// RUN: %clang_cc1 -verify -fopenmp-simd -x c -triple x86_64-apple-darwin10 %s
|
||||
// expected-no-diagnostics
|
||||
|
||||
void f(float *a, float *b) {
|
||||
#pragma omp unroll
|
||||
for (int i = 0; i < 128; i++) {
|
||||
a[i] = b[i];
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user