Imported Upstream version 4.8.1
[platform/upstream/gcc48.git] / gcc / testsuite / gcc.target / i386 / pr56151.c
1 /* PR rtl-optimization/56151 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2" } */
4
5 int vara, varb;
6
7 void
8 foo (int i, int j)
9 {
10   vara = varb | vara;
11 }
12
13 /* Verify the above is compiled into movl varb, %reg; orl %reg, vara instead
14    of longer movl vara, %reg; orl varb, %reg; movl %reg, vara.  */
15 /* { dg-final { scan-assembler-not "mov\[^\n\r]*vara" { target nonpic } } } */
16 /* { dg-final { scan-assembler-times "mov\[^\n\r]*varb" 1 { target nonpic } } } */
17 /* { dg-final { scan-assembler-times "or\[^\n\r]*vara" 1 { target nonpic } } } */