Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/guality/sra-1.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
1 /* PR debug/43983 */ | 1 /* PR debug/43983 */ |
2 /* { dg-do run } */ | 2 /* { dg-do run } */ |
3 /* { dg-options "-g" } */ | 3 /* { dg-options "-g -fno-ipa-icf" } */ |
4 | 4 |
5 struct A { int i; int j; }; | 5 struct A { int i; int j; }; |
6 struct B { int : 4; int i : 12; int j : 12; int : 4; }; | 6 struct B { int : 4; int i : 12; int j : 12; int : 4; }; |
7 | 7 |
8 __attribute__((noinline)) void | 8 __attribute__((noinline)) void |
15 f1 (int k) | 15 f1 (int k) |
16 { | 16 { |
17 struct A a = { 4, k + 6 }; | 17 struct A a = { 4, k + 6 }; |
18 asm ("" : "+r" (a.i)); | 18 asm ("" : "+r" (a.i)); |
19 a.j++; | 19 a.j++; |
20 bar (a.i); /* { dg-final { gdb-test 21 "a.i" "4" } } */ | 20 bar (a.i); /* { dg-final { gdb-test .+1 "a.i" "4" } } */ |
21 bar (a.j); /* { dg-final { gdb-test 21 "a.j" "14" } } */ | 21 bar (a.j); /* { dg-final { gdb-test . "a.j" "14" } } */ |
22 return a.i + a.j; | 22 return a.i + a.j; |
23 } | 23 } |
24 | 24 |
25 __attribute__((noinline)) int | 25 __attribute__((noinline)) int |
26 f2 (int k) | 26 f2 (int k) |
27 { | 27 { |
28 int a[2] = { 4, k + 6 }; | 28 int a[2] = { 4, k + 6 }; |
29 asm ("" : "+r" (a[0])); | 29 asm ("" : "+r" (a[0])); |
30 a[1]++; | 30 a[1]++; |
31 bar (a[0]); /* { dg-final { gdb-test 32 "a\[0\]" "4" } } */ | 31 bar (a[0]); /* { dg-final { gdb-test .+1 "a\[0\]" "4" } } */ |
32 bar (a[1]); /* { dg-final { gdb-test 32 "a\[1\]" "14" } } */ | 32 bar (a[1]); /* { dg-final { gdb-test . "a\[1\]" "14" } } */ |
33 return a[0] + a[1]; | 33 return a[0] + a[1]; |
34 } | 34 } |
35 | 35 |
36 __attribute__((noinline)) int | 36 __attribute__((noinline)) int |
37 f3 (int k) | 37 f3 (int k) |
38 { | 38 { |
39 struct B a = { 4, k + 6 }; | 39 struct B a = { 4, k + 6 }; |
40 asm ("" : "+r" (a.i)); | 40 asm ("" : "+r" (a.i)); |
41 a.j++; | 41 a.j++; |
42 bar (a.i); /* { dg-final { gdb-test 43 "a.i" "4" } } */ | 42 bar (a.i); /* { dg-final { gdb-test .+1 "a.i" "4" } } */ |
43 bar (a.j); /* { dg-final { gdb-test 43 "a.j" "14" } } */ | 43 bar (a.j); /* { dg-final { gdb-test . "a.j" "14" } } */ |
44 return a.i + a.j; | 44 return a.i + a.j; |
45 } | 45 } |
46 | 46 |
47 int | 47 int |
48 main (void) | 48 main (void) |