This is an archive of the discontinued LLVM Phabricator instance.

[flang] Add examples in documentation/BijectiveInternalNameUniquing.md
ClosedPublic

Authored by sameeranjoshi on May 5 2020, 1:25 PM.

Details

Summary

I thought it would be simpler to understand on how the unique names would look like when an example is present. So I added some examples.

I found 2 such places to add examples
-Common blocks
-Module scope global data

Diff Detail

Event Timeline

sameeranjoshi created this revision.May 5 2020, 1:25 PM
Herald added a project: Restricted Project. · View Herald Transcript

Thanks for adding these examples

flang/documentation/BijectiveInternalNameUniquing.md
82

The indentation of module mod is slightly weird. Also, I think you could add end module or ... at the end.

Minor formating changes.

jeanPerier accepted this revision.May 6 2020, 2:08 AM
This revision is now accepted and ready to land.May 6 2020, 2:08 AM
schweitz accepted this revision.May 6 2020, 7:47 AM

Thanks for adding these examples.

A related addition would be to add a unittest that constructs and deconstructs the unique names.

sameeranjoshi marked an inline comment as done.May 6 2020, 9:03 PM

Thanks for adding these examples.

A related addition would be to add a unittest that constructs and deconstructs the unique names.

Is there some testing guide for the same?
If not, some previous work to look into and check how is that done?

Thanks for adding these examples.

A related addition would be to add a unittest that constructs and deconstructs the unique names.

I checked LLVM unittesting guidelines for writing tests using gtest and gmock.

I grepped for gtest.h and gmock.h, I ended up with no results.
Various macros(various types of ASSERTS... ) in gtest are not seen in flang/unittests/ folder.
As well various gtest related functions in main() are not seen, ex RUN_ALL_TESTS(), InitGoogleTest().

  1. I am wondering why are other tests in the directory not using these features of gtest and still being under unittests/ folder?
  2. If current tests which are already present belong to different aspect of testing the flang-compiler, is that ok to write BijectiveInternalNameUniquing tests using gtest way of doing things?