URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 154 |
Rev 816 |
/* Test to make sure that the const objc strings are the same across
|
/* Test to make sure that the const objc strings are the same across
|
scopes. */
|
scopes. */
|
/* Developed by Andrew Pinski */
|
/* Developed by Andrew Pinski */
|
|
|
|
|
/* { dg-options "-fnext-runtime -fconstant-string-class=Foo -lobjc" } */
|
/* { dg-options "-fnext-runtime -fconstant-string-class=Foo -lobjc" } */
|
/* { dg-do run { target *-*-darwin* } } */
|
/* { dg-do run { target *-*-darwin* } } */
|
|
|
|
|
#include
|
#include
|
#include
|
#include
|
#include
|
#include
|
#include
|
#include
|
#include
|
#include
|
|
|
|
|
@interface Foo: Object {
|
@interface Foo: Object {
|
char *cString;
|
char *cString;
|
unsigned int len;
|
unsigned int len;
|
}
|
}
|
- (char *)customString;
|
- (char *)customString;
|
@end
|
@end
|
|
|
struct objc_class _FooClassReference;
|
struct objc_class _FooClassReference;
|
|
|
|
|
@implementation Foo : Object
|
@implementation Foo : Object
|
- (char *)customString {
|
- (char *)customString {
|
return cString;
|
return cString;
|
}
|
}
|
@end
|
@end
|
|
|
|
|
int main () {
|
int main () {
|
Foo *string = @"bla";
|
Foo *string = @"bla";
|
{
|
{
|
Foo *string2 = @"bla";
|
Foo *string2 = @"bla";
|
|
|
|
|
if(string != string2)
|
if(string != string2)
|
abort();
|
abort();
|
printf("Strings are being uniqued properly\n");
|
printf("Strings are being uniqued properly\n");
|
}
|
}
|
return 0;
|
return 0;
|
}
|
}
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.