mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-03 14:26:09 +00:00

Summary: This patch adds an error to Clang that detects if OpenMP offloading is used between two architectures with incompatible pointer sizes. This ensures that the data mapping can be done correctly and solves an issue in code generation generating the wrong size pointer. Reviewer: jdoerfert Subscribers: cfe-commits delcypher guansong llvm-commits sstefan1 yaxunl Tags: #OpenMP #Clang Differential Revision: https://reviews.llvm.org/D88594
15 lines
717 B
C++
15 lines
717 B
C++
// RUN: not %clang_cc1 -x c++ -fopenmp -triple powerpc64le-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda -o - %s 2>&1 | FileCheck %s
|
|
// RUN: not %clang_cc1 -x c++ -fopenmp -triple i386-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -o - %s 2>&1 | FileCheck %s
|
|
// RUN: not %clang_cc1 -x c++ -fopenmp -triple x86_64-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda -o - %s 2>&1 | FileCheck %s
|
|
// RUN: not %clang_cc1 -x c++ -fopenmp -triple x86_64-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -o - %s 2>&1 | FileCheck %s
|
|
// CHECK: error: OpenMP target architecture '{{.+}}' pointer size is incompatible with host '{{.+}}'
|
|
#ifndef HEADER
|
|
#define HEADER
|
|
|
|
void test() {
|
|
#pragma omp target
|
|
{}
|
|
}
|
|
|
|
#endif
|