URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [obj-c++.dg/] [encode-9.mm] - Rev 713
Go to most recent revision | Compare with Previous | Blame | View Log
/* Test than @encode is properly instantiated. */
/* { dg-options "-lobjc" } */
/* { dg-do run } */
#include <string.h>
#include <stdlib.h>
#include <objc/objc.h>
template<typename T>
class typeOf {
public:
operator const char*() { return @encode(T); }
};
int main() {
typeOf<int> t;
if (strcmp ((const char *)t, @encode(int)))
abort();
typeOf<const char*> c;
if (strcmp ((const char *)c, @encode(const char*)))
abort();
return 0;
}
Go to most recent revision | Compare with Previous | Blame | View Log