Fix broken MinGW build of gcc.c
[official-gcc.git] / gcc / testsuite / obj-c++.dg / encode-9.mm
blob6b064dfdc09d1ea6aef94bc55776890ce30e7cbe
1 /* Test than @encode is properly instantiated. */
2 /* { dg-options "-lobjc" } */
3 /* { dg-do run } */
5 #include <string.h>           
6 #include <stdlib.h>
7 #include <objc/objc.h>
9 template<typename T>
10 class typeOf {
11 public:
12     operator const char*() { return @encode(T); }
15 int main() {
16     typeOf<int> t;
17     if (strcmp ((const char *)t, @encode(int)))
18       abort();
20     typeOf<const char*> c;
21     if (strcmp ((const char *)c, @encode(const char*)))
22       abort();
24     return 0;