diff options
author | Stam Markianos-Wright <stam.markianos-wright@arm.com> | 2020-11-25 12:50:06 +0000 |
---|---|---|
committer | Stam Markianos-Wright <stam.markianos-wright@arm.com> | 2020-11-25 12:59:19 +0000 |
commit | bc771e6c3a2b1fe74328639a00531fc0c3923e43 (patch) | |
tree | 71b419d582085a293f034299c183db602de5594a | |
parent | a5ccfd04605d940daded7e95474389f1c7dfad61 (diff) | |
download | gcc-bc771e6c3a2b1fe74328639a00531fc0c3923e43.zip gcc-bc771e6c3a2b1fe74328639a00531fc0c3923e43.tar.gz gcc-bc771e6c3a2b1fe74328639a00531fc0c3923e43.tar.bz2 |
arm: Add test that was missing from old commit [PR91816]
A while back I submitted GCC10 commit:
44f77a6dea2f312ee1743f3dde465c1b8453ee13
for PR91816.
Turns out I was an idiot and forgot to include the test in the actual git commit.
Tested that the test still passes on a cross arm-none-eabi and also in a
Cortex A-15 bootstrap with no regressions.
gcc/testsuite/ChangeLog:
PR target/91816
* gcc.target/arm/pr91816.c: New test.
-rw-r--r-- | gcc/testsuite/gcc.target/arm/pr91816.c | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/arm/pr91816.c b/gcc/testsuite/gcc.target/arm/pr91816.c new file mode 100644 index 0000000..b0a0ea1 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/pr91816.c @@ -0,0 +1,63 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_thumb2_ok } */ +/* { dg-additional-options "-mthumb" } */ +/* { dg-timeout-factor 4.0 } */ + +int printf(const char *, ...); + +#define HW0 printf("Hello World!\n"); +#define HW1 HW0 HW0 HW0 HW0 HW0 HW0 HW0 HW0 HW0 HW0 +#define HW2 HW1 HW1 HW1 HW1 HW1 HW1 HW1 HW1 HW1 HW1 +#define HW3 HW2 HW2 HW2 HW2 HW2 HW2 HW2 HW2 HW2 HW2 +#define HW4 HW3 HW3 HW3 HW3 HW3 HW3 HW3 HW3 HW3 HW3 +#define HW5 HW4 HW4 HW4 HW4 HW4 HW4 HW4 HW4 HW4 HW4 + +__attribute__((noinline,noclone)) void f1 (int a) +{ + if (a) { HW0 } +} + +__attribute__((noinline,noclone)) void f2 (int a) +{ + if (a) { HW3 } +} + + +__attribute__((noinline,noclone)) void f3 (int a) +{ + if (a) { HW5 } +} + +__attribute__((noinline,noclone)) void f4 (int a) +{ + if (a == 1) { HW0 } +} + +__attribute__((noinline,noclone)) void f5 (int a) +{ + if (a == 1) { HW3 } +} + + +__attribute__((noinline,noclone)) void f6 (int a) +{ + if (a == 1) { HW5 } +} + + +int main(void) +{ + f1(0); + f2(0); + f3(0); + f4(0); + f5(0); + f6(0); + return 0; +} + + +/* { dg-final { scan-assembler-times "beq\\t.L\[0-9\]" 2 } } */ +/* { dg-final { scan-assembler-times "beq\\t.Lbcond\[0-9\]" 1 } } */ +/* { dg-final { scan-assembler-times "bne\\t.L\[0-9\]" 2 } } */ +/* { dg-final { scan-assembler-times "bne\\t.Lbcond\[0-9\]" 1 } } */ |