[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[csmith-bugs] Clarification needed on Csmith options



Hello,

I generated a random c program(Attached struct_bug.c) using csmith with the following option.
$csmith --structs > struct_bug.c

csmith's help says:
--structs | --no-structs: enable | disable to generate structs (enable by default).

But generated program "struct_bug.c" does not contain any structure.

Am I expecting the right output here!!?? If not, what output should i expect if i pass "--structs" option.
Bit confused.

I have similar doubts on other options such as "--longlong", "--const" etc.

Thanks,
Vikram
ksvikram@gmail.com

/*
 * This is a RANDOMLY GENERATED PROGRAM.
 *
 * Generator: csmith 2.0.0
 * svn version: exported
 * Options:   --structs
 * Seed:      4032215243
 */

#include "csmith.h"


long __undefined;

/* --- Struct/Union Declarations --- */
/* --- GLOBAL VARIABLES --- */
uint32_t g_2[8] = {9U, 9U, 9U, 9U, 9U, 9U, 9U, 9U};


/* --- FORWARD DECLARATIONS --- */
int16_t  func_1(void);


/* --- FUNCTIONS --- */
/* ------------------------------------------ */
/* 
 * reads : g_2
 * writes:
 */
int16_t  func_1(void)
{ /* block id: 0 */
    return g_2[3];
}




/* ---------------------------------------- */
int main (int argc, char* argv[])
{
    int i;
    int print_hash_value = 0;
    if (argc == 2 && strcmp(argv[1], "1") == 0) print_hash_value = 1;
    platform_main_begin();
    crc32_gentab();
    func_1();
    for (i = 0; i < 8; i++)
    {
        transparent_crc(g_2[i], "g_2[i]", print_hash_value);
        if (print_hash_value) printf("index = [%d]\n", i);

    }
    platform_main_end(crc32_context ^ 0xFFFFFFFFUL);
    return 0;
}

/************************ statistics *************************
XXX max struct depth: 0
breakdown:
   depth: 0, occurrence: 1

XXX max expression depth: 0
breakdown:
   depth: 0, occurrence: 1

XXX total number of pointers: 0

XXX times a non-volatile is read: 1
XXX times a non-volatile is write: 0
XXX times a volatile is read: 0
XXX    times read thru a pointer: 0
XXX times a volatile is write: 0
XXX    times written thru a pointer: 0
XXX times a volatile is available for access: 0
XXX percentage of non-volatile access: 100

XXX forward jumps: 0
XXX backward jumps: 0

XXX stmts: 2

XXX percentage a fresh-made variable is used: 100
XXX percentage an existing variable is used: 0
********************* end of statistics **********************/