1 // REQUIRES: objc-gnustep
2 // XFAIL: system-windows
4 // RUN: %build %s --compiler=clang --objc-gnustep --output=%t
6 #import "objc/runtime.h"
11 #ifdef __has_attribute
12 #if __has_attribute(objc_root_class)
13 __attribute__((objc_root_class))
16 @interface NSObject <NSCoding> {
21 @implementation NSObject
23 return object_getClass(self);
26 return class_createInstance(self, 0);
30 @interface TestObj : NSObject {
35 NSObject *_ptr_nsobject;
38 - (void)check_ivars_zeroed;
41 @implementation TestObj
42 - (void)check_ivars_zeroed {
50 _ptr_nsobject = (NSObject*)5;
55 // RUN: %lldb -b -o "b objc-gnustep-print.m:43" -o "run" -o "p self" -o "p *self" -- %t | FileCheck %s --check-prefix=SELF
57 // SELF: (lldb) b objc-gnustep-print.m:43
58 // SELF: Breakpoint {{.*}} at objc-gnustep-print.m
61 // SELF: Process {{[0-9]+}} stopped
62 // SELF: -[TestObj check_ivars_zeroed](self=[[SELF_PTR:0x[0-9a-f]+]]{{.*}}) at objc-gnustep-print.m
64 // SELF: (lldb) p self
65 // SELF: (TestObj *) [[SELF_PTR]]
67 // SELF: (lldb) p *self
76 // SELF: _ptr_void = 0x{{0*}}
77 // SELF: _ptr_nsobject = nil
78 // SELF: _id_objc = nil
81 // RUN: %lldb -b -o "b objc-gnustep-print.m:106" -o "run" -o "p t->_int" -o "p t->_float" -o "p t->_char" \
82 // RUN: -o "p t->_ptr_void" -o "p t->_ptr_nsobject" -o "p t->_id_objc" -- %t | FileCheck %s --check-prefix=IVARS_SET
84 // IVARS_SET: (lldb) p t->_int
87 // IVARS_SET: (lldb) p t->_float
88 // IVARS_SET: (float) 2
90 // IVARS_SET: (lldb) p t->_char
91 // IVARS_SET: (char) '\x03'
93 // IVARS_SET: (lldb) p t->_ptr_void
94 // IVARS_SET: (void *) 0x{{0*}}4
96 // IVARS_SET: (lldb) p t->_ptr_nsobject
97 // IVARS_SET: (NSObject *) 0x{{0*}}5
99 // IVARS_SET: (lldb) p t->_id_objc
100 // IVARS_SET: (id) 0x{{0*}}6
103 TestObj *t = [TestObj new];
104 [t check_ivars_zeroed];