mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-28 06:32:09 +00:00
gcroot testcase, patch by Eric Christopher.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42198 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0d76789337
commit
68471d5289
28
test/CFrontend/2007-09-20-GcrootAttribute.c
Normal file
28
test/CFrontend/2007-09-20-GcrootAttribute.c
Normal file
@ -0,0 +1,28 @@
|
||||
// RUN: %llvmgxx -S -emit-llvm %s -o - | grep llvm.gcroot
|
||||
// RUN: %llvmgxx -S -emit-llvm %s -o - | grep llvm.gcroot | count 6
|
||||
|
||||
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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user