diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Sema/warn-duplicate-enum.c | 92 | ||||
-rw-r--r-- | test/SemaCXX/warn-unique-enum.cpp | 27 |
2 files changed, 0 insertions, 119 deletions
diff --git a/test/Sema/warn-duplicate-enum.c b/test/Sema/warn-duplicate-enum.c deleted file mode 100644 index 239f6f1995..0000000000 --- a/test/Sema/warn-duplicate-enum.c +++ /dev/null @@ -1,92 +0,0 @@ -// RUN: %clang_cc1 %s -fsyntax-only -verify -Wduplicate-enum -// RUN: %clang_cc1 %s -x c++ -fsyntax-only -verify -Wduplicate-enum -enum A { - A1 = 0, // expected-note {{element A1 also has value 0}} - A2 = -1, - A3, // expected-warning {{element A3 has been implicitly assigned 0 which another element has been assigned}} - A4}; - -enum B { - B1 = -1, // expected-note {{element B1 also has value -1}} - B2, // expected-warning {{element B2 has been implicitly assigned 0 which another element has been assigned}} - B3, - B4 = -2, - B5, // expected-warning {{element B5 has been implicitly assigned -1 which another element has been assigned}} - B6 // expected-note {{element B6 also has value 0}} -}; - -enum C { C1, C2 = -1, C3 }; // expected-warning{{element C1 has been implicitly assigned 0 which another element has been assigned}} \ - // expected-note {{element C3 also has value 0}} - -enum D { - D1, - D2, - D3, // expected-warning{{element D3 has been implicitly assigned 2 which another element has been assigned}} - D4 = D2, // no warning - D5 = 2 // expected-note {{element D5 also has value 2}} -}; - -enum E { - E1, - E2 = E1, - E3 = E2 -}; - -enum F { - F1, - F2, - FCount, - FMax = FCount - 1 -}; - -enum G { - G1, - G2, - GMax = G2, - GCount = GMax + 1 -}; - -enum { - H1 = 0, - H2 = -1, - H3, - H4}; - -enum { - I1 = -1, - I2, - I3, - I4 = -2, - I5, - I6 -}; - -enum { J1, J2 = -1, J3 }; - -enum { - K1, - K2, - K3, - K4 = K2, - K5 = 2 -}; - -enum { - L1, - L2 = L1, - L3 = L2 -}; - -enum { - M1, - M2, - MCount, - MMax = MCount - 1 -}; - -enum { - N1, - N2, - NMax = N2, - NCount = NMax + 1 -}; diff --git a/test/SemaCXX/warn-unique-enum.cpp b/test/SemaCXX/warn-unique-enum.cpp deleted file mode 100644 index 59a1278071..0000000000 --- a/test/SemaCXX/warn-unique-enum.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// RUN: %clang_cc1 %s -fsyntax-only -verify -Wunique-enum -enum A { A1 = 1, A2 = 1, A3 = 1 }; // expected-warning {{all elements of 'A' are initialized with literals to value 1}} \ -// expected-note {{initialize the last element with the previous element to silence this warning}} -enum { B1 = 1, B2 = 1, B3 = 1 }; // no warning -enum C { // expected-warning {{all elements of 'C' are initialized with literals to value 1}} - C1 = true, - C2 = true // expected-note {{initialize the last element with the previous element to silence this warning}} -}; -enum D { D1 = 5, D2 = 5L, D3 = 5UL, D4 = 5LL, D5 = 5ULL }; // expected-warning {{all elements of 'D' are initialized with literals to value 5}} \ -// expected-note {{initialize the last element with the previous element to silence this warning}} - -// Don't warn on enums with less than 2 elements. -enum E { E1 = 4 }; -enum F { F1 }; -enum G {}; - -// Don't warn when integer literals do not initialize the elements. -enum H { H1 = 4, H_MAX = H1, H_MIN = H1 }; -enum I { I1 = H1, I2 = 4 }; -enum J { J1 = 4, J2 = I2 }; -enum K { K1, K2, K3, K4 }; - -// Don't crash or warn on this one. -// rdar://11875995 -enum L { - L1 = 0x8000000000000000ULL, L2 = 0x0000000000000001ULL -}; |