view gcc/testsuite/gfortran.dg/ISO_Fortran_binding_12.c @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 1830386684a0
children
line wrap: on
line source

/* Test the fix for PR90093.  */

#include <stdio.h>
#include <math.h>
#include "../../../libgfortran/ISO_Fortran_binding.h"

/* Contributed by Reinhold Bader  <Bader@lrz.de>  */

void foo_opt(CFI_cdesc_t *, float *, int *, int);
void write_res();

float x[34];

int main() {
    CFI_CDESC_T(1) xd;
    CFI_index_t ext[] = {34};
    int sz;

    CFI_establish((CFI_cdesc_t *) &xd, &x, CFI_attribute_other,
		  CFI_type_float, 0, 1, ext);

    foo_opt((CFI_cdesc_t *) &xd, NULL, NULL, 0);
    sz = 12;
    foo_opt(NULL, &x[11], &sz, 1);

    write_res();

    return 0;
}