| 1 |
! { dg-do compile } |
| 2 |
! { dg-require-weak "" } |
| 3 |
! { dg-skip-if "" { x86_64-*-mingw* } } |
| 4 |
|
| 5 |
! 1. |
| 6 |
! { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?__foo_MOD_abc" { target { ! nvptx-*-* } } } } |
| 7 |
! { dg-final { scan-assembler-times "\\.weak \\.global \\.align 4 \\.u32 __foo_MOD_abc" 1 { target nvptx-*-* } } } |
| 8 |
module foo |
| 9 |
implicit none |
| 10 |
!GCC$ ATTRIBUTES weak :: abc |
| 11 |
real :: abc(7) |
| 12 |
end module |
| 13 |
|
| 14 |
! 2. |
| 15 |
! { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?impl1" { target { ! nvptx-*-* } } } } |
| 16 |
! { dg-final { scan-assembler-times "\\.weak \\.func \\(\\.param\\.u32 %value_out\\) impl1" 2 { target nvptx-*-* } } } |
| 17 |
integer function impl1() |
| 18 |
implicit none |
| 19 |
!GCC$ ATTRIBUTES weak :: impl1 |
| 20 |
end function |
| 21 |
|
| 22 |
! 3. |
| 23 |
! { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?bar__" { target { ! nvptx-*-* } } } } |
| 24 |
! { dg-final { scan-assembler-times "\\.weak \\.func \\(\\.param\\.u32 %value_out\\) bar__" 2 { target nvptx-*-* } } } |
| 25 |
integer function impl2() bind(c,name='bar__') |
| 26 |
implicit none |
| 27 |
!GCC$ ATTRIBUTES weak :: impl2 |
| 28 |
end function |