diff options
Diffstat (limited to 'tests/input')
-rw-r--r-- | tests/input/chars.h | 3 | ||||
-rw-r--r-- | tests/input/fail.h | 9 | ||||
-rw-r--r-- | tests/input/floats.h | 8 | ||||
-rw-r--r-- | tests/input/int_signed.h | 3 | ||||
-rw-r--r-- | tests/input/int_unsigned.h | 29 | ||||
-rw-r--r-- | tests/input/strings.h | 17 | ||||
-rw-r--r-- | tests/input/test_llvm_bug_9069.h | 4 |
7 files changed, 73 insertions, 0 deletions
diff --git a/tests/input/chars.h b/tests/input/chars.h new file mode 100644 index 0000000..45351d3 --- /dev/null +++ b/tests/input/chars.h @@ -0,0 +1,3 @@ +#define CharChar_65 'A' +#define CharChar_127849 '\U0001f369' // 🍩 +#define CharRaw_255 U'\xff' diff --git a/tests/input/fail.h b/tests/input/fail.h new file mode 100644 index 0000000..fd416bc --- /dev/null +++ b/tests/input/fail.h @@ -0,0 +1,9 @@ +#define FAIL_function_like(x) 3 +#define FAIL_empty +#define FAIL_invalid_for_radix 0b2 +#define FAIL_shift_by_float 3<<1f +#define FAIL_unknown_identifier UNKNOWN +#define Int_0 0 +#define Str_str "str" +#define FAIL_concat_integer "test" Str_str Int_0 +#define FAIL_too_large_int 18446744073709551616 diff --git a/tests/input/floats.h b/tests/input/floats.h new file mode 100644 index 0000000..61942cf --- /dev/null +++ b/tests/input/floats.h @@ -0,0 +1,8 @@ +#define Float_0 0. +#define Float_1 1f +#define Float_p1 .1 +#define Float_2 2.0 +#define Float_1000 1e3 +#define Float_2000 2e+3 +#define Float_p001 1e-3 +#define Float_80 10.0*(1<<3) diff --git a/tests/input/int_signed.h b/tests/input/int_signed.h new file mode 100644 index 0000000..65854a6 --- /dev/null +++ b/tests/input/int_signed.h @@ -0,0 +1,3 @@ +#define Int_n3 -(-(-3)) +#define Int_n5 -3-2 +#define Int_n9223372036854775808 -9223372036854775808 diff --git a/tests/input/int_unsigned.h b/tests/input/int_unsigned.h new file mode 100644 index 0000000..6663dda --- /dev/null +++ b/tests/input/int_unsigned.h @@ -0,0 +1,29 @@ +#define Int_456 456 +#define Int_0 0 +#define Int_1 0b1 +#define Int_2 0x2 +#define Int_3 3L +#define Int_4 0X4 +#define Int_5 0B101 +#define Int_63 077 +#define Int_123 123 +#define Int_124 124u +#define Int_125 125uL +#define Int_126 126LuL +#define Int_16 (((1)<<4ULL))/*comment*/ +#define Int_13 1|8^6&2<<1 + +#define Int_47 32|15 +#define Int_38 (32|15)^9 +#define Int_6 ((32|15)^9)&7 +#define Int_12 (((32|15)^9)&7)<<1 +#define Int_17 ((((32|15)^9)&7)<<1)+5 +#define Int_15 (((((32|15)^9)&7)<<1)+5)-2 +#define Int_60 ((((((32|15)^9)&7)<<1)+5)-2)*4 +#define Int_30 (((((((32|15)^9)&7)<<1)+5)-2)*4)/2 +#define Int_39 32|15^9&7<<1+5-2*4/2 + +#define Int_n1 18446744073709551615 /*2^64-1*/ +#define Int_n9223372036854775808 9223372036854775808 + +#define Fn_Int_9(_3) _3*3 diff --git a/tests/input/strings.h b/tests/input/strings.h new file mode 100644 index 0000000..d01d409 --- /dev/null +++ b/tests/input/strings.h @@ -0,0 +1,17 @@ +#define Str_ "" +#define Str_str "str" +#define Str_unicode u"unicode" +#define Str_long L"long" +#define Str_concat u"con" L"cat" +#define Str_concat_parens ("concat" U"_parens") +#define Str_concat_identifier (Str_concat L"_identifier") +#define Str_hex_escape_all "\x68\x65\x78\x5f\x65\x73\x63\x61\x70\x65\x5f\x61\x6c\x6c" +#define Str_hex_escape_hex "h\x65x_\x65s\x63\x61p\x65_h\x65x" +#define Str_quote_U000022_escape "quote_\"_escape" +#define Str_Fly_away_in_my_space_U01F680_You_no_need_put_U01F4B5_in_my_pocket \ + u8"Fly_away_in_my_space_🚀_You_no_need_put_💵_in_my_pocket" +#define Fn_Str_no_args() "no_args" +#define Fn_Str_no_args_concat() "no_args_" Str_concat +#define Fn_Str_prepend_arg(arg) "prepend_" arg +#define Fn_Str_two_args(two, args) two "_" args +#define Fn_Str_three_args(three, _, args) three _ args diff --git a/tests/input/test_llvm_bug_9069.h b/tests/input/test_llvm_bug_9069.h new file mode 100644 index 0000000..a92374e --- /dev/null +++ b/tests/input/test_llvm_bug_9069.h @@ -0,0 +1,4 @@ +// The following two definitions should yield the same list of tokens. +// If https://bugs.llvm.org//show_bug.cgi?id=9069 is not fixed, they don't. +#define A 1 +#define A 1 |