[Lldb-commits] [lldb] r234348 - Made the struct types test case a little stricter,
Sean Callanan
scallanan at apple.com
Tue Apr 7 13:19:37 PDT 2015
Author: spyffe
Date: Tue Apr 7 15:19:37 2015
New Revision: 234348
URL: http://llvm.org/viewvc/llvm-project?rev=234348&view=rev
Log:
Made the struct types test case a little stricter,
by verifying that we can pass a struct-typed variable
to a function that takes structs.
Modified:
lldb/trunk/test/lang/c/struct_types/main.c
Modified: lldb/trunk/test/lang/c/struct_types/main.c
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/struct_types/main.c?rev=234348&r1=234347&r2=234348&view=diff
==============================================================================
--- lldb/trunk/test/lang/c/struct_types/main.c (original)
+++ lldb/trunk/test/lang/c/struct_types/main.c Tue Apr 7 15:19:37 2015
@@ -6,6 +6,18 @@
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
+
+struct things_to_sum {
+ int a;
+ int b;
+ int c;
+};
+
+int sum_things(struct things_to_sum tts)
+{
+ return tts.a + tts.b + tts.c;
+}
+
int main (int argc, char const *argv[])
{
struct point_tag {
@@ -23,5 +35,9 @@ int main (int argc, char const *argv[])
};
struct point_tag pt = { 2, 3, {} };
struct rect_tag rect = {{1, 2, {}}, {3, 4, {}}};
- return 0; //% self.expect("expression -- &pt == (struct point_tag*)0", substrs = ['false'])
+ struct things_to_sum tts = { 2, 3, 4 };
+
+ int sum = sum_things(tts); //% self.expect("expression -- &pt == (struct point_tag*)0", substrs = ['false'])
+ //% self.expect("expression -- sum_things(tts)", substrs = ['9'])
+ return 0;
}
More information about the lldb-commits
mailing list