Fix assertion when calling a built-in function at global scope.

The fuzzer invented a much more elaborate example, but I was able to
winnow it down to a simple otherwise-normal test case. This also fixes
a latent DSL bug; DSL functions were not updating the list of referenced
intrinsics, so the compiler might emit finished programs that called
built-in functions that didn't exist in the code.

Change-Id: I095bb566b9db9f87cbe9460732c300b7973eb112
Bug: oss-fuzz:37659
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/442325
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
diff --git a/gn/sksl_tests.gni b/gn/sksl_tests.gni
index ab04a02..1309c0f 100644
--- a/gn/sksl_tests.gni
+++ b/gn/sksl_tests.gni
@@ -64,6 +64,7 @@
   "/sksl/errors/InterfaceBlockScope.sksl",
   "/sksl/errors/InterfaceBlockStorageModifiers.sksl",
   "/sksl/errors/InterfaceBlockWithNoMembers.sksl",
+  "/sksl/errors/IntrinsicInGlobalVariable.sksl",
   "/sksl/errors/InvalidAssignment.sksl",
   "/sksl/errors/InvalidOutParams.sksl",
   "/sksl/errors/InvalidToken.sksl",