1 /* Test the noipa attribute. */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fdump-tree-optimized" } */
4 /* { dg-require-effective-target alloca } */
6 static inline int __attribute__((noipa
))
7 fn1 (void) /* { dg-warning "inline function \[^\n\]* given attribute 'noinline'" "" } */
12 /* Verify the function is not inlined into its caller. */
14 static __attribute__((noipa
)) int
26 /* { dg-final { scan-tree-dump "= fn2 \\(" "optimized" } } */
30 /* Verify the function is not cloned. */
32 __attribute__((__noipa__
)) static int
35 char *p
= __builtin_alloca (x
+ y
);
46 /* { dg-final { scan-tree-dump "= fn5 \\(" "optimized" } } */
47 /* { dg-final { scan-tree-dump-not "fn5\\.constprop" "optimized" } } */
49 /* Verify we still remove unused function calls, even if they have
52 static void fn7 (void) __attribute__((noipa
));
58 /* { dg-final { scan-tree-dump-not "fn7 \\(" "optimized" } } */
60 /* Verify noipa functions are not ICF optimized. */
62 static __attribute__((noipa
)) int
68 static __attribute__((noipa
)) int
77 return fn8 (x
) + fn9 (x
);
80 /* { dg-final { scan-tree-dump "fn8 \\(int" "optimized" } } */
81 /* { dg-final { scan-tree-dump "fn9 \\(int" "optimized" } } */
83 /* Verify IPA-VRP is not performed. */
87 static int __attribute__((noipa
))
100 /* { dg-final { scan-tree-dump "fn11 \\(\\)" "optimized" } } */
104 __attribute__((noipa
)) static int
118 /* { dg-final { scan-tree-dump "fn14 \\(\\)" "optimized" } } */
120 /* Verify IPA BIT CP is not performed. */
124 __attribute__((noipa
)) static int
142 /* { dg-final { scan-tree-dump "fn17 \\(\\)" "optimized" } } */
144 /* Ensure pure/const discovery is not performed. */
149 __attribute__((noipa
)) static int
159 asm volatile ("" : "+g" (var1
) : : "memory");
167 /* { dg-final { scan-tree-dump "fn20 \\(\\)" "optimized" } } */
169 /* Verify IPA alignment propagation is not performed. */
171 static __attribute__ ((aligned(16))) char var2
[32];
174 __attribute__((noipa
)) static void
177 if ((((__UINTPTR_TYPE__
) p
) & 15) != 0)
189 /* { dg-final { scan-tree-dump "fn20 \\(\\)" "optimized" } } */