summaryrefslogtreecommitdiffstats
path: root/tests/preprocessor/import.hlsl
diff options
context:
space:
mode:
Diffstat (limited to 'tests/preprocessor/import.hlsl')
-rw-r--r--tests/preprocessor/import.hlsl18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/preprocessor/import.hlsl b/tests/preprocessor/import.hlsl
new file mode 100644
index 000000000..486023678
--- /dev/null
+++ b/tests/preprocessor/import.hlsl
@@ -0,0 +1,18 @@
+//TEST:SIMPLE:-profile vs_5_0
+
+// Confirm that `#import` interacts with preprocessor as expected
+
+// Here is a macro that flows from parent to child file
+#define FOO float
+
+// Here we import the child file
+#import "import.slang.h"
+
+// Here we use a macro that flows the other way (child->parent)
+BAR g( FOO x ) { return f(x); }
+
+// Here we confirm that importing the file again is a no-op
+#import "import.slang.h"
+
+void main()
+{}