Files
TheRock/compiler/amd-llvm/clang/test/OpenMP/interop_codegen.cpp
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

47 lines
2.0 KiB
C++

// expected-no-diagnostics
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fopenmp-targets=spirv64 -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s
#ifndef HEADER
#define HEADER
typedef void *omp_interop_t;
#define omp_interop_none 0
#define omp_ipr_fr_id -1
typedef long omp_intptr_t;
#define NULL 0
extern omp_intptr_t omp_get_interop_int(const omp_interop_t, int, int *);
int main() {
omp_interop_t obj1 = omp_interop_none;
omp_interop_t obj2 = omp_interop_none;
omp_interop_t i1 = omp_interop_none;
omp_interop_t i2 = omp_interop_none;
omp_interop_t i3 = omp_interop_none;
omp_interop_t i4 = omp_interop_none;
omp_interop_t i5 = omp_interop_none;
#pragma omp interop init(targetsync: obj1) init(targetsync: obj2)
int id = (int )omp_get_interop_int(obj1, omp_ipr_fr_id, NULL);
int id1 = (int )omp_get_interop_int(obj2, omp_ipr_fr_id, NULL);
#pragma omp interop init(target,targetsync: i1) use(i2) use(i3) destroy(i4) destroy(i5)
int id2 = (int )omp_get_interop_int(i1, omp_ipr_fr_id, NULL);
int id3 = (int )omp_get_interop_int(i2, omp_ipr_fr_id, NULL);
}
#endif
// CHECK-LABEL: define {{.+}}main{{.+}}
// CHECK: call {{.+}}__tgt_interop_init({{.+}}obj1{{.*}})
// CHECK: call {{.+}}__tgt_interop_init({{.+}}obj2{{.*}})
// CHECK: call {{.+}}__tgt_interop_init({{.+}}i1{{.*}})
// CHECK: call {{.+}}__tgt_interop_destroy({{.+}}i4{{.*}})
// CHECK: call {{.+}}__tgt_interop_destroy({{.+}}i5{{.*}})
// CHECK: call {{.+}}__tgt_interop_use({{.+}}i2{{.*}})
// CHECK: call {{.+}}__tgt_interop_use({{.+}}i3{{.*}})