2016-07-13 Thomas Preud'homme <thomas.preudhomme@arm.com>
[official-gcc.git] / gcc / testsuite / gcc.target / arm / pr42574.c
blobe3476f37788a2b3144454aef04a9b45c0b4ac398
1 /* { dg-do compile { arm_thumb1_ok && { ! arm_thumb1_movt_ok } } } */
2 /* { dg-options "-mthumb -Os -fpic" } */
3 /* { dg-require-effective-target fpic } */
4 /* Make sure the address of glob.c is calculated only once and using
5 a logical shift for the offset (200<<1). */
6 /* { dg-final { scan-assembler-times "lsl" 1 } } */
8 struct A {
9 char a[400];
10 float* c;
12 struct A glob;
13 void func();
14 void func1(float*);
15 int func2(float*, int*);
16 void func3(float*);
18 void test(int *p) {
19 func1(glob.c);
20 if (func2(glob.c, p)) {
21 func();
23 func3(glob.c);