summaryrefslogtreecommitdiffstats
path: root/tests/diagnostics/local-used-in-own-declaration.slang
blob: d95ef12e0fdf9e70374fe8bd325574cadaf82c40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//DIAGNOSTIC_TEST:SIMPLE:-target dxbc -profile ps_5_0

// Early versions of the front-end had bugs when local
// variables were used before their definition, or
// were defined using a reference to themselves.
//
// This file tries to ensure that we emit proper error
// diagnostics in these cases.

void usedInOwnDeclaration()
{
	int e = e;
}

float4 main()
{
	usedInOwnDeclaration();
	return 0;
}