<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/clang/test/CodeGen/struct.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>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>Fix the clang bootstrap and Jay's testcase from llvm-dev by being completely</title>
<updated>2011-07-10T03:47:27+00:00</updated>
<author>
<name>Chris Lattner</name>
<email>sabre@nondot.org</email>
</author>
<published>2011-07-10T03:47:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d1f1158203fb5f715c9e51c9adaca0f3838345cb'/>
<id>d1f1158203fb5f715c9e51c9adaca0f3838345cb</id>
<content type='text'>
conservative when converting a functiontype to IR when in a "pointer within
a struct" context.  This has the unfortunate sideeffect of compiling all 
function pointers inside of structs into "{}*" which, though correct, is
ugly.  This has the positive side effect of being correct, and it is pretty
straight-forward to improve on this.

llvm-svn: 134861
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
conservative when converting a functiontype to IR when in a "pointer within
a struct" context.  This has the unfortunate sideeffect of compiling all 
function pointers inside of structs into "{}*" which, though correct, is
ugly.  This has the positive side effect of being correct, and it is pretty
straight-forward to improve on this.

llvm-svn: 134861
</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>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>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>
<entry>
<title>Test case for emitting va_arg as l-value; apparently I only *thought* I had committed this.</title>
<updated>2009-02-12T08:41:10+00:00</updated>
<author>
<name>Daniel Dunbar</name>
<email>daniel@zuster.org</email>
</author>
<published>2009-02-12T08:41:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=eef883327a4a029ffc4717a6730d30fce002afe4'/>
<id>eef883327a4a029ffc4717a6730d30fce002afe4</id>
<content type='text'>
llvm-svn: 64368
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
llvm-svn: 64368
</pre>
</div>
</content>
</entry>
<entry>
<title>Force -triple/-fnext-runtime for a few more test cases.</title>
<updated>2009-02-03T23:04:31+00:00</updated>
<author>
<name>Daniel Dunbar</name>
<email>daniel@zuster.org</email>
</author>
<published>2009-02-03T23:04:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c41a0b8a3c48801d29c72d4e9af72e4c8f9f1a65'/>
<id>c41a0b8a3c48801d29c72d4e9af72e4c8f9f1a65</id>
<content type='text'>
llvm-svn: 63679
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
llvm-svn: 63679
</pre>
</div>
</content>
</entry>
<entry>
<title>eliminate some random .ll file outputs</title>
<updated>2009-01-27T18:56:08+00:00</updated>
<author>
<name>Chris Lattner</name>
<email>sabre@nondot.org</email>
</author>
<published>2009-01-27T18:56:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=75441a3870fdd29668513b6978798f9d223e78c5'/>
<id>75441a3870fdd29668513b6978798f9d223e78c5</id>
<content type='text'>
llvm-svn: 63117
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
llvm-svn: 63117
</pre>
</div>
</content>
</entry>
<entry>
<title>Implement codegen of aggregates as lvalues in binary expressions,</title>
<updated>2008-09-04T03:20:13+00:00</updated>
<author>
<name>Daniel Dunbar</name>
<email>daniel@zuster.org</email>
</author>
<published>2008-09-04T03:20:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8cde00a510a3cf129f73c559589cf5e36de63007'/>
<id>8cde00a510a3cf129f73c559589cf5e36de63007</id>
<content type='text'>
e.g. "(a = b).somefield".

llvm-svn: 55758
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
e.g. "(a = b).somefield".

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