Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions clang/lib/AST/ByteCode/EvalEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ template <> bool EvalEmitter::emitRet<PT_Ptr>(const SourceInfo &Info) {
if (!Ptr.isZero() && !Ptr.isDereferencable())
return false;

if (Ptr.pointsToStringLiteral() && Ptr.isArrayRoot())
return false;

if (!Ptr.isZero() && !CheckFinalLoad(S, OpPC, Ptr))
return false;

Expand Down
20 changes: 18 additions & 2 deletions clang/test/AST/ByteCode/openmp.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -fexperimental-new-constant-interpreter -verify=expected,both -fopenmp %s
// RUN: %clang_cc1 -verify=ref,both -fopenmp %s
// RUN: %clang_cc1 -verify=expected,both -fopenmp -fopenmp-version=60 %s -fexperimental-new-constant-interpreter
// RUN: %clang_cc1 -verify=ref,both -fopenmp -fopenmp-version=60 %s

int test1() {
int i;
Expand All @@ -11,3 +11,19 @@ int test1() {
for (int i = 0; i < 10; ++i);
}

extern int omp_get_thread_num(void);

#define N 64

int test2() {
int x = 0;
int device_result[N] = {0};

#pragma omp target parallel loop num_threads(strict: N) severity(warning) message("msg")
for (int i = 0; i < N; i++) {
x = omp_get_thread_num();
device_result[i] = i + x;
}
}