summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/3rdparty/glslang/Test/cppIndent.vert
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/3rdparty/glslang/Test/cppIndent.vert')
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/cppIndent.vert61
1 files changed, 61 insertions, 0 deletions
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/cppIndent.vert b/3rdparty/bgfx/3rdparty/glslang/Test/cppIndent.vert
new file mode 100644
index 00000000000..41bb12e4a73
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/cppIndent.vert
@@ -0,0 +1,61 @@
+#version 110
+
+#define ON
+
+float sum = 0.0;
+
+void main()
+{
+
+#ifdef ON
+//yes
+sum += 1.0;
+#endif
+
+#ifdef OFF
+ //no
+ sum += 20.0;
+#endif
+
+ #if defined(ON)
+ //yes
+ sum += 300.0;
+ #endif
+
+ #if defined(OFF)
+ //no
+ sum += 4000.0;
+ #endif
+
+ #if !defined(ON)
+ //no
+ sum += 50000.0;
+ #endif
+
+ #if !defined(OFF)
+ //yes
+ sum += 600000.0;
+ #endif
+
+ #if defined (ON) && defined (OFF)
+//no
+sum += 7000000.0;
+ #endif
+
+#if defined ( ON ) && ! defined(OFF)
+//yes
+sum += 80000000.0;
+#endif
+
+#if defined(OFF) || defined(ON)
+//yes
+sum += 900000000.0;
+#endif
+
+// sum should be 980600301.0
+ gl_Position = vec4(sum);
+}
+
+#define FUNC(a,b) a+b
+// needs to be last test in file due to syntax error
+void foo986(){ FUNC( (((2)))), 4); } // ERROR, too few arguments )