blob: 74974aaa4b8ed7f6a009abb55d0a4420826cc979 [file] [log] [blame]
Ethan Nicholas24c17722021-03-09 13:10:59 -05001/*
2 * Copyright 2021 Google LLC.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#include "include/sksl/DSL.h"
9
10#include "tests/Test.h"
11
12// This file verifies that DSL code compiles with only a DSL.h import. We don't bother with any
13// 'real' tests here, as those are all in SkSLDSLTest.cpp.
14
15using namespace SkSL::dsl;
16
17// Defined in SkSLDSLTest.cpp (so that we don't have to put the required extra includes here)
18void StartDSL(const sk_gpu_test::ContextInfo ctxInfo);
19
20DEF_GPUTEST_FOR_MOCK_CONTEXT(DSLImportOnly, r, ctxInfo) {
21 StartDSL(ctxInfo);
Ethan Nicholasa2d22b22021-07-15 10:35:54 -040022 Parameter x(kInt_Type);
Ethan Nicholasb14e6b92021-04-08 16:56:05 -040023 Function(kInt_Type, "test", x).define(
Ethan Nicholas24c17722021-03-09 13:10:59 -050024 If(x >= 0,
25 Block(Return(x)),
26 Block(Return(-x)))
27 );
28 End();
29}