-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the dllimport code generation for opaque type
Added test cases to verify the 'dllimport' usage in LLVM IR. Fixes: #1407
- Loading branch information
Showing
3 changed files
with
62 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
! Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
! See https://llvm.org/LICENSE.txt for license information. | ||
! SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
! | ||
! https://github.com/flang-compiler/flang/issues/320 | ||
! https://github.com/flang-compiler/flang/issues/1407 | ||
! | ||
! REQUIRES: system-windows | ||
! | ||
! RUN: %flang -S -emit-llvm -S -emit-llvm %s_mod.f90 %s | ||
! RUN: cat dllimport_test.ll | FileCheck %s | ||
! CHECK: %structdllimport_module__t_type__td_ = type opaque | ||
! CHECK: @_dllimport_module_10_ = external dllimport global | ||
! CHECK: @dllimport_module__t_type__td_ = external dllimport global | ||
program h_main | ||
use dllimport_module | ||
implicit none | ||
|
||
call foobar(array) | ||
end program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
! | ||
! Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
! See https://llvm.org/LICENSE.txt for license information. | ||
! SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
! | ||
! REQUIRES: system-windows | ||
! RUN: true | ||
|
||
module dllimport_module | ||
implicit none | ||
|
||
type t_type | ||
private | ||
integer :: a, b | ||
end type | ||
|
||
type(t_type), parameter :: array(2) = (/t_type(1, 1), t_type(1, 0)/) | ||
|
||
interface foobar | ||
module procedure test | ||
end interface | ||
|
||
contains | ||
subroutine test(a) | ||
type(t_type), dimension(:) :: a | ||
return | ||
end subroutine | ||
end module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters