diff options
author | Thomas Preud'homme <robotux@celest.fr> | 2015-12-26 18:15:30 +0800 |
---|---|---|
committer | Thomas Preud'homme <robotux@celest.fr> | 2015-12-26 18:15:30 +0800 |
commit | 9b58ceece89525bc832012f7b877de5615b12829 (patch) | |
tree | 9c085e51cc8754463d27fac5d516fe9d7533c3c6 /tests/tests2/76_dollars_in_identifiers.c | |
parent | 2946895a376add9d940bdbe4391e97cb846d26d1 (diff) |
Imported Upstream version 0.9.27~git20151225.f15c0a9
Diffstat (limited to 'tests/tests2/76_dollars_in_identifiers.c')
-rw-r--r-- | tests/tests2/76_dollars_in_identifiers.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/tests2/76_dollars_in_identifiers.c b/tests/tests2/76_dollars_in_identifiers.c new file mode 100644 index 0000000..c5fcf99 --- /dev/null +++ b/tests/tests2/76_dollars_in_identifiers.c @@ -0,0 +1,41 @@ +#include <stdio.h> + +#define $(x) x +#define $fred 10 +#define joe$ 20 +#define hen$y 30 + +#define $10(x) x*10 +#define _$10(x) x/10 + +int main() +{ + printf("fred=%d\n", $fred); + printf("joe=%d\n", joe$); + printf("henry=%d\n", hen$y); + + printf("fred2=%d\n", $($fred)); + printf("joe2=%d\n", $(joe$)); + printf("henry2=%d\n", $(hen$y)); + + printf("fred10=%d\n", $10($fred)); + printf("joe_10=%d\n", _$10(joe$)); + + int $ = 10; + int a100$ = 100; + int a$$ = 1000; + int a$c$b = 2121; + int $100 = 10000; + const char *$$$ = "money"; + + printf("local=%d\n", $); + printf("a100$=%d\n", a100$); + printf("a$$=%d\n", a$$); + printf("a$c$b=%d\n", a$c$b); + printf("$100=%d\n", $100); + printf("$$$=%s", $$$); + + return 0; +} + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ |