We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No description provided.
The text was updated successfully, but these errors were encountered:
Carlo, do you have a sample code to elicit the bug?
Sorry, something went wrong.
Yep:
SUBROUTINE MYSUB(B,N) CHARACTER*1 B(1) CHARACTER*1 BLNK SAVE BLNK DATA BLNK /' '/ DO 10 I=1,N B(I)=BLNK
10 CONTINUE RETURN END
program invokecharblank character*1 STRING(10) integer*4 N external MYSUB N = 10 call MYSUB(STRING,N) do 20 I=1,10 print *, 'string = ', STRING(I), '.'
20 continue
end
Compile with -S -emit-llvm and then pass it to clang with the rt library linked. It will fail saying that the called function does not exist.
In examining the IR, Flang appears to mangle the caller beyond appending the underscore. The IR shows:
subroutine definition: define void @mysub_([1 x i8]* noalias %b, i32* noalias %n)
call location: call void @mysub_.1([1 x i8]* %0, i32* %n)
The symbol is declared at the bottom of the IR as follows: declare void @mysub_.1([1 x i8], i32)
The bug occurs when the subroutines are defined as "external"
jleidel
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: