Skip to content

Commit cbaf3c6

Browse files
Add test to show save-temps is broken for amdgcn target. (#161472)
In response to request here #160935 by @jansvoboda11
1 parent bb16c56 commit cbaf3c6

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
// REQUIRES: amdgpu-registered-target
3+
4+
// XFAIL: *
5+
6+
// 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
7+
// 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
8+
// 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
9+
// expected-no-diagnostics
10+
#ifndef HEADER
11+
#define HEADER
12+
13+
#define N 1000
14+
15+
int test_amdgcn_save_temps() {
16+
int arr[N];
17+
#pragma omp target
18+
for (int i = 0; i < N; i++) {
19+
arr[i] = 1;
20+
}
21+
return arr[0];
22+
}
23+
#endif
24+
25+
// CHECK: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_test_amdgcn_save_temps

0 commit comments

Comments
 (0)