Skip to content

Conversation

@kkwli
Copy link
Collaborator

@kkwli kkwli commented Nov 14, 2025

After bf3b704, the type definition is no longer generated without using the variables. This patch is to add the use of the derived type variables.

@kkwli kkwli self-assigned this Nov 14, 2025
@llvmbot llvmbot added flang Flang issues not falling into any other category flang:fir-hlfir labels Nov 14, 2025
@llvmbot
Copy link
Member

llvmbot commented Nov 14, 2025

@llvm/pr-subscribers-flang-fir-hlfir

Author: Kelvin Li (kkwli)

Changes

After bf3b704, the type definition is no longer generated without using the variables. This patch is to add the use of the derived type variables.


Full diff: https://github.com/llvm/llvm-project/pull/168073.diff

1 Files Affected:

  • (modified) flang/test/Lower/derived-types-bindc.f90 (+6)
diff --git a/flang/test/Lower/derived-types-bindc.f90 b/flang/test/Lower/derived-types-bindc.f90
index 309b2b7f5f492..c3c007dc82133 100644
--- a/flang/test/Lower/derived-types-bindc.f90
+++ b/flang/test/Lower/derived-types-bindc.f90
@@ -41,4 +41,10 @@ subroutine s1()
   end type
   type(t4) :: xt4
 ! CHECK-DAG: %_QFs1Tt4 = type <{ i16, [2 x i8], { double, double }, [1 x i8], [3 x i8] }>
+
+  xt0%x2 = 1.
+  xt1%x2 = 1.
+  xt2%x2 = 1.
+  xt3%x2 = (1., 1.)
+  xt4%x2 = (1., 1.)
 end subroutine s1

@kkwli kkwli requested a review from SusanTan November 14, 2025 15:37
@kkwli kkwli changed the title [flang] add use of the variables (NFC) [flang][AIX] add use of the variables (NFC) Nov 14, 2025
Copy link
Contributor

@DanielCChen DanielCChen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Thanks.

@kkwli kkwli merged commit 1122581 into llvm:main Nov 14, 2025
13 checks passed
@kkwli kkwli deleted the fix-derived-types-bindc branch November 14, 2025 16:54
@SusanTan
Copy link
Contributor

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flang:fir-hlfir flang Flang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants