diff options
Diffstat (limited to 'tests/preprocessor')
| -rw-r--r-- | tests/preprocessor/file-identity/b.h | 11 | ||||
| -rw-r--r-- | tests/preprocessor/file-identity/c.h | 11 | ||||
| -rw-r--r-- | tests/preprocessor/file-identity/sub-folder/file-identity.slang | 13 | ||||
| -rw-r--r-- | tests/preprocessor/pragma-once.slang | 1 |
4 files changed, 36 insertions, 0 deletions
diff --git a/tests/preprocessor/file-identity/b.h b/tests/preprocessor/file-identity/b.h new file mode 100644 index 000000000..ba131c653 --- /dev/null +++ b/tests/preprocessor/file-identity/b.h @@ -0,0 +1,11 @@ +#pragma once + +#include "c.h" + +#ifdef B_H +# error "Shouldn't be included twice" +#endif + +#define B_H + +float foo(float x) { return x; }
\ No newline at end of file diff --git a/tests/preprocessor/file-identity/c.h b/tests/preprocessor/file-identity/c.h new file mode 100644 index 000000000..eb6cd1c42 --- /dev/null +++ b/tests/preprocessor/file-identity/c.h @@ -0,0 +1,11 @@ +#pragma once + +#include "b.h" + +#ifdef C_H +# error "c.h shouldn't be included twice" +#endif + +#define C_H + +float bar(float x) { return x; }
\ No newline at end of file diff --git a/tests/preprocessor/file-identity/sub-folder/file-identity.slang b/tests/preprocessor/file-identity/sub-folder/file-identity.slang new file mode 100644 index 000000000..590b32a70 --- /dev/null +++ b/tests/preprocessor/file-identity/sub-folder/file-identity.slang @@ -0,0 +1,13 @@ +//TEST(smoke):SIMPLE: +//TEST(smoke):SIMPLE: -file-system load-file + + +#include "../b.h" +#include "../c.h" + +#include "./../b.h" + +float test(float x) +{ + return foo(x) + bar(x); +}
\ No newline at end of file diff --git a/tests/preprocessor/pragma-once.slang b/tests/preprocessor/pragma-once.slang index 43ddee680..ef43ea265 100644 --- a/tests/preprocessor/pragma-once.slang +++ b/tests/preprocessor/pragma-once.slang @@ -1,4 +1,5 @@ //TEST(smoke):SIMPLE: +//TEST(smoke):SIMPLE: -file-system load-file // Test support for `#pragma once` |
