1 From 3b1edd4b9f4502b3b91134bfa496c1a54bb13c7f Mon Sep 17 00:00:00 2001
2 From: Richard Lowe <richlowe@richlowe.net>
3 Date: Tue, 4 Mar 2014 02:58:33 +0000
4 Subject: [PATCH 07/34] strict-cc2: check that disabling function cloning
5 prevents constant propagation eliding or changing arguments
8 .../gcc.dg/fno-clone-preserves-unused-args.c | 28 +++++++++++++++++++
9 1 file changed, 28 insertions(+)
10 create mode 100644 gcc/testsuite/gcc.dg/fno-clone-preserves-unused-args.c
12 diff --git a/gcc/testsuite/gcc.dg/fno-clone-preserves-unused-args.c b/gcc/testsuite/gcc.dg/fno-clone-preserves-unused-args.c
14 index 00000000000..0955381c848
16 +++ b/gcc/testsuite/gcc.dg/fno-clone-preserves-unused-args.c
18 +/* { dg-do compile { target { ilp32 } } } */
19 +/* { dg-options "-O2 -funit-at-a-time -fipa-sra -fno-clone-functions" } */
20 +/* { dg-final { scan-assembler "pushl.*\\\$1" } } */
21 +/* { dg-final { scan-assembler "pushl.*\\\$2" } } */
22 +/* { dg-final { scan-assembler "pushl.*\\\$3" } } */
23 +/* { dg-final { scan-assembler "pushl.*\\\$4" } } */
24 +/* { dg-final { scan-assembler "pushl.*\\\$5" } } */
29 + * Verify that preventing function cloning prevents constant prop/scalar
30 + * reduction removing parameters
33 +t(int, int, int, int, int) __attribute__ ((noinline));
40 +/* Only use 3 params, bait constprop/sra into deleting the other two */
42 +t(int a, int b, int c, int d, int e)
44 + printf("%d %d\n", a, b, c);