2007-09-26 15:28:20 +08:00
|
|
|
// RUN: %llvmgcc -S -emit-llvm %s -o - | grep llvm.gcroot
|
|
|
|
// RUN: %llvmgcc -S -emit-llvm %s -o - | grep llvm.gcroot | count 6
|
2007-12-30 13:45:49 +08:00
|
|
|
// RUN: %llvmgcc -S -emit-llvm %s -o - | llvm-as
|
2007-09-22 01:48:39 +08:00
|
|
|
|
|
|
|
typedef struct foo_s
|
|
|
|
{
|
|
|
|
int a;
|
|
|
|
} foo, __attribute__ ((gcroot)) *foo_p;
|
|
|
|
|
|
|
|
foo my_foo;
|
|
|
|
|
|
|
|
int alpha ()
|
|
|
|
{
|
|
|
|
foo my_foo2 = my_foo;
|
|
|
|
|
|
|
|
return my_foo2.a;
|
|
|
|
}
|
|
|
|
|
|
|
|
int bar (foo a)
|
|
|
|
{
|
|
|
|
foo_p b;
|
|
|
|
return b->a;
|
|
|
|
}
|
|
|
|
|
|
|
|
foo_p baz (foo_p a, foo_p b, foo_p *c)
|
|
|
|
{
|
|
|
|
a = b = *c;
|
|
|
|
return a;
|
|
|
|
}
|