Hi,
I am trying to learn a bit more about working on clang C++ support. I
think the test setup is quite nice and I made a stab at a
test/cxx-extern.cpp which emit some errors for C++ uses of the extern
keyword that I will try to fix parsing and AST for. Preprossessing of
extern and assosiated tokens seems to be Ok.
However, there are other tests that fail on my platform (RedHat FC4 and
GCC 4.0.2)
make | grep FAILED! | uniq | sed "s%*%%g"
TEST 'CodeGen/mandel.c' FAILED!
TEST 'Parser/cxx-extern.cpp' FAILED!
TEST 'Sema/undecl-objc-h.m' FAILED!
TEST 'Sema/protocol-rewrite-1.m' FAILED!
TEST 'Sema/objc-comptypes-2.m' FAILED!
TEST 'Sema/objc-comptypes-6.m' FAILED!
TEST 'Sema/undef-field-reference-1.m' FAILED!
TEST 'Sema/rewrite-protocol-type-1.m' FAILED!
TEST 'Sema/objc-super-test.m' FAILED!
TEST 'Sema/objc-comptypes-1.m' FAILED!
TEST 'Sema/objc-comptypes-3.m' FAILED!
TEST 'Sema/objc-comptypes-5.m' FAILED!
TEST 'Sema/objc-comptypes-7.m' FAILED!
TEST 'Sema/rewrite-api-bug.m' FAILED!
TEST 'Sema/id-test-3.m' FAILED!
see attached clang-test.txt for details. Many of the objc problems have
the same root cause, but I do not feel like hacking evrywhere in clang
yet ;-). Don't really know anything about Objective-C anyway. I am kind
of in the dark here. Are these known issues that I should ignore or not?
Are there any status available, nightly build report or similar, for
various platforms? I found http://llvm.org/nightlytest/index.php. But
are these relevant for clang?
--
Bjørn
-*- compilation -*-
cd /dsk1/src/llvm-svn/llvm/tools/clang/test/
make -k
PATH=$PATH:/dsk1/src/llvm-svn/llvm/Debug/bin:/dsk1/src/llvm-svn/llvm/test/Scripts
find\
CodeGen Lexer Preprocessor Parser Sema Analysis Serialization\
\( -name '*.c' -or -name '*.cpp' -or -name '*.m' \)\
-print -exec ./TestRunner.sh {} \;
CodeGen/writable-strings.c
CodeGen/OpaqueStruct.c
CodeGen/2007-11-29-ArraySizeFromInitializer.c
CodeGen/mandel.c
******************** TEST 'CodeGen/mandel.c' FAILED! ********************
Command:
clang -emit-llvm CodeGen/mandel.c
Output:
CodeGen/mandel.c:49:13: error: variable has incomplete type 'typeof(*(0 ?
(typeof(0 ? (double *)0 : (void *)((((typeof((__real z) + (__imag z)))0.25) &&
((typeof((__real z) + (__imag z)))0.25 - 1)))))0 : (typeof(0 ? (typeof((__real
z) + (__imag z)) *)0 : (void *)(!((((typeof((__real z) + (__imag z)))0.25) &&
((typeof((__real z) + (__imag z)))0.25 - 1))))))0))'
if (hypot(__real__ z, __imag__ z) >= ESCAPE)
^
CodeGen/mandel.c:49:43: error: invalid operands to binary expression ('void'
and 'int')
if (hypot(__real__ z, __imag__ z) >= ESCAPE)
~~~~~ ^ ~~~~~~
2 diagnostics generated.
; ModuleID = 'foo'
target datalayout =
"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
target triple = "i686-pc-linux-gnu"
@accum = global { double, double } zeroinitializer ; <{ double,
double }*> [#uses=0]
******************** TEST 'CodeGen/mandel.c' FAILED! ********************
CodeGen/string-literal.c
CodeGen/typedef.c
CodeGen/complex.c
CodeGen/switch.c
CodeGen/enum.c
CodeGen/conditional.c
CodeGen/shared-string-literals.c
CodeGen/pointer-arithmetic.c
CodeGen/functions.c
CodeGen/dostmt.c
CodeGen/staticinit.c
CodeGen/func-return-member.c
CodeGen/array.c
CodeGen/cfstring.c
CodeGen/whilestmt.c
CodeGen/globalinit.c
CodeGen/compound.c
CodeGen/global-with-initialiser.c
CodeGen/struct.c
CodeGen/ocu-vector.c
CodeGen/struct-x86-darwin.c
CodeGen/int-to-pointer.c
CodeGen/pointer-to-int.c
CodeGen/conditional-gnu-ext.c
CodeGen/union.c
CodeGen/trunc-array-initializer.c
CodeGen/cast.c
Lexer/cxx0x_keyword.cpp
Lexer/pragma-mark.c
Lexer/badstring_in_if0.c
Lexer/11-27-2007-FloatLiterals.c
Lexer/escape_newline.c
Lexer/block_cmt_end.c
Lexer/number.c
Lexer/unknown-char.c
Lexer/cxx0x_keyword_as_cxx98.cpp
Lexer/c90.c
Lexer/constants.c
Preprocessor/define_other_target.c
Preprocessor/macro_expandloc.c
Preprocessor/comment_save_if.c
Preprocessor/macro_expand.c
Preprocessor/macro_fn_disable_expand.c
Preprocessor/macro_paste_spacing.c
Preprocessor/cxx_or.cpp
Preprocessor/macro_paste_bad.c
Preprocessor/poison.c
Preprocessor/macro_fn_comma_swallow.c
Preprocessor/macro_paste_empty.c
Preprocessor/stringize_space2.c
Preprocessor/macro_paste_none.c
Preprocessor/macro_fn_varargs_named.c
Preprocessor/disabled-cond-diags.c
Preprocessor/expr_usual_conversions.c
Preprocessor/macro_expandloc2.c
Preprocessor/comment_save.c
Preprocessor/paste_bad.c
Preprocessor/includeexpand.c
Preprocessor/_Pragma-physloc.c
Preprocessor/print_line_track.c
Preprocessor/stringize_space.c
Preprocessor/macro_fn_placemarker.c
Preprocessor/macro_rescan.c
Preprocessor/macro_rparen_scan2.c
Preprocessor/define_target.c
Preprocessor/cxx_true.cpp
Preprocessor/macro_paste_hashhash.c
Preprocessor/function_macro_file.c
Preprocessor/macro_disable2.c
Preprocessor/macro_paste_simple.c
Preprocessor/macro_disable4.c
Preprocessor/_Pragma-poison.c
Preprocessor/output_paste_avoid.c
Preprocessor/macro_defined.c
Preprocessor/c99-6_10_3_4_p5.c
Preprocessor/macro_rescan_varargs.c
Preprocessor/c99-6_10_3_4_p7.c
Preprocessor/_Pragma-dependency.c
Preprocessor/cxx_not.cpp
Preprocessor/cxx_and.cpp
Preprocessor/c99-6_10_3_4_p9.c
Preprocessor/cxx_oper_spelling.cpp
Preprocessor/expr_liveness.c
Preprocessor/pragma_unknown.c
Preprocessor/cxx_xor.cpp
Preprocessor/cxx_oper_keyword.cpp
Preprocessor/macro_paste_c_block_comment.c
Preprocessor/macro_arg_keyword.c
Preprocessor/hash_space.c
Preprocessor/comment_save_macro.c
Preprocessor/_Pragma-syshdr2.c
Preprocessor/includeexpand2.c
Preprocessor/macro_rparen_scan.c
Preprocessor/c99-6_10_3_3_p4.c
Preprocessor/ifdef-recover.c
Preprocessor/import_self.c
Preprocessor/macro_disable.c
Preprocessor/stringize_misc.c
Preprocessor/macro_fn_preexpand.c
Preprocessor/hash_line.c
Preprocessor/poison_expansion.c
Preprocessor/cxx_bitor.cpp
Preprocessor/indent_macro.c
Preprocessor/macro_disable3.c
Preprocessor/cxx_not_eq.cpp
Preprocessor/macro_paste_bcpl_comment.c
Preprocessor/macro_fn_lparen_scan2.c
Preprocessor/_Pragma-location.c
Preprocessor/macro_space.c
Preprocessor/builtin_line.c
Preprocessor/macro_rescan2.c
Preprocessor/c99-6_10_3_4_p6.c
Preprocessor/_Pragma-syshdr.c
Preprocessor/macro_fn_varargs_iso.c
Preprocessor/cxx_bitand.cpp
Preprocessor/macro_fn_lparen_scan.c
Preprocessor/macro_paste_hard.c
Preprocessor/macro_not_define.c
Preprocessor/cxx_compl.cpp
Parser/cxx-reference.cpp
Parser/if-scope-c90.c
Parser/goto-ident.c
Parser/types.c
Parser/char-literal-printing.c
Parser/objc-messaging-1.m
Parser/declarators.c
Parser/objc-quirks.m
Parser/typeof.c
Parser/encode.m
Parser/argument_qualified.c
Parser/pointer-arithmetic.c
Parser/if-scope-c99.c
Parser/enhanced-proto-1.m
Parser/argument_scope.c
Parser/extension.c
Parser/c-namespace.c
Parser/function-decls.c
Parser/builtin_types_compatible.c
Parser/ocu_vector_components.c
Parser/objc-try-catch-1.m
Parser/expressions.c
Parser/namelookup-bug-1.c
Parser/namelookup-bug-2.c
Parser/implicit-casts.c
Parser/CompoundStmtScope.c
Parser/attributes.c
Parser/argument_redef.c
Parser/control-scope.c
Parser/statements.c
Parser/cxx-casting.cpp
Parser/selector-1.m
Parser/builtin_classify_type.c
Parser/method-prototype-1.m
Parser/cxx-bool.cpp
Parser/struct-recursion.c
Parser/expressions.m
Parser/recovery-1.c
Parser/objc-type-printing.m
Parser/compound_literal.c
Parser/portability.c
Parser/bad-control.c
Parser/check_cast.c
Parser/asm.c
Parser/parmvardecl_conversion.c
Parser/check-objc2-syntax-1.m
Parser/objc-alias-printing.m
Parser/promote_types_in_proto.c
Parser/pointer_promotion.c
Parser/cxx-extern.cpp
******************** TEST 'Parser/cxx-extern.cpp' FAILED! ********************
Command:
clang -fsyntax-only Parser/cxx-extern.cpp
Output:
Parser/cxx-extern.cpp:19:8: error: expected identifier or '('
extern "C" int g();
^
Parser/cxx-extern.cpp:20:8: error: expected identifier or '('
extern "C++" int h();
^
Parser/cxx-extern.cpp:21:8: error: expected identifier or '('
extern "FORTRAN" int F();
^
Parser/cxx-extern.cpp:24:8: error: expected identifier or '('
extern "C" {
^
4 diagnostics generated.
******************** TEST 'Parser/cxx-extern.cpp' FAILED! ********************
Sema/array-init.c
Sema/switch.c
Sema/init.c
Sema/carbon.c
Sema/conditional.c
Sema/static-type-protocol-1.m
Sema/argument-checking.m
Sema/static-ivar-ref-1.m
Sema/address-constant.c
Sema/forward-class-1.m
Sema/alias-test-1.m
Sema/class-proto-1.m
Sema/protocol-id-test-1.m
Sema/unused-expr.c
Sema/protocol-id-test-3.m
Sema/typedef-retain.c
Sema/floating-point-compare.c
Sema/typecheck-binop.c
Sema/undecl-objc-h.m
******************** TEST 'Sema/undecl-objc-h.m' FAILED! ********************
Command:
clang -rewrite-test Sema/undecl-objc-h.m | clang
Output:
In file included from <stdin>:23:
/usr/lib/gcc/i386-redhat-linux/4.0.2/include/objc/objc.h:145:3: error:
redefinition of 'Protocol'
} Protocol;
^
<stdin>:7:28: error: previous definition is here
typedef struct objc_object Protocol;
^
<stdin>:57:185: warning: incompatible types passing 'int' to function expecting
'SEL'
return ((int (*)(id, SEL, int))(void *)objc_msgSend)((id)self,
sel_registerName("another:"), (sizeof(NSRec) <= 8 ? ((NSRec (*)(id, SEL, NSRec,
NSRec))(void *)objc_msgSend)((id)self, sel_registerName("MainMethod::"),
self->d, self->d) : ((NSRec (*)(id, SEL, NSRec, NSRec))(void
*)objc_msgSend_stret)((id)self, sel_registerName("MainMethod::"), self->d,
self->d)).size);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<stdin>:57:312: warning: incompatible types passing 'int' to function expecting
'SEL'
return ((int (*)(id, SEL, int))(void *)objc_msgSend)((id)self,
sel_registerName("another:"), (sizeof(NSRec) <= 8 ? ((NSRec (*)(id, SEL, NSRec,
NSRec))(void *)objc_msgSend)((id)self, sel_registerName("MainMethod::"),
self->d, self->d) : ((NSRec (*)(id, SEL, NSRec, NSRec))(void
*)objc_msgSend_stret)((id)self, sel_registerName("MainMethod::"), self->d,
self->d)).size);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<stdin>:57:66: warning: incompatible types passing 'int' to function expecting
'SEL'
return ((int (*)(id, SEL, int))(void *)objc_msgSend)((id)self,
sel_registerName("another:"), (sizeof(NSRec) <= 8 ? ((NSRec (*)(id, SEL, NSRec,
NSRec))(void *)objc_msgSend)((id)self, sel_registerName("MainMethod::"),
self->d, self->d) : ((NSRec (*)(id, SEL, NSRec, NSRec))(void
*)objc_msgSend_stret)((id)self, sel_registerName("MainMethod::"), self->d,
self->d)).size);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 diagnostics generated.
******************** TEST 'Sema/undecl-objc-h.m' FAILED! ********************
Sema/if-empty-body.c
Sema/compare.c
Sema/merge-decls.c
Sema/protocol-rewrite-1.m
******************** TEST 'Sema/protocol-rewrite-1.m' FAILED!
********************
Command:
clang -rewrite-test Sema/protocol-rewrite-1.m | clang
Output:
In file included from <stdin>:23:
/usr/lib/gcc/i386-redhat-linux/4.0.2/include/objc/objc.h:145:3: error:
redefinition of 'Protocol'
} Protocol;
^
<stdin>:7:28: error: previous definition is here
typedef struct objc_object Protocol;
^
<stdin>:75:71: warning: incompatible types passing 'int' to function expecting
'SEL'
widget = ((MyWidget *(*)(id, SEL))(void *)objc_msgSend)((id)view,
sel_registerName("widget"));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^~~~~~~~~~~~~~~~~~~~~~~~~~
<stdin>:83:99: warning: incompatible types passing 'int' to function expecting
'SEL'
MyWidget *w = ((MyWidget *(*)(id, SEL, Foo *))(void
*)objc_msgSend)(objc_getClass("Container"),
sel_registerName("elementForView:"), (Foo *)view);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 diagnostics generated.
******************** TEST 'Sema/protocol-rewrite-1.m' FAILED!
********************
Sema/selector-1.m
Sema/void_arg.c
Sema/message.m
Sema/check-increment.c
Sema/array-constraint.c
Sema/self-comparison.c
Sema/implicit-int.c
Sema/c89-2.c
Sema/member-reference.c
Sema/typedef-prototype.c
Sema/metadata-test-1.m
Sema/varargs.c
Sema/ivar-sem-check-1.m
Sema/implicit-def.c
Sema/objc-comptypes-2.m
******************** TEST 'Sema/objc-comptypes-2.m' FAILED! ********************
Command:
clang -fsyntax-only -verify Sema/objc-comptypes-2.m
Output:
Errors seen but not expected:
Line 63: incomplete definition of type 'objc_selector'
******************** TEST 'Sema/objc-comptypes-2.m' FAILED! ********************
Sema/objc-comptypes-4.m
Sema/i-c-e1.c
Sema/objc-comptypes-6.m
******************** TEST 'Sema/objc-comptypes-6.m' FAILED! ********************
Command:
clang -fsyntax-only -verify Sema/objc-comptypes-6.m
Output:
Errors seen but not expected:
Line 63: incomplete definition of type 'objc_selector'
******************** TEST 'Sema/objc-comptypes-6.m' FAILED! ********************
Sema/for.c
Sema/class-conforming-protocol-1.m
Sema/method-encoding-1.m
Sema/undeclared-method-1.m
Sema/compound-literal.c
Sema/declspec.c
Sema/default.c
Sema/switch-duplicate-defaults.c
Sema/method-def-1.m
Sema/enum.c
Sema/conflicting-ivar-test-1.m
Sema/DoubleMethod.m
Sema/category-1.m
Sema/array-declared-as-incorrect-type.c
Sema/class-def-test-1.m
Sema/protocol-test-1.m
Sema/objc-unused.m
Sema/vla.c
Sema/undef-field-reference-1.m
******************** TEST 'Sema/undef-field-reference-1.m' FAILED!
********************
Command:
clang -rewrite-test Sema/undef-field-reference-1.m | clang
Output:
In file included from Sema/undef-field-reference-1.m:3:
/usr/lib/gcc/i386-redhat-linux/4.0.2/include/objc/objc.h:63:14: error:
incomplete definition of type 'objc_selector'
return s1->sel_id == s2->sel_id;
~~^
1 diagnostic generated.
In file included from <stdin>:23:
/usr/lib/gcc/i386-redhat-linux/4.0.2/include/objc/objc.h:145:3: error:
redefinition of 'Protocol'
} Protocol;
^
<stdin>:7:28: error: previous definition is here
typedef struct objc_object Protocol;
^
2 diagnostics generated.
******************** TEST 'Sema/undef-field-reference-1.m' FAILED!
********************
Sema/undefined-protocol-type-1.m
Sema/objc-string.m
Sema/undef-superclass-1.m
Sema/id_builtin.m
Sema/invalid-objc-decls-1.m
Sema/ivar-encoding-2.m
Sema/va-method.m
Sema/enhanced-proto-2.m
Sema/implicit-cast.c
Sema/stmt_exprs.c
Sema/offsetof.c
Sema/method-undef-category-warn-1.m
Sema/rewrite-protocol-type-1.m
******************** TEST 'Sema/rewrite-protocol-type-1.m' FAILED!
********************
Command:
clang -rewrite-test Sema/rewrite-protocol-type-1.m | clang
Output:
In file included from <stdin>:23:
/usr/lib/gcc/i386-redhat-linux/4.0.2/include/objc/objc.h:145:3: error:
redefinition of 'Protocol'
} Protocol;
^
<stdin>:7:28: error: previous definition is here
typedef struct objc_object Protocol;
^
2 diagnostics generated.
******************** TEST 'Sema/rewrite-protocol-type-1.m' FAILED!
********************
Sema/class-impl-1.m
Sema/builtins.c
Sema/objc-legacy-implementation-1.m
Sema/format-strings.c
Sema/check-dup-objc-decls-1.m
Sema/cxx-references.cpp
Sema/alias-test-2.m
Sema/protocol-id-test-2.m
Sema/arg-duplicate.c
Sema/objc-super-test.m
******************** TEST 'Sema/objc-super-test.m' FAILED! ********************
Command:
clang -rewrite-test Sema/objc-super-test.m | clang
Output:
In file included from Sema/objc-super-test.m:3:
/usr/lib/gcc/i386-redhat-linux/4.0.2/include/objc/objc.h:63:14: error:
incomplete definition of type 'objc_selector'
return s1->sel_id == s2->sel_id;
~~^
1 diagnostic generated.
In file included from <stdin>:23:
/usr/lib/gcc/i386-redhat-linux/4.0.2/include/objc/objc.h:145:3: error:
redefinition of 'Protocol'
} Protocol;
^
<stdin>:7:28: error: previous definition is here
typedef struct objc_object Protocol;
^
<stdin>:48:144: warning: incompatible types passing 'int' to function expecting
'SEL'
return ((int (*)(struct objc_super *, SEL))(void
*)objc_msgSendSuper)(&(struct objc_super){ (id)(SUPER *)self,
(id)objc_getClass("SUPER") }, sel_registerName("MainMethod"));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 diagnostics generated.
******************** TEST 'Sema/objc-super-test.m' FAILED! ********************
Sema/vector-assign.c
Sema/incompatible-protocol-qualified-types.m
Sema/method-not-defined.m
Sema/static-init.c
Sema/predefined-function.c
Sema/vector-cast.c
Sema/return-stack-addr.cpp
Sema/cocoa.m
Sema/ast-print.c
Sema/protocol-expr-neg-1.m
Sema/c89.c
Sema/i-c-e2.c
Sema/objc-string-concat-1.m
Sema/expr-address-of.c
Sema/shift.c
Sema/asm.c
Sema/selector-overload.m
Sema/metadata-test-2.m
Sema/objc-comptypes-1.m
******************** TEST 'Sema/objc-comptypes-1.m' FAILED! ********************
Command:
clang -fsyntax-only -verify Sema/objc-comptypes-1.m
Output:
Errors seen but not expected:
Line 63: incomplete definition of type 'objc_selector'
******************** TEST 'Sema/objc-comptypes-1.m' FAILED! ********************
Sema/objc-comptypes-3.m
******************** TEST 'Sema/objc-comptypes-3.m' FAILED! ********************
Command:
clang -fsyntax-only -verify Sema/objc-comptypes-3.m
Output:
Errors seen but not expected:
Line 63: incomplete definition of type 'objc_selector'
******************** TEST 'Sema/objc-comptypes-3.m' FAILED! ********************
Sema/objc-comptypes-5.m
******************** TEST 'Sema/objc-comptypes-5.m' FAILED! ********************
Command:
clang -fsyntax-only -verify Sema/objc-comptypes-5.m
Output:
Errors seen but not expected:
Line 63: incomplete definition of type 'objc_selector'
******************** TEST 'Sema/objc-comptypes-5.m' FAILED! ********************
Sema/undef-protocol-methods-1.m
Sema/objc-comptypes-7.m
******************** TEST 'Sema/objc-comptypes-7.m' FAILED! ********************
Command:
clang -fsyntax-only -verify Sema/objc-comptypes-7.m
Output:
Errors seen but not expected:
Line 63: incomplete definition of type 'objc_selector'
******************** TEST 'Sema/objc-comptypes-7.m' FAILED! ********************
Sema/method-encoding-2.m
Sema/rewrite-api-bug.m
******************** TEST 'Sema/rewrite-api-bug.m' FAILED! ********************
Command:
clang -rewrite-test Sema/rewrite-api-bug.m
Output:
In file included from Sema/rewrite-api-bug.m:3:
/usr/lib/gcc/i386-redhat-linux/4.0.2/include/objc/objc.h:63:14: error:
incomplete definition of type 'objc_selector'
return s1->sel_id == s2->sel_id;
~~^
1 diagnostic generated.
struct objc_selector; struct objc_class;
#ifndef OBJC_SUPER
struct objc_super { struct objc_object *o; struct objc_object *superClass; };
#define OBJC_SUPER
#endif
#ifndef _REWRITER_typedef_Protocol
typedef struct objc_object Protocol;
#define _REWRITER_typedef_Protocol
#endif
extern struct objc_object *objc_msgSend(struct objc_object *, struct
objc_selector *, ...);
extern struct objc_object *objc_msgSendSuper(struct objc_super *, struct
objc_selector *, ...);
extern struct objc_object *objc_msgSend_stret(struct objc_object *, struct
objc_selector *, ...);
extern struct objc_object *objc_msgSendSuper_stret(struct objc_super *, struct
objc_selector *, ...);
extern struct objc_object *objc_msgSend_fpret(struct objc_object *, struct
objc_selector *, ...);
extern struct objc_object *objc_getClass(const char *);
extern struct objc_object *objc_getMetaClass(const char *);
extern void objc_exception_throw(struct objc_object *);
extern void objc_exception_try_enter(void *);
extern void objc_exception_try_exit(void *);
extern struct objc_object *objc_exception_extract(void *);
extern int objc_exception_match(struct objc_class *, struct objc_object *, ...);
extern Protocol *objc_getProtocol(const char *);
#include <objc/objc.h>
// RUN: clang -rewrite-test %s
#include <objc/objc.h>
#ifndef _REWRITER_typedef_MyDerived
#define _REWRITER_typedef_MyDerived
typedef struct MyDerived MyDerived;
#endif
// - (void) instanceMethod;
// @end
// @implementation MyDerived
static void
_I_MyDerived_instanceMethod(MyDerived * self, SEL _cmd){
}
// @end
#include <stddef.h>
struct _objc_method {
SEL _cmd;
char *method_types;
void *_imp;
};
struct _objc_method_list {
struct _objc_method_list *next_method;
int method_count;
struct _objc_method method_list[];
};
static struct _objc_method_list _OBJC_INSTANCE_METHODS_MyDerived __attribute__
((section ("__OBJC, __inst_meth")))= {
0, 1
,{{(SEL)"instanceMethod", "[EMAIL PROTECTED]:4",
_I_MyDerived_instanceMethod}
}
};
struct _objc_class {
struct _objc_class *isa;
const char *super_class_name;
char *name;
long version;
long info;
long instance_size;
struct _objc_ivar_list *ivars;
struct _objc_method_list *methods;
struct objc_cache *cache;
struct _objc_protocol_list *protocols;
const char *ivar_layout;
struct _objc_class_ext *ext;
};
static struct _objc_class _OBJC_METACLASS_MyDerived __attribute__ ((section
("__OBJC, __meta_class")))= {
(struct _objc_class *)"MyDerived", 0, "MyDerived", 0,2, sizeof(struct
_objc_class), 0, 0
,0,0,0,0
};
static struct _objc_class _OBJC_CLASS_MyDerived __attribute__ ((section
("__OBJC, __class")))= {
&_OBJC_METACLASS_MyDerived, 0, "MyDerived", 0,1,0,0,
&_OBJC_INSTANCE_METHODS_MyDerived, 0
,0,0,0
};
struct _objc_symtab {
long sel_ref_cnt;
SEL *refs;
short cls_def_cnt;
short cat_def_cnt;
void *defs[1];
};
static struct _objc_symtab _OBJC_SYMBOLS __attribute__((section ("__OBJC,
__symbols")))= {
0, 0, 1, 0
,&_OBJC_CLASS_MyDerived
};
struct _objc_module {
long version;
long size;
const char *name;
struct _objc_symtab *symtab;
};
static struct _objc_module _OBJC_MODULES __attribute__ ((section ("__OBJC,
__module_info")))= {
7, sizeof(struct _objc_module), "", &_OBJC_SYMBOLS
};
******************** TEST 'Sema/rewrite-api-bug.m' FAILED! ********************
Sema/assign.c
Sema/check-dup-decl-methods-1.m
Sema/id-test-3.m
******************** TEST 'Sema/id-test-3.m' FAILED! ********************
Command:
clang -rewrite-test Sema/id-test-3.m | clang
Output:
In file included from <stdin>:23:
/usr/lib/gcc/i386-redhat-linux/4.0.2/include/objc/objc.h:145:3: error:
redefinition of 'Protocol'
} Protocol;
^
<stdin>:7:28: error: previous definition is here
typedef struct objc_object Protocol;
^
<stdin>:41:100: warning: incompatible types passing 'int' to function expecting
'SEL'
_I_INTF_IMeth(INTF * self, SEL _cmd){ return ((id (*)(id, SEL, id))(void
*)objc_msgSend)((id)self, sel_registerName("Meth:"), (id)0); }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~
3 diagnostics generated.
******************** TEST 'Sema/id-test-3.m' FAILED! ********************
Sema/protocol-expr-1.m
Sema/method-def-2.m
Sema/cast.c
Sema/invalid-decl.c
Sema/missing-string-interface.m
Sema/protocol-test-2.m
Sema/ivar-encoding-1.m
Sema/decl-invalid.c
Sema/assign-null.c
Sema/usual-float.c
Sema/method-undefined-warn-1.m
Sema/arg-invalid.c
Analysis/uninit-vals.c
Analysis/dead-stores.c
Analysis/conditional-op-missing-lhs.c
Serialization/complex.c
Serialization/stmt_exprs.c
Compilation finished at Wed Jan 2 09:36:49
_______________________________________________
cfe-dev mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev