libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-prof / pr59521-3.c
blob002321766959172cde62d8c5d311c8ea004452ae
1 /* { dg-options "-O2 -save-temps" } */
3 #include <stdio.h>
5 __attribute__((noinline,noclone)) void
6 sink(const char *s) {
7 asm("" :: "r"(s));
10 void
11 foo(int ch) {
12 switch (ch) {
13 case 100: sink("100"); break;
14 case 10: sink("10"); break;
15 case 1: sink("1"); break;
19 int main()
21 for (int i = 0; i < 10000; i++)
23 int v;
24 if (i % 100 == 0)
25 v = 100;
26 else if(i % 10 == 0)
27 v = 10;
28 else
29 v = 1;
30 foo(v);
34 /* { dg-final-use-not-autofdo { scan-assembler "\n_?foo:\n.*cmp.*1,.*cmp.*10,.*cmp.*100" { target i?86-*-* x86_64-*-* } } } */