38 lines · plain
1! RUN: bbc %s -o - | FileCheck %s2 3! Test support of non standard features regarding common blocks:4! - A named common that appears with different storage sizes5! - A blank common that is initialized6! - A common block that is initialized outside of a BLOCK DATA.7 8! CHECK-LABEL: fir.global @__BLNK__ {alignment = 4 : i64} : tuple<i32, !fir.array<8xi8>> {9! CHECK: %[[undef:.*]] = fir.zero_bits tuple<i32, !fir.array<8xi8>>10! CHECK: %[[init:.*]] = fir.insert_value %[[undef]], %c42{{.*}}, [0 : index] : (tuple<i32, !fir.array<8xi8>>, i32) -> tuple<i32, !fir.array<8xi8>>11! CHECK: fir.has_value %[[init]] : tuple<i32, !fir.array<8xi8>>12 13! CHECK-LABEL: fir.global @a_ {alignment = 4 : i64} : tuple<i32, !fir.array<8xi8>> {14! CHECK: %[[undef:.*]] = fir.zero_bits tuple<i32, !fir.array<8xi8>>15! CHECK: %[[init:.*]] = fir.insert_value %[[undef]], %c42{{.*}}, [0 : index] : (tuple<i32, !fir.array<8xi8>>, i32) -> tuple<i32, !fir.array<8xi8>>16! CHECK: fir.has_value %[[init]] : tuple<i32, !fir.array<8xi8>>17 18 19subroutine first_appearance20 real :: x, y, xa, ya21 common // x, y22 common /a/ xa, ya23 call foo(x, xa)24end subroutine25 26subroutine second_appearance27 real :: x, y, z, xa, ya, za28 common // x, y, z29 common /a/ xa, ya, za30 call foo(x, xa)31end subroutine32 33subroutine third_appearance34 integer :: x = 42, xa = 4235 common // x36 common /a/ xa37end subroutine38