Software: Apache. PHP/5.4.45 

uname -a: Linux webm056.cluster010.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue
Sep 17 08:14:20 UTC 2024 x86_64
 

uid=243112(mycochar) gid=100(users) groups=100(users)  

Safe-mode: OFF (not secure)

/home/mycochar/www/image/photo/gcc-12.3.0/gcc/testsuite/gfortran.dg/c-interop/   drwxr-xr-x
Free 0 B of 0 B (0%)
Your ip: 216.73.216.77 - Server ip: 213.186.33.19
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    

[Enumerate]    [Encoder]    [Tools]    [Proc.]    [FTP Brute]    [Sec.]    [SQL]    [PHP-Code]    [Backdoor Host]    [Back-Connection]    [milw0rm it!]    [PHP-Proxy]    [Self remove]
    


Viewing file:     allocate-c.c (4.4 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>

#include <ISO_Fortran_binding.h>
#include "dump-descriptors.h"

struct s {
  int i;
  double d;
};

/* External entry point.  */
extern void ctest (void);

void
ctest (void)
{
  CFI_CDESC_T(3) desc;
  CFI_cdesc_t *dv = (CFI_cdesc_t *) &desc;
  CFI_index_t ex[3], lb[3], ub[3];
  CFI_index_t sm;
  int i;

  /* Allocate and deallocate a scalar.  */
  sm = sizeof (struct s);
  check_CFI_status ("CFI_establish",
            CFI_establish (dv, NULL, CFI_attribute_allocatable,
                   CFI_type_struct, sm,
                   0, NULL));
  check_CFI_status ("CFI_allocate",
            CFI_allocate (dv, NULL, NULL, 69));
  dump_CFI_cdesc_t (dv);
  if (dv->base_addr == NULL)
    abort ();
  /* The elem_len argument only overrides the initial value in the
     descriptor for character types.  */
  if (dv->elem_len != sm)
    abort ();
  check_CFI_status ("CFI_deallocate",
            CFI_deallocate (dv));
  /* The base_addr member of the C descriptor becomes a null pointer.  */
  if (dv->base_addr != NULL)
    abort ();

  /* Try an array.  We are going to test the requirement that:
       The supplied lower and upper bounds override any current 
       dimension information in the C descriptor.
     so we'll stuff different values in the descriptor to start with.  */
  ex[0] = 3;
  ex[1] = 4;
  ex[2] = 5;
  check_CFI_status ("CFI_establish",
            CFI_establish (dv, NULL, CFI_attribute_pointer,
                   CFI_type_double, 0, 3, ex));
  lb[0] = 1;
  lb[1] = 2;
  lb[2] = 3;
  ub[0] = 10;
  ub[1] = 5;
  ub[2] = 10;
  sm = sizeof (double);
  check_CFI_status ("CFI_allocate",
            CFI_allocate (dv, lb, ub, 20));
  dump_CFI_cdesc_t (dv);
  if (dv->base_addr == NULL)
    abort ();
  /* The element sizes passed to both CFI_establish and CFI_allocate should
     have been ignored in favor of using the constant size of the type.  */
  if (dv->elem_len != sm)
    abort ();

  /* Check extents and strides; we expect the allocated array to
     be contiguous so the stride computation should be straightforward
     no matter what the lower bound is.  */
  for (i = 0; i < 3; i++)
    {
      CFI_index_t extent = ub[i] - lb[i] + 1;
      if (dv->dim[i].lower_bound != lb[i])
    abort ();
      if (dv->dim[i].extent != extent)
    abort ();
      /* pr93524 */
      if (dv->dim[i].sm != sm)
    abort ();
      sm *= extent;
    }
  check_CFI_status ("CFI_deallocate",
            CFI_deallocate (dv));
  if (dv->base_addr != NULL)
    abort ();

  /* Similarly for a character array, except that we expect the
     elem_len provided to CFI_allocate to prevail.  We set the elem_len
     to the same size as the array element in the previous example, so
     the bounds and strides should all be the same.  */
  ex[0] = 3;
  ex[1] = 4;
  ex[2] = 5;
  check_CFI_status ("CFI_establish",
            CFI_establish (dv, NULL, CFI_attribute_allocatable,
                   CFI_type_char, 4, 3, ex));
  lb[0] = 1;
  lb[1] = 2;
  lb[2] = 3;
  ub[0] = 10;
  ub[1] = 5;
  ub[2] = 10;
  sm = sizeof (double);
  check_CFI_status ("CFI_allocate",
            CFI_allocate (dv, lb, ub, sm));
  dump_CFI_cdesc_t (dv);
  if (dv->base_addr == NULL)
    abort ();
  if (dv->elem_len != sm)
    abort ();

  /* Check extents and strides; we expect the allocated array to
     be contiguous so the stride computation should be straightforward
     no matter what the lower bound is.  */
  for (i = 0; i < 3; i++)
    {
      CFI_index_t extent = ub[i] - lb[i] + 1;
      if (dv->dim[i].lower_bound != lb[i])
    abort ();
      if (dv->dim[i].extent != extent)
    abort ();
      /* pr93524 */
      if (dv->dim[i].sm != sm)
    abort ();
      sm *= extent;
    }
  check_CFI_status ("CFI_deallocate",
            CFI_deallocate (dv));
  if (dv->base_addr != NULL)
    abort ();

  /* Signed char is not a Fortran character type.  Here we expect it to
     ignore the elem_len argument and use the size of the type.  */
  ex[0] = 3;
  ex[1] = 4;
  ex[2] = 5;
  check_CFI_status ("CFI_establish",
            CFI_establish (dv, NULL, CFI_attribute_allocatable,
                   CFI_type_signed_char, 4, 3, ex));
  lb[0] = 1;
  lb[1] = 2;
  lb[2] = 3;
  ub[0] = 10;
  ub[1] = 5;
  ub[2] = 10;
  sm = sizeof (double);
  check_CFI_status ("CFI_allocate",
            CFI_allocate (dv, lb, ub, sm));
  dump_CFI_cdesc_t (dv);
  if (dv->base_addr == NULL)
    abort ();
  if (dv->elem_len != sizeof (signed char))
    abort ();

  check_CFI_status ("CFI_deallocate",
            CFI_deallocate (dv));
  if (dv->base_addr != NULL)
    abort ();

}


Enter:
 
Select:
 

Useful Commands
 
Warning. Kernel may be alerted using higher levels
Kernel Info:

Php Safe-Mode Bypass (Read Files)

File:

eg: /etc/passwd

Php Safe-Mode Bypass (List Directories):

Dir:

eg: /etc/

Search
  - regexp 

Upload
 
[ ok ]

Make Dir
 
[ ok ]
Make File
 
[ ok ]

Go Dir
 
Go File
 

--[ x2300 Locus7Shell v. 1.0a beta Modded by #!physx^ | www.LOCUS7S.com | Generation time: 0.0063 ]--