diff options
| author | Pekka Enberg <penberg@kernel.org> | 2011-11-18 17:30:59 +0200 |
|---|---|---|
| committer | Pekka Enberg <penberg@kernel.org> | 2011-11-19 10:46:31 +0200 |
| commit | 064c4adfb5fdf0403614cb0a5a1a6373e88866b8 (patch) | |
| tree | f6158cfe7604b01aae143e196881002094f1a9f6 /validation | |
| parent | 6329d02b495b415dcac9f51300f7209a65ba80eb (diff) | |
| download | sparse-dev-064c4adfb5fdf0403614cb0a5a1a6373e88866b8.tar.gz | |
sparse, llvm: Function pointer code generation
This patch implements support for function pointer types and function pointer
calls to the LLVM backend.
Cc: Christopher Li <sparse@chrisli.org>
Cc: Jeff Garzik <jgarzik@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'validation')
| -rw-r--r-- | validation/backend/function-ptr.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/validation/backend/function-ptr.c b/validation/backend/function-ptr.c new file mode 100644 index 00000000..fc022b3c --- /dev/null +++ b/validation/backend/function-ptr.c @@ -0,0 +1,11 @@ +typedef int (*fn_t)(int x, int y); + +static int run(fn_t fn, int x, int y) +{ + return fn(x, y); +} + +/* + * check-name: Function pointer code generation + * check-command: ./sparsec -c $file -o tmp.o + */ |
