------- Comment #1 from edwintorok at gmail dot com 2008-09-22 20:18 ------- /* testcase compile this with -O1 */ typedef struct TCase TCase; typedef void (*TFun) (int); typedef struct Suite Suite; void _tcase_add_test (TCase * tc, TFun tf, const char *fname, int signal, int start, int end); void _fail_unless (int result, const char *file, int line, const char *expr, ...); enum val_type { vtype_undefined, vtype_cstring, vtype_string, vtype_scope, vtype_dval, vtype_ival }; typedef struct token { union { char *string; double dval; } val; enum val_type vtype; } yystype; static int vtype_compatible (enum val_type orig, enum val_type req) { }
static void test_token_dval (int _i __attribute__ ((unused))) { { int val = 0.12345; yystype tok; do { (&tok)->val.dval = (val); } while (0); _fail_unless ((vtype_compatible ((&tok)->vtype, vtype_string) ? (&tok)-> val.string : ((void *) 0)) == ((void *) 0), "../../../trunk/unit_tests/check_jsnorm.c", 150, "Assertion '" "TOKEN_GET(&tok, string) == NULL" "' failed", "token dval->string", ((void *) 0)); } } Suite * test_jsnorm_suite (void) { TCase *tc_jsnorm_gperf, *tc_jsnorm_token, *tc_jsnorm_api, *tc_jsnorm_tokenizer, *tc_jsnorm_bugs, *tc_screnc_infloop; _tcase_add_test ((tc_jsnorm_token), (test_token_dval), "" "test_token_dval" "", (0), 0, 1); } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37617