Hi!

Help.  Save the attached file as 'gcc/testsuite/c-c++-common/goacc/l_.c',
and then run:

    $ make check-gcc-c++ RUNTESTFLAGS=--all\ goacc.exp=l_.c

As expected for '-std=c++98' testing, which comes first:

    PASS: c-c++-common/goacc/l_.c  -std=c++98  (test for errors, line 14)
    PASS: c-c++-common/goacc/l_.c  -std=c++98  (test for warnings, line 11)
    PASS: c-c++-common/goacc/l_.c  -std=c++98 (test for excess errors)
    WARNING: dg-line var l1 defined, but not used
    WARNING: dg-line var l2 defined, but not used
    WARNING: dg-line var l3 defined, but not used

But then it goes on with '-std=c++14', etc. testing:

    UNRESOLVED: c-c++-common/goacc/l_.c  -std=c++14  (test for errors, line 14)
    PASS: c-c++-common/goacc/l_.c  -std=c++14  (test for warnings, line 11)
    PASS: c-c++-common/goacc/l_.c  -std=c++14 (test for excess errors)
    WARNING: dg-line var l1 defined, but not used
    WARNING: dg-line var l2 defined, but not used
    WARNING: dg-line var l3 defined, but not used
    UNRESOLVED: c-c++-common/goacc/l_.c  -std=c++17  (test for errors, line 14)
    PASS: c-c++-common/goacc/l_.c  -std=c++17  (test for warnings, line 11)
    PASS: c-c++-common/goacc/l_.c  -std=c++17 (test for excess errors)
    WARNING: dg-line var l1 defined, but not used
    WARNING: dg-line var l2 defined, but not used
    WARNING: dg-line var l3 defined, but not used
    UNRESOLVED: c-c++-common/goacc/l_.c  -std=c++2a  (test for errors, line 14)
    PASS: c-c++-common/goacc/l_.c  -std=c++2a  (test for warnings, line 11)
    PASS: c-c++-common/goacc/l_.c  -std=c++2a (test for excess errors)
    WARNING: dg-line var l1 defined, but not used
    WARNING: dg-line var l2 defined, but not used
    WARNING: dg-line var l3 defined, but not used

                    === g++ Summary ===

    # of expected passes            9
    # of unresolved testcases       3

Why is suddenly the "test for errors, line 14" an UNRESOLVED?  (The
compiler diagnostics are as expected.  This testcase doesn't depend on
'-std=[...]' at all.)

And now the "funny" thing: if I disable any of the 'dg-line' directives,
it works as expected, all-PASS.  But note that "test for errors, line 14"
doesn't even use a 'dg-line'-captured line number.  (It uses absoute line
numbers.  Same issue visible when using relative ones, or when actually
using 'dg-line' for these.)


I reduced this from a much bigger testcase, and had originally found this
not with 'check-gcc-c++' but with 'check-gcc-c': things worked fine as
long as testing just a single testcase, but broke when testing several.
(Again the symptom was that the first testcase worked fine, but the
following ones had an unexpecte UNRESOLVED for the first 'dg-error' (only
for the first!).)  Supposedly, 'check-gcc-c++' with a single testcase but
testing several variants is exhibiting the same problem.


Grüße
 Thomas


-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander 
Walter
static void test(void)
{
  int i, j;

#pragma acc parallel
  {
    /* { dg-line l1 } */
    /* { dg-line l2 } */
    /* { dg-line l3 } */
   
#pragma acc loop gang
    for (i = 0; i < 10; i++)
      {
#pragma acc loop gang
	/* { dg-error "inner loop uses same OpenACC parallelism as containing loop" "" { target *-*-* } 14 } */
	/* { dg-message "containing loop" "" { target *-*-* } 11 } */
	for (j = 0; j < 10; j++)
	  ;
      }
  }
}

Reply via email to