| 1 |
/* { dg-do link { target offload_target_any } } */ |
| 2 |
/* { dg-additional-sources requires-7-aux.c } */ |
| 3 |
|
| 4 |
/* Check diagnostic by device-compiler's lto1. |
| 5 |
Other file uses: 'requires unified_address'. */ |
| 6 |
|
| 7 |
#pragma omp requires unified_shared_memory |
| 8 |
|
| 9 |
int a[10]; |
| 10 |
extern void foo (void); |
| 11 |
|
| 12 |
int |
| 13 |
main (void) |
| 14 |
{ |
| 15 |
#pragma omp target |
| 16 |
for (int i = 0; i < 10; i++) |
| 17 |
a[i] = 0; |
| 18 |
|
| 19 |
foo (); |
| 20 |
return 0; |
| 21 |
} |
| 22 |
|
| 23 |
/* { dg-error "OpenMP 'requires' directive with non-identical clauses in multiple compilation units: 'unified_shared_memory' vs. 'unified_address'" "" { target *-*-* } 0 } |
| 24 |
{ dg-note {requires-7\.c' has 'unified_shared_memory'} {} { target *-*-* } 0 } |
| 25 |
TODO We're currently not streaming location information for the OpenMP |
| 26 |
directives used in 'requires-7-aux.c', so we're not seeing the source file |
| 27 |
name here (but a temporary '*.o' instead; for details, see |
| 28 |
<https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598011.html>): |
| 29 |
{ dg-note {requires-7-aux\.c' has 'unified_address'} {} { xfail *-*-* } 0 } |
| 30 |
..., but we may still verify that the rest of the diagnostic is correct: |
| 31 |
{ dg-note {' has 'unified_address'} {} { target *-*-* } 0 } */ |
| 32 |
/* { dg-excess-errors "Ignore messages like: errors during merging of translation units|mkoffload returned 1 exit status" } */ |