[flang-commits] [flang] 54881c9 - [flang] Remove test from #69121 to fix gcc build with gcc < 10.0

Jean Perier via flang-commits flang-commits at lists.llvm.org
Fri Oct 20 01:13:28 PDT 2023


Author: Jean Perier
Date: 2023-10-20T10:13:04+02:00
New Revision: 54881c9225e612830a9e78574a805309b516627b

URL: https://github.com/llvm/llvm-project/commit/54881c9225e612830a9e78574a805309b516627b
DIFF: https://github.com/llvm/llvm-project/commit/54881c9225e612830a9e78574a805309b516627b.diff

LOG: [flang] Remove test from #69121 to fix gcc build with gcc < 10.0

ISO_Fortran_binding.h was only added to in gcc 10.0. Flang should be
buildable with older versions. Remove the test until a safe way to
check that the compiler can run the test (that it is clang from the
build for instance).

Fix bots failure https://lab.llvm.org/buildbot/#/builders/181/builds/24526
Also in:

https://lab.llvm.org/buildbot/#/builders/160
https://lab.llvm.org/buildbot/#/builders/268
https://lab.llvm.org/buildbot/#/builders/181

Added: 
    

Modified: 
    

Removed: 
    flang/test/Examples/ctofortran.f90


################################################################################
diff  --git a/flang/test/Examples/ctofortran.f90 b/flang/test/Examples/ctofortran.f90
deleted file mode 100644
index e47fa25f48482fd..000000000000000
--- a/flang/test/Examples/ctofortran.f90
+++ /dev/null
@@ -1,70 +0,0 @@
-! UNSUPPORTED: system-windows
-! RUN: split-file %s %t
-! RUN: chmod +x %t/runtest.sh
-! RUN: %t/runtest.sh %t %flang $t/ffile.f90 $t/cfile.c | FileCheck %s
-
-!--- ffile.f90
-subroutine foo(a) bind(c)
-  integer :: a(:)
-  if (lbound(a, 1) .ne. 1) then
-     print *, 'FAIL expected 1 for lbound but got ',lbound(a, 1)
-     stop 1
-  endif
-
-  if (ubound(a, 1) .ne. 10) then
-     print *, 'FAIL expected 10 for ubound but got ',ubound(a, 1)
-     stop 1
-  endif
-
-  do i = lbound(a,1),ubound(a,1)
-     !print *, a(i)
-     if (a(i) .ne. i) then
-        print *, 'FAIL expected', i, ' for index ',i, ' but got ',a(i)
-        stop 1
-     endif
-  enddo
-  print *, 'PASS'
-end subroutine foo
-
-! CHECK: PASS
-!--- cfile.c
-#include <stdio.h>
-#include <stdlib.h>
-#include <ISO_Fortran_binding.h>
-
-void foo(CFI_cdesc_t*);
-
-int a[10];
-
-int main() {
-  int i, res;
-  static CFI_CDESC_T(1) r1;
-  CFI_cdesc_t *desc = (CFI_cdesc_t*)&r1;
-  CFI_index_t extent[1] = {10};
-
-  for(i=0; i<10; ++i) {
-    a[i] = i+1;
-  }
-
-  res = CFI_establish(desc, (void*)a, CFI_attribute_other, CFI_type_int32_t,
-                      sizeof(int), 1, extent);
-  if (res != 0) {
-    printf("FAIL CFI_establish returned %d instead of 0.\n",res);
-    exit(1);
-  }
-
-  foo(desc);
-  return 0;
-}
-!--- runtest.sh
-#!/bin/bash
-export CCOMP=`dirname $2`/clang
-if [ -x $CCOMP ]
-then
-  $CCOMP -c $1/$4 -o $1/cfile.o
-  $2 $1/$3 $1/cfile.o -o $1/ctofortran
-  $1/ctofortran # should print "PASS"
-else
-  # No clang compiler, just pass by default
-  echo "PASS"
-fi


        


More information about the flang-commits mailing list