mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-01 16:33:37 +01:00
eb3cd5e822
llvm-svn: 51695
30 lines
443 B
C
30 lines
443 B
C
// RUN: %llvmgcc -S -emit-llvm %s -o - | grep llvm.gcroot
|
|
// RUN: %llvmgcc -S -emit-llvm %s -o - | grep llvm.gcroot | count 6
|
|
// RUN: %llvmgcc -S -emit-llvm %s -o - | llvm-as
|
|
|
|
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;
|
|
}
|