xref: /netbsd-src/external/gpl3/gdb.old/dist/gdb/testsuite/gdb.dwarf2/clztest.c (revision a5a4af3bd380a7b58b758d9b311cef9f7c34aeb4)
1 /* { dg-do run { target { x86_64-*-* && lp64 } } } */
2 /* { dg-options "-g" } */
3 
4 volatile int vv;
5 
6 __attribute__((noinline, noclone)) long
foo(long x)7 foo (long x)
8 {
9   long f = __builtin_clzl (x);
10   long g = f;
11   asm volatile ("" : "+r" (f));
12   vv++;		/* { dg-final { gdb-test 12 "g" "43" } } */
13   return f;	/* { dg-final { gdb-test 12 "f" "43" } } */
14 }
15 
16 __attribute__((noinline, noclone)) long
bar(long x)17 bar (long x)
18 {
19   long f = __builtin_clzl (x);
20   long g = f;
21   asm volatile ("" : "+r" (f));
22   vv++;		/* { dg-final { gdb-test 22 "g" "33" } } */
23   return f;	/* { dg-final { gdb-test 22 "f" "33" } } */
24 }
25 
26 int
main()27 main ()
28 {
29   long x = vv;
30   foo (x + 0x123456UL);
31   bar (x + 0x7fffffffUL);
32   return 0;
33 }
34