source:
tests/warnings/self-assignment.cfa
@
94aa202
Last change on this file since 94aa202 was 53692b3, checked in by , 4 years ago | |
---|---|
|
|
File size: 767 bytes |
Rev | Line | |
---|---|---|
[6bc76537] | 1 | // |
2 | // Cforall Version 1.0.0 Copyright (C) 2018 University of Waterloo | |
3 | // | |
4 | // The contents of this file are covered under the licence agreement in the | |
5 | // file "LICENCE" distributed with Cforall. | |
6 | // | |
7 | // self-assignment.c -- | |
8 | // | |
9 | // Author : Rob Schluntz | |
10 | // Created On : Thu Mar 1 13:53:57 2018 | |
[6dfed1f] | 11 | // Last Modified By : Peter A. Buhr |
[53692b3] | 12 | // Last Modified On : Sat Jun 5 10:08:56 2021 |
13 | // Update Count : 7 | |
[6bc76537] | 14 | // |
15 | ||
16 | struct S { | |
[6dfed1f] | 17 | int i; |
[6bc76537] | 18 | }; |
19 | ||
20 | struct T { | |
[6dfed1f] | 21 | S s; |
[6bc76537] | 22 | }; |
23 | ||
24 | int main() { | |
[6dfed1f] | 25 | int j = 0; |
26 | S s = { 0 }; | |
27 | T t = { { 0 } }; | |
[6bc76537] | 28 | |
[6dfed1f] | 29 | j = j; |
30 | s = s; | |
31 | s.i = s.i; | |
32 | t.s.i = t.s.i; | |
[66812dd] | 33 | |
[53692b3] | 34 | #pragma GCC warning "Compiled" // force non-empty .expect file, NO TABS!!! |
[6bc76537] | 35 | } |
36 | ||
37 | // Local Variables: // | |
38 | // tab-width: 4 // | |
[66812dd] | 39 | // compile-command: "cfa self-assignment.cfa" // |
[6bc76537] | 40 | // End: // |
Note: See TracBrowser
for help on using the repository browser.