Skip to content
Snippets Groups Projects
Select Git revision
  • b415dd0d29653747f3df7df0ebbd1547d8aa9cd3
  • master default
  • labcomm2006
  • typedefs
  • anders.blomdell
  • typeref
  • pragma
  • compiler-refactoring
  • labcomm2013
  • v2014.4
  • v2006.0
  • v2014.3
  • v2014.2
  • v2014.1
  • v2014.0
  • v2013.0
16 results

test_signature_plain_c.c

Blame
  • Forked from Anders Blomdell / LabComm
    424 commits behind the upstream repository.
    Anders Blomdell's avatar
    Anders Blomdell authored
    [GNU] ld tricks (instead we rely on cpp tricks and some heuristics
    for memory allocation) so we probably should rewrite labcomm compiler
    to generate cleaner code for this use-case.
    b415dd0d
    History
    test_signature_plain_c.c 777 B
    #include <stdlib.h>
    #include <stdio.h>
    #include "test/gen/another_encoding.h"
    #include "test/gen/generated_encoding.h"
    
    extern int labcomm_signature_local_index(struct labcomm_signature *s);
    
    
    static void info(char *name, char *full_name, 
    		 struct labcomm_signature *signature) {
      printf("%s %s %p -> %d\n", name,  full_name, signature, 
    	 labcomm_signature_local_index(signature));
      if (labcomm_signature_local_index(signature) < 0x40) {
        exit(1);
      }
    };
    
    int main(int argc, char *argv[])
    {
    #define FUNC(name, full_name) \
      extern struct labcomm_signature labcomm_signature_##full_name; \
      info( #name, #full_name, &labcomm_signature_##full_name)
      LABCOMM_FORALL_SAMPLES_generated_encoding(FUNC, ;);
      LABCOMM_FORALL_SAMPLES_another_encoding(FUNC, ;);
      return 0;
    }