<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/clang/test/CodeGen/staticinit.c, branch users/nico/python-2</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[Clang] [NFC] Fix unintended `-Wreturn-type` warnings everywhere in the test suite (#123464)</title>
<updated>2025-01-18T18:16:33+00:00</updated>
<author>
<name>Sirraide</name>
<email>aeternalmail@gmail.com</email>
</author>
<published>2025-01-18T18:16:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=12f78e740c5419f7d1fbcf8f2106e7a40cd1d6f7'/>
<id>12f78e740c5419f7d1fbcf8f2106e7a40cd1d6f7</id>
<content type='text'>
In preparation of making `-Wreturn-type` default to an error (as there
is virtually no situation where you’d *want* to fall off the end of a
function that is supposed to return a value), this patch fixes tests
that have relied on this being only a warning, of which there seem 
to be 3 kinds:

1. Tests which for no apparent reason have a function that triggers the
warning.

I suspect that a lot of these were on accident (or from before the
warning was introduced), since a lot of people will open issues w/ their
problematic code in the `main` function (which is the one case where you
don’t need to return from a non-void function, after all...), which
someone will then copy, possibly into a namespace, possibly renaming it,
the end result of that being that you end up w/ something that
definitely is not `main` anymore, but which still is declared as
returning `int`, and which still has no return statement (another reason
why I think this might apply to a lot of these is because usually the
actual return type of such problematic functions is quite literally
`int`).
  
A lot of these are really old tests that don’t use `-verify`, which is
why no-one noticed or had to care about the extra warning that was
already being emitted by them until now.

2. Tests which test either `-Wreturn-type`, `[[noreturn]]`, or what
codegen and sanitisers do whenever you do fall off the end of a
function.

3. Tests where I struggle to figure out what is even being tested
(usually because they’re Objective-C tests, and I don’t know
Objective-C), whether falling off the end of a function matters in the
first place, and tests where actually spelling out an expression to
return would be rather cumbersome (e.g. matrix types currently don’t
support list initialisation, so I can’t write e.g. `return {}`).

For tests that fall into categories 2 and 3, I just added
`-Wno-error=return-type` to the `RUN` lines and called it a day. This
was especially necessary for the former since `-Wreturn-type` is an
analysis-based warning, meaning that it is currently impossible to test
for more than one occurrence of it in the same compilation if it
defaults to an error since the analysis pass is skipped for subsequent
functions as soon as an error is emitted.

I’ve also added `-Werror=return-type` to a few tests that I had already
updated as this patch was previously already making the warning an error
by default, but we’ve decided to split that into two patches instead.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In preparation of making `-Wreturn-type` default to an error (as there
is virtually no situation where you’d *want* to fall off the end of a
function that is supposed to return a value), this patch fixes tests
that have relied on this being only a warning, of which there seem 
to be 3 kinds:

1. Tests which for no apparent reason have a function that triggers the
warning.

I suspect that a lot of these were on accident (or from before the
warning was introduced), since a lot of people will open issues w/ their
problematic code in the `main` function (which is the one case where you
don’t need to return from a non-void function, after all...), which
someone will then copy, possibly into a namespace, possibly renaming it,
the end result of that being that you end up w/ something that
definitely is not `main` anymore, but which still is declared as
returning `int`, and which still has no return statement (another reason
why I think this might apply to a lot of these is because usually the
actual return type of such problematic functions is quite literally
`int`).
  
A lot of these are really old tests that don’t use `-verify`, which is
why no-one noticed or had to care about the extra warning that was
already being emitted by them until now.

2. Tests which test either `-Wreturn-type`, `[[noreturn]]`, or what
codegen and sanitisers do whenever you do fall off the end of a
function.

3. Tests where I struggle to figure out what is even being tested
(usually because they’re Objective-C tests, and I don’t know
Objective-C), whether falling off the end of a function matters in the
first place, and tests where actually spelling out an expression to
return would be rather cumbersome (e.g. matrix types currently don’t
support list initialisation, so I can’t write e.g. `return {}`).

For tests that fall into categories 2 and 3, I just added
`-Wno-error=return-type` to the `RUN` lines and called it a day. This
was especially necessary for the former since `-Wreturn-type` is an
analysis-based warning, meaning that it is currently impossible to test
for more than one occurrence of it in the same compilation if it
defaults to an error since the analysis pass is skipped for subsequent
functions as soon as an error is emitted.

I’ve also added `-Werror=return-type` to a few tests that I had already
updated as this patch was previously already making the warning an error
by default, but we’ve decided to split that into two patches instead.</pre>
</div>
</content>
</entry>
<entry>
<title>[Clang] Convert some tests to opaque pointers (NFC)</title>
<updated>2023-03-10T13:43:42+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2023-03-10T10:36:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a20874276be777bed4f34c52438efd66798c2ec5'/>
<id>a20874276be777bed4f34c52438efd66798c2ec5</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC)</title>
<updated>2022-04-07T10:09:47+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2022-04-07T10:03:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=532dc62b907554b3f07f17205674aa71e76fc863'/>
<id>532dc62b907554b3f07f17205674aa71e76fc863</id>
<content type='text'>
This adds -no-opaque-pointers to clang tests whose output will
change when opaque pointers are enabled by default. This is
intended to be part of the migration approach described in
https://discourse.llvm.org/t/enabling-opaque-pointers-by-default/61322/9.

The patch has been produced by replacing %clang_cc1 with
%clang_cc1 -no-opaque-pointers for tests that fail with opaque
pointers enabled. Worth noting that this doesn't cover all tests,
there's a remaining ~40 tests not using %clang_cc1 that will need
a followup change.

Differential Revision: https://reviews.llvm.org/D123115
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This adds -no-opaque-pointers to clang tests whose output will
change when opaque pointers are enabled by default. This is
intended to be part of the migration approach described in
https://discourse.llvm.org/t/enabling-opaque-pointers-by-default/61322/9.

The patch has been produced by replacing %clang_cc1 with
%clang_cc1 -no-opaque-pointers for tests that fail with opaque
pointers enabled. Worth noting that this doesn't cover all tests,
there's a remaining ~40 tests not using %clang_cc1 that will need
a followup change.

Differential Revision: https://reviews.llvm.org/D123115
</pre>
</div>
</content>
</entry>
<entry>
<title>Use functions with prototypes when appropriate; NFC</title>
<updated>2022-02-15T21:06:43+00:00</updated>
<author>
<name>Aaron Ballman</name>
<email>aaron@aaronballman.com</email>
</author>
<published>2022-02-15T21:06:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=adc402bf3d0565ac2bc7efbdd05f0d846e818041'/>
<id>adc402bf3d0565ac2bc7efbdd05f0d846e818041</id>
<content type='text'>
A significant number of our tests in C accidentally use functions
without prototypes. This patch converts the function signatures to have
a prototype for the situations where the test is not specific to K&amp;R C
declarations. e.g.,

  void func();

becomes

  void func(void);

This is the eleventh batch of tests being updated (there are a
significant number of other tests left to be updated).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A significant number of our tests in C accidentally use functions
without prototypes. This patch converts the function signatures to have
a prototype for the situations where the test is not specific to K&amp;R C
declarations. e.g.,

  void func();

becomes

  void func(void);

This is the eleventh batch of tests being updated (there are a
significant number of other tests left to be updated).
</pre>
</div>
</content>
</entry>
<entry>
<title>Emit the globals, metadata, etc. associated with static variables even when</title>
<updated>2010-05-04T20:45:42+00:00</updated>
<author>
<name>John McCall</name>
<email>rjmccall@apple.com</email>
</author>
<published>2010-05-04T20:45:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4a39ab80785e2c4ab63859a78ba58dfea2501216'/>
<id>4a39ab80785e2c4ab63859a78ba58dfea2501216</id>
<content type='text'>
they're unreachable.  This matters because (if they're POD, or if this is C)
the scope containing the variable might be reachable even if the variable
isn't.  Fixes PR7044.

llvm-svn: 103052
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
they're unreachable.  This matters because (if they're POD, or if this is C)
the scope containing the variable might be reachable even if the variable
isn't.  Fixes PR7044.

llvm-svn: 103052
</pre>
</div>
</content>
</entry>
<entry>
<title>Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.</title>
<updated>2009-12-15T20:14:24+00:00</updated>
<author>
<name>Daniel Dunbar</name>
<email>daniel@zuster.org</email>
</author>
<published>2009-12-15T20:14:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8fbe78f6fc7b41d1a4228c126fcb522131150518'/>
<id>8fbe78f6fc7b41d1a4228c126fcb522131150518</id>
<content type='text'>
 - This is designed to make it obvious that %clang_cc1 is a "test variable"
   which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
   can be useful to redefine what gets run as 'clang -cc1' (for example, to set
   a default target).

llvm-svn: 91446
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
 - This is designed to make it obvious that %clang_cc1 is a "test variable"
   which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
   can be useful to redefine what gets run as 'clang -cc1' (for example, to set
   a default target).

llvm-svn: 91446
</pre>
</div>
</content>
</entry>
<entry>
<title>Eliminate &amp;&amp;s in tests.</title>
<updated>2009-11-08T01:45:36+00:00</updated>
<author>
<name>Daniel Dunbar</name>
<email>daniel@zuster.org</email>
</author>
<published>2009-11-08T01:45:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8b576979549184e73c6876ec4b494aacf7c87d2d'/>
<id>8b576979549184e73c6876ec4b494aacf7c87d2d</id>
<content type='text'>
 - 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&amp;&amp; *$#\1#g' $i | FileUpdate $i; done', for the curious.

llvm-svn: 86430
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
 - 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&amp;&amp; *$#\1#g' $i | FileUpdate $i; done', for the curious.

llvm-svn: 86430
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove tabs, and whitespace cleanups.</title>
<updated>2009-09-09T15:08:12+00:00</updated>
<author>
<name>Mike Stump</name>
<email>mrs@apple.com</email>
</author>
<published>2009-09-09T15:08:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=11289f42807681deee5551c40fe1a4282d54c86a'/>
<id>11289f42807681deee5551c40fe1a4282d54c86a</id>
<content type='text'>
llvm-svn: 81346
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
llvm-svn: 81346
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove the -arch option from clang-cc: for all practical purposes, it's </title>
<updated>2009-05-19T11:12:40+00:00</updated>
<author>
<name>Eli Friedman</name>
<email>eli.friedman@gmail.com</email>
</author>
<published>2009-05-19T11:12:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=45966b4671aa2b575f7c3997569cb443dad76716'/>
<id>45966b4671aa2b575f7c3997569cb443dad76716</id>
<content type='text'>
redundant with -triple.

llvm-svn: 72108
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
redundant with -triple.

llvm-svn: 72108
</pre>
</div>
</content>
</entry>
<entry>
<title>Rename clang to clang-cc.</title>
<updated>2009-03-24T02:24:46+00:00</updated>
<author>
<name>Daniel Dunbar</name>
<email>daniel@zuster.org</email>
</author>
<published>2009-03-24T02:24:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a45cf5b6b0790e829ad47cf946c149d8f1007324'/>
<id>a45cf5b6b0790e829ad47cf946c149d8f1007324</id>
<content type='text'>
Tests and drivers updated, still need to shuffle dirs.

llvm-svn: 67602
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Tests and drivers updated, still need to shuffle dirs.

llvm-svn: 67602
</pre>
</div>
</content>
</entry>
</feed>
