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
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.
The text was updated successfully, but these errors were encountered:
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)
Sorry, something went wrong.
The bug occurs when the subroutines are defined as "external"
Issue migrated from llvm-flang/flang-old#8
How to compile this? I copy-pasted everything in a file and got a bunch or compile-time errors, regardless of file extension (fixed or free-form).
Got it reproduced, never mind.
No branches or pull requests
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.
The text was updated successfully, but these errors were encountered: