From 5b49974bd6ddd248b5ee1b1e29c0acfc3c422a3a Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Mon, 12 Jun 2017 12:42:17 -0700 Subject: Rename tests from `*.spire` to `*.slang` Many of the existing test cases were being skipped on accident, because their file names used `.spire` and the test tool was now looking for `.slang` --- tests/preprocessor/define-function-like.slang | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/preprocessor/define-function-like.slang (limited to 'tests/preprocessor/define-function-like.slang') diff --git a/tests/preprocessor/define-function-like.slang b/tests/preprocessor/define-function-like.slang new file mode 100644 index 000000000..f1dd9caa4 --- /dev/null +++ b/tests/preprocessor/define-function-like.slang @@ -0,0 +1,19 @@ +//TEST:SIMPLE: +// support for function-like macros + +#define FOO(x) 1.0 + x + +float foo(float y) { return FOO(y) * 2.0; } + +// simple token pasting + +#define PASTE(a,b) a##b + +PASTE(flo,at) bar() { return 0.0; } + +// no space before parens? not a function-like macro + +#define M (x) - (x) + +// Error: undefined identifier `x` +float bar(float a) { return M(a); } -- cgit v1.2.3