opnsense-src/test/CodeCompletion/macros.c

39 lines
1.1 KiB
C
Raw Normal View History

2009-11-04 10:04:32 -05:00
enum Color {
Red, Green, Blue
};
struct Point {
float x, y, z;
enum Color color;
};
void test(struct Point *p) {
2010-01-15 10:39:40 -05:00
// RUN: %clang_cc1 -include %S/Inputs/macros.h -fsyntax-only -code-completion-macros -code-completion-at=%s:12:14 %s -o - | FileCheck -check-prefix=CC1 %s
2009-11-04 10:04:32 -05:00
switch (p->IDENTITY(color)) {
2010-01-15 10:39:40 -05:00
// RUN: %clang_cc1 -include %S/Inputs/macros.h -fsyntax-only -code-completion-macros -code-completion-at=%s:14:9 %s -o - | FileCheck -check-prefix=CC2 %s
2009-11-04 10:04:32 -05:00
case
}
2010-01-15 10:39:40 -05:00
// Run the same tests, this time with macros loaded from the PCH file.
// RUN: %clang_cc1 -emit-pch -o %t %S/Inputs/macros.h
// RUN: %clang_cc1 -include-pch %t -fsyntax-only -code-completion-macros -code-completion-at=%s:12:14 %s -o - | FileCheck -check-prefix=CC1 %s
// RUN: %clang_cc1 -include-pch %t -fsyntax-only -code-completion-macros -code-completion-at=%s:14:9 %s -o - | FileCheck -check-prefix=CC2 %s
2009-11-04 10:04:32 -05:00
// CC1: BAR(<#X#>, <#Y#>)
2010-01-15 10:39:40 -05:00
// CC1: color
2009-11-04 10:04:32 -05:00
// CC1: FOO
// CC1: IDENTITY(<#X#>)
// CC1: WIBBLE
2010-01-15 10:39:40 -05:00
// CC1: x
// CC1: y
// CC1: z
2009-11-04 10:04:32 -05:00
// CC2: BAR(<#X#>, <#Y#>)
2010-01-15 10:39:40 -05:00
// CC2: Blue
2009-11-04 10:04:32 -05:00
// CC2: FOO
2010-01-15 10:39:40 -05:00
// CC2: Green
2009-11-04 10:04:32 -05:00
// CC2: IDENTITY(<#X#>)
2010-01-15 10:39:40 -05:00
// CC2: Red
2009-11-04 10:04:32 -05:00
// CC2: WIBBLE
}