old-cross-binutils/gdb/testsuite/gdb.dwarf2/clztest.c
Tom Tromey 9930639c02 gdb
* dwarf2expr.c (read_uleb128): Cast intermediate result.
	(read_sleb128): Likewise.
gdb/testsuite
	* gdb.dwarf2/clztest.exp: New file.
	* gdb.dwarf2/clztest.c: New file.
	* gdb.dwarf2/clztest.S: New file.
2011-05-13 18:54:59 +00:00

33 lines
680 B
C

/* { dg-do run { target { x86_64-*-* && lp64 } } } */
/* { dg-options "-g" } */
volatile int vv;
__attribute__((noinline, noclone)) long
foo (long x)
{
long f = __builtin_clzl (x);
long g = f;
asm volatile ("" : "+r" (f));
vv++; /* { dg-final { gdb-test 12 "g" "43" } } */
return f; /* { dg-final { gdb-test 12 "f" "43" } } */
}
__attribute__((noinline, noclone)) long
bar (long x)
{
long f = __builtin_clzl (x);
long g = f;
asm volatile ("" : "+r" (f));
vv++; /* { dg-final { gdb-test 22 "g" "33" } } */
return f; /* { dg-final { gdb-test 22 "f" "33" } } */
}
int
main ()
{
long x = vv;
foo (x + 0x123456UL);
bar (x + 0x7fffffffUL);
return 0;
}