summaryrefslogtreecommitdiffstats
path: root/tests/preprocessor/pragma-warning/once-2.slang
blob: 42399140706733132942f28b8ef35e62cf38993d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//TEST:SIMPLE(filecheck=CHECK):
// #ifdef support

int64_t GetValue();

void f()
{
	int i;
#pragma warning (once : 30081)
	// CHECK: ([[# @LINE+1]]): warning 30081:
	i = GetValue();
	// CHECK-NOT: ([[# @LINE+1]]): warning 30081:
	i = GetValue();
#pragma warning (once : 30081)
	// CHECK: ([[# @LINE+1]]): warning 30081:
	i = GetValue();
	// CHECK-NOT: ([[# @LINE+1]]): warning 30081:
	i = GetValue();
	// CHECK-NOT: ([[# @LINE+1]]): warning 30081:
	i = GetValue();
	// CHECK-NOT: ([[# @LINE+1]]): warning 30081:
	i = GetValue();
}

// Test that #pragma warning (once) are emitted once per segment