mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-15 20:06:46 +00:00
bb8f59003c
automatically. Use -S with llvm-gcc rather than -c, so tests can work when llvm-gcc is really dragonegg (which can output IR with -S but not -c). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120158 91177308-0d34-0410-b5e6-96231b3b80d8
30 lines
410 B
C
30 lines
410 B
C
// RUN: %llvmgcc -S %s -o - | grep llvm.gcroot
|
|
// RUN: %llvmgcc -S %s -o - | grep llvm.gcroot | count 6
|
|
// RUN: %llvmgcc -S %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;
|
|
}
|