1 /* { dg-do run } */ 2 3 __attribute__ ((noinline, noclone)) int foo(char * c)4foo (char *c) 5 { 6 asm volatile ("" : : "r" (c) : "memory"); 7 return 1; 8 } 9 10 __attribute__ ((noinline, noclone)) void bar(char * c)11bar (char *c) 12 { 13 asm volatile ("" : : "r" (c) : "memory"); 14 } 15 main()16int main () 17 { 18 char tpl[20] = "/tmp/test.XXXXXX"; 19 char tpl2[20] = "/tmp/test.XXXXXX"; 20 int fd = foo (tpl); 21 int fd2 = foo (tpl2); 22 if (fd == -1) 23 { 24 if (fd2 != -1) 25 bar (tpl2); 26 return 1; 27 } 28 29 if (fd2 == -1) 30 return 1; 31 32 bar (tpl); 33 bar (tpl2); 34 35 if (__builtin_strcmp (tpl, "/tmp/test.XXXXXX") != 0) 36 return 1; 37 38 if (__builtin_strcmp (tpl, tpl2) != 0) 39 return 1; 40 41 return 0; 42 } 43