[llvm-commits] [llvm] r42198 - /llvm/trunk/test/CFrontend/2007-09-20-GcrootAttribute.c

Chris Lattner sabre at nondot.org
Fri Sep 21 10:48:40 PDT 2007


Author: lattner
Date: Fri Sep 21 12:48:39 2007
New Revision: 42198

URL: http://llvm.org/viewvc/llvm-project?rev=42198&view=rev
Log:
gcroot testcase, patch by Eric Christopher.

Added:
    llvm/trunk/test/CFrontend/2007-09-20-GcrootAttribute.c

Added: llvm/trunk/test/CFrontend/2007-09-20-GcrootAttribute.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CFrontend/2007-09-20-GcrootAttribute.c?rev=42198&view=auto

==============================================================================
--- llvm/trunk/test/CFrontend/2007-09-20-GcrootAttribute.c (added)
+++ llvm/trunk/test/CFrontend/2007-09-20-GcrootAttribute.c Fri Sep 21 12:48:39 2007
@@ -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;
+}





More information about the llvm-commits mailing list