| 1 |
|
| 2 |
// REQUIRES: amdgpu-registered-target |
| 3 |
|
| 4 |
// RUN: %clang_cc1 -E -fopenmp -x c -triple amdgcn-amd-amdhsa -fopenmp-targets=amdgcn-amd-amdhsa -save-temps=cwd %s -o %t-openmp-amdgcn-amd-amdhsa-gfx90a.i |
| 5 |
// RUN: %clang_cc1 -fopenmp -x c -triple x86_64-unknown-unknown -fopenmp-targets=amdgcn-amd-amdhsa -save-temps=cwd -emit-llvm-bc %s -o %t-x86_64-unknown-unknown.bc |
| 6 |
// RUN: %clang_cc1 -fopenmp -x c -triple amdgcn-amd-amdhsa -fopenmp-targets=amdgcn-amd-amdhsa -save-temps=cwd -emit-llvm -fopenmp-is-target-device -x cpp-output %t-openmp-amdgcn-amd-amdhsa-gfx90a.i -fopenmp-host-ir-file-path %t-x86_64-unknown-unknown.bc -o - | FileCheck %s |
| 7 |
// expected-no-diagnostics |
| 8 |
#ifndef HEADER |
| 9 |
#define HEADER |
| 10 |
|
| 11 |
#define N 1000 |
| 12 |
|
| 13 |
int test_amdgcn_save_temps() { |
| 14 |
int arr[N]; |
| 15 |
#pragma omp target |
| 16 |
for (int i = 0; i < N; i++) { |
| 17 |
arr[i] = 1; |
| 18 |
} |
| 19 |
return arr[0]; |
| 20 |
} |
| 21 |
#endif |
| 22 |
|
| 23 |
// CHECK: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_test_amdgcn_save_temps |