From f37da0ea0e25f66b122fe2e73c2ea04dcb2cd253 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 26 Jun 2008 06:32:02 +0000 Subject: rename some attr tests for consistency. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52770 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Sema/attr-deprecated.c | 25 +++++++++++++++++++++++++ test/Sema/attr-mode.c | 15 +++++++++++++++ test/Sema/attributes.c | 25 ------------------------- test/Sema/mode-attr-test.c | 15 --------------- 4 files changed, 40 insertions(+), 40 deletions(-) create mode 100644 test/Sema/attr-deprecated.c create mode 100644 test/Sema/attr-mode.c delete mode 100644 test/Sema/attributes.c delete mode 100644 test/Sema/mode-attr-test.c diff --git a/test/Sema/attr-deprecated.c b/test/Sema/attr-deprecated.c new file mode 100644 index 0000000000..f018c3356f --- /dev/null +++ b/test/Sema/attr-deprecated.c @@ -0,0 +1,25 @@ +// RUN: clang %s -verify -fsyntax-only + +int f() __attribute__((deprecated)); +void g() __attribute__((deprecated)); +void g(); + +void z() __attribute__((bogusattr)); // todo-warning {{'bogusattr' attribute ignored}} + +extern int var __attribute__((deprecated)); + +int a() { + int (*ptr)() = f; // expected-warning {{'f' is deprecated}} + f(); // expected-warning {{'f' is deprecated}} + + // test if attributes propagate to functions + g(); // expected-warning {{'g' is deprecated}} + + return var; // expected-warning {{'var' is deprecated}} +} + +// test if attributes propagate to variables +extern int var; +int w() { + return var; // expected-warning {{'var' is deprecated}} +} diff --git a/test/Sema/attr-mode.c b/test/Sema/attr-mode.c new file mode 100644 index 0000000000..4eb1399071 --- /dev/null +++ b/test/Sema/attr-mode.c @@ -0,0 +1,15 @@ +// RUN: clang -fsyntax-only -verify %s + +typedef int i16_1 __attribute((mode(HI))); +int i16_1_test[sizeof(i16_1) == 2 ? 1 : -1]; +typedef int i16_2 __attribute((__mode__(__HI__))); +int i16_2_test[sizeof(i16_1) == 2 ? 1 : -1]; + +typedef float f64 __attribute((mode(DF))); +int f64_test[sizeof(f64) == 8 ? 1 : -1]; + +typedef int invalid_1 __attribute((mode)); // expected-error{{attribute requires unquoted parameter}} +typedef int invalid_2 __attribute((mode())); // expected-error{{attribute requires unquoted parameter}} +typedef int invalid_3 __attribute((mode(II))); // expected-error{{unknown machine mode}} +typedef struct {int i,j,k;} invalid_4 __attribute((mode(SI))); // expected-error{{mode attribute only supported for integer and floating-point types}} +typedef float invalid_5 __attribute((mode(SI))); // expected-error{{type of machine mode does not match type of base type}} diff --git a/test/Sema/attributes.c b/test/Sema/attributes.c deleted file mode 100644 index f018c3356f..0000000000 --- a/test/Sema/attributes.c +++ /dev/null @@ -1,25 +0,0 @@ -// RUN: clang %s -verify -fsyntax-only - -int f() __attribute__((deprecated)); -void g() __attribute__((deprecated)); -void g(); - -void z() __attribute__((bogusattr)); // todo-warning {{'bogusattr' attribute ignored}} - -extern int var __attribute__((deprecated)); - -int a() { - int (*ptr)() = f; // expected-warning {{'f' is deprecated}} - f(); // expected-warning {{'f' is deprecated}} - - // test if attributes propagate to functions - g(); // expected-warning {{'g' is deprecated}} - - return var; // expected-warning {{'var' is deprecated}} -} - -// test if attributes propagate to variables -extern int var; -int w() { - return var; // expected-warning {{'var' is deprecated}} -} diff --git a/test/Sema/mode-attr-test.c b/test/Sema/mode-attr-test.c deleted file mode 100644 index 4eb1399071..0000000000 --- a/test/Sema/mode-attr-test.c +++ /dev/null @@ -1,15 +0,0 @@ -// RUN: clang -fsyntax-only -verify %s - -typedef int i16_1 __attribute((mode(HI))); -int i16_1_test[sizeof(i16_1) == 2 ? 1 : -1]; -typedef int i16_2 __attribute((__mode__(__HI__))); -int i16_2_test[sizeof(i16_1) == 2 ? 1 : -1]; - -typedef float f64 __attribute((mode(DF))); -int f64_test[sizeof(f64) == 8 ? 1 : -1]; - -typedef int invalid_1 __attribute((mode)); // expected-error{{attribute requires unquoted parameter}} -typedef int invalid_2 __attribute((mode())); // expected-error{{attribute requires unquoted parameter}} -typedef int invalid_3 __attribute((mode(II))); // expected-error{{unknown machine mode}} -typedef struct {int i,j,k;} invalid_4 __attribute((mode(SI))); // expected-error{{mode attribute only supported for integer and floating-point types}} -typedef float invalid_5 __attribute((mode(SI))); // expected-error{{type of machine mode does not match type of base type}} -- cgit v1.2.3-18-g5258