diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-01-23 11:10:26 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-01-23 11:10:26 +0000 |
commit | 2fce988e86bc01829142e4362d4eff1af0925147 (patch) | |
tree | c69d3f4f13d508570bb5257a6aea735f88bdf09c /test | |
parent | a3fa5c7f1b5e2ba4d6ec033dc0e2376326b05824 (diff) | |
download | FreeBSD-src-2fce988e86bc01829142e4362d4eff1af0925147.zip FreeBSD-src-2fce988e86bc01829142e4362d4eff1af0925147.tar.gz |
Update clang to r94309.
Diffstat (limited to 'test')
72 files changed, 1438 insertions, 1342 deletions
diff --git a/test/Analysis/NSString-failed-cases.m b/test/Analysis/NSString-failed-cases.m deleted file mode 100644 index 2b8242f..0000000 --- a/test/Analysis/NSString-failed-cases.m +++ /dev/null @@ -1,115 +0,0 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s -// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s -// RUN: %clang_cc1 -DTEST_64 -triple x86_64-apple-darwin10 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s -// RUN: %clang_cc1 -DTEST_64 -triple x86_64-apple-darwin10 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s -// XFAIL: * - -//===----------------------------------------------------------------------===// -// The following code is reduced using delta-debugging from -// Foundation.h (Mac OS X). -// -// It includes the basic definitions for the test cases below. -// Not directly including Foundation.h directly makes this test case -// both svelte and portable to non-Mac platforms. -//===----------------------------------------------------------------------===// - -#ifdef TEST_64 -typedef long long int64_t; -_Bool OSAtomicCompareAndSwap64Barrier( int64_t __oldValue, int64_t __newValue, volatile int64_t *__theValue ); -#define COMPARE_SWAP_BARRIER OSAtomicCompareAndSwap64Barrier -typedef int64_t intptr_t; -#else -typedef int int32_t; -_Bool OSAtomicCompareAndSwap32Barrier( int32_t __oldValue, int32_t __newValue, volatile int32_t *__theValue ); -#define COMPARE_SWAP_BARRIER OSAtomicCompareAndSwap32Barrier -typedef int32_t intptr_t; -#endif - -typedef const void * CFTypeRef; -typedef const struct __CFString * CFStringRef; -typedef const struct __CFAllocator * CFAllocatorRef; -extern const CFAllocatorRef kCFAllocatorDefault; -extern CFTypeRef CFRetain(CFTypeRef cf); -void CFRelease(CFTypeRef cf); -typedef const struct __CFDictionary * CFDictionaryRef; -const void *CFDictionaryGetValue(CFDictionaryRef theDict, const void *key); -extern CFStringRef CFStringCreateWithFormat(CFAllocatorRef alloc, CFDictionaryRef formatOptions, CFStringRef format, ...); -typedef signed char BOOL; -typedef int NSInteger; -typedef unsigned int NSUInteger; -@class NSString, Protocol; -extern void NSLog(NSString *format, ...) __attribute__((format(__NSString__, 1, 2))); -typedef NSInteger NSComparisonResult; -typedef struct _NSZone NSZone; -@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator; -@protocol NSObject -- (BOOL)isEqual:(id)object; -- (oneway void)release; -- (id)retain; -- (id)autorelease; -@end -@protocol NSCopying -- (id)copyWithZone:(NSZone *)zone; -@end -@protocol NSMutableCopying -- (id)mutableCopyWithZone:(NSZone *)zone; -@end -@protocol NSCoding -- (void)encodeWithCoder:(NSCoder *)aCoder; -@end -@interface NSObject <NSObject> {} -- (id)init; -+ (id)alloc; -@end -extern id NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone); -typedef struct {} NSFastEnumerationState; -@protocol NSFastEnumeration -- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len; -@end -@class NSString; -typedef struct _NSRange {} NSRange; -@interface NSArray : NSObject <NSCopying, NSMutableCopying, NSCoding, NSFastEnumeration> -- (NSUInteger)count; -@end -@interface NSMutableArray : NSArray -- (void)addObject:(id)anObject; -- (id)initWithCapacity:(NSUInteger)numItems; -@end -typedef unsigned short unichar; -@class NSData, NSArray, NSDictionary, NSCharacterSet, NSData, NSURL, NSError, NSLocale; -typedef NSUInteger NSStringCompareOptions; -@interface NSString : NSObject <NSCopying, NSMutableCopying, NSCoding> - (NSUInteger)length; -- (NSComparisonResult)compare:(NSString *)string; -- (NSComparisonResult)compare:(NSString *)string options:(NSStringCompareOptions)mask; -- (NSComparisonResult)compare:(NSString *)string options:(NSStringCompareOptions)mask range:(NSRange)compareRange; -- (NSComparisonResult)compare:(NSString *)string options:(NSStringCompareOptions)mask range:(NSRange)compareRange locale:(id)locale; -- (NSComparisonResult)caseInsensitiveCompare:(NSString *)string; -- (NSArray *)componentsSeparatedByCharactersInSet:(NSCharacterSet *)separator; -+ (id)stringWithFormat:(NSString *)format, ... __attribute__((format(__NSString__, 1, 2))); -@end -@interface NSSimpleCString : NSString {} @end -@interface NSConstantString : NSSimpleCString @end -extern void *_NSConstantStringClassReference; - -//===----------------------------------------------------------------------===// -// Test cases. These should all be merged into NSString.m once these tests -// stop reporting leaks. -//===----------------------------------------------------------------------===// - -// FIXME: THIS TEST CASE INCORRECTLY REPORTS A LEAK. -void testOSCompareAndSwapXXBarrier_parameter(NSString **old) { - NSString *s = [[NSString alloc] init]; // no-warning - if (!COMPARE_SWAP_BARRIER((intptr_t) 0, (intptr_t) s, (intptr_t*) old)) - [s release]; - else - [*old release]; -} - -// FIXME: THIS TEST CASE INCORRECTLY REPORTS A LEAK. -void testOSCompareAndSwapXXBarrier_parameter_no_direct_release(NSString **old) { - NSString *s = [[NSString alloc] init]; // no-warning - if (!COMPARE_SWAP_BARRIER((intptr_t) 0, (intptr_t) s, (intptr_t*) old)) - return; - else - [*old release]; -} diff --git a/test/Analysis/malloc.c b/test/Analysis/malloc.c index 4d771ee..7d2b718 100644 --- a/test/Analysis/malloc.c +++ b/test/Analysis/malloc.c @@ -51,3 +51,9 @@ void f6() { else free(p); } + +char *doit2(); +void pr6069() { + char *buf = doit2(); + free(buf); +} diff --git a/test/Analysis/misc-ps.m b/test/Analysis/misc-ps.m index 9543a98..ae42dca 100644 --- a/test/Analysis/misc-ps.m +++ b/test/Analysis/misc-ps.m @@ -811,3 +811,29 @@ int pr6033(int x) { return x % y; // expected-warning{{The right operand of '%' is a garbage value}} } +struct trie { + struct trie* next; +}; + +struct kwset { + struct trie *trie; + unsigned char delta[10]; + struct trie* next[10]; + int d; +}; + +typedef struct trie trie_t; +typedef struct kwset kwset_t; + +void f(kwset_t *kws, char const *p, char const *q) { + struct trie const *trie; + struct trie * const *next = kws->next; + register unsigned char c; + register char const *end = p; + register char const *lim = q; + register int d = 1; + register unsigned char const *delta = kws->delta; + + d = delta[c = (end+=d)[-1]]; // no-warning + trie = next[c]; +} diff --git a/test/Analysis/outofbound.c b/test/Analysis/outofbound.c index 2142e9e..68e77ca 100644 --- a/test/Analysis/outofbound.c +++ b/test/Analysis/outofbound.c @@ -1,7 +1,15 @@ -// RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify %s +// RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -analyzer-experimental-checks -checker-cfref -analyzer-store=region -verify %s + +typedef __typeof(sizeof(int)) size_t; +void *malloc(size_t); char f1() { char* s = "abcd"; char c = s[4]; // no-warning return s[5] + c; // expected-warning{{Access out-of-bound array element (buffer overflow)}} } + +void f2() { + int *p = malloc(12); + p[3] = 4; // expected-warning{{Access out-of-bound array element (buffer overflow)}} +} diff --git a/test/CXX/class.access/class.access.base/p1.cpp b/test/CXX/class.access/class.access.base/p1.cpp new file mode 100644 index 0000000..fd0d9f6 --- /dev/null +++ b/test/CXX/class.access/class.access.base/p1.cpp @@ -0,0 +1,152 @@ +// RUN: %clang_cc1 -fsyntax-only -faccess-control -verify %s + +// C++0x [class.access.base]p1(a): +// If a class is declared to be a base class for another class using +// the public access specifier, the public members of the base class +// are accessible as public members of the derived class and protected +// members of the base class are accessible as protected members of +// the derived class. +namespace test0 { + class Base { + public: int pub; static int spub; + protected: int prot; static int sprot; // expected-note 4 {{declared protected here}} + private: int priv; static int spriv; // expected-note 8 {{declared private here}} + }; + + class Test : public Base { + void test() { + pub++; + spub++; + prot++; + sprot++; + priv++; // expected-error {{private member}} + spriv++; // expected-error {{private member}} + + Base::pub++; + Base::spub++; + Base::prot++; + Base::sprot++; + Base::priv++; // expected-error {{private member}} + Base::spriv++; // expected-error {{private member}} + } + }; + + void test(Test *t) { + t->pub++; + t->spub++; + t->prot++; // expected-error {{protected member}} + t->sprot++; // expected-error {{protected member}} + t->priv++; // expected-error {{private member}} + t->spriv++; // expected-error {{private member}} + + t->Base::pub++; + t->Base::spub++; + t->Base::prot++; // expected-error {{protected member}} + t->Base::sprot++; // expected-error {{protected member}} + t->Base::priv++; // expected-error {{private member}} + t->Base::spriv++; // expected-error {{private member}} + } +} + +// C++0x [class.access.base]p1(b): +// If a class is declared to be a base class for another class using +// the protected access specifier, the public and protected members +// of the base class are accessible as protected members of the +// derived class. +namespace test1 { + class Base { // expected-note 6 {{constrained by protected inheritance}} + public: int pub; static int spub; // expected-note 2 {{constrained by protected inheritance}} + protected: int prot; static int sprot; // expected-note 4 {{declared protected here}} + private: int priv; static int spriv; // expected-note 8 {{declared private here}} + }; + + class Test : protected Base { + void test() { + pub++; + spub++; + prot++; + sprot++; + priv++; // expected-error {{private member}} + spriv++; // expected-error {{private member}} + + Base::pub++; + Base::spub++; + Base::prot++; + Base::sprot++; + Base::priv++; // expected-error {{private member}} + Base::spriv++; // expected-error {{private member}} + } + }; + + void test(Test *t) { + t->pub++; // expected-error {{protected member}} + t->spub++; // expected-error {{protected member}} + t->prot++; // expected-error {{protected member}} + t->sprot++; // expected-error {{protected member}} + t->priv++; // expected-error {{private member}} + t->spriv++; // expected-error {{private member}} + + // Two possible errors here: one for Base, one for the member + t->Base::pub++; // expected-error {{protected member}} + t->Base::spub++; // expected-error {{protected member}} + t->Base::prot++; // expected-error 2 {{protected member}} + t->Base::sprot++; // expected-error 2 {{protected member}} + t->Base::priv++; // expected-error {{protected member}} expected-error {{private member}} + t->Base::spriv++; // expected-error {{protected member}} expected-error {{private member}} + } +} + +// C++0x [class.access.base]p1(b): +// If a class is declared to be a base class for another class using +// the private access specifier, the public and protected members of +// the base class are accessible as private members of the derived +// class. +namespace test2 { + class Base { //expected-note 6 {{constrained by private inheritance}} + public: + int pub; // expected-note {{constrained by private inheritance}} + static int spub; // expected-note {{constrained by private inheritance}} + protected: + int prot; // expected-note {{constrained by private inheritance}} \ + // expected-note {{declared protected here}} + static int sprot; // expected-note {{constrained by private inheritance}} \ + // expected-note {{declared protected here}} + private: + int priv; // expected-note 4 {{declared private here}} + static int spriv; // expected-note 4 {{declared private here}} + }; + + class Test : private Base { // expected-note 6 {{'private' inheritance specifier here}} + void test() { + pub++; + spub++; + prot++; + sprot++; + priv++; // expected-error {{private member}} + spriv++; // expected-error {{private member}} + + Base::pub++; + Base::spub++; + Base::prot++; + Base::sprot++; + Base::priv++; // expected-error {{private member}} + Base::spriv++; // expected-error {{private member}} + } + }; + + void test(Test *t) { + t->pub++; // expected-error {{private member}} expected-error {{inaccessible base class}} + t->spub++; // expected-error {{private member}} + t->prot++; // expected-error {{private member}} expected-error {{inaccessible base class}} + t->sprot++; // expected-error {{private member}} + t->priv++; // expected-error {{private member}} expected-error {{inaccessible base class}} + t->spriv++; // expected-error {{private member}} + + t->Base::pub++; // expected-error {{private member}} expected-error {{inaccessible base class}} + t->Base::spub++; // expected-error {{private member}} + t->Base::prot++; // expected-error {{protected member}} expected-error {{private member}} expected-error {{inaccessible base class}} + t->Base::sprot++; // expected-error {{protected member}} expected-error {{private member}} + t->Base::priv++; // expected-error 2 {{private member}} expected-error {{inaccessible base class}} + t->Base::spriv++; // expected-error 2 {{private member}} + } +} diff --git a/test/CodeCompletion/call.c b/test/CodeCompletion/call.c new file mode 100644 index 0000000..8210389 --- /dev/null +++ b/test/CodeCompletion/call.c @@ -0,0 +1,15 @@ +// Note: the run lines follow their respective tests, since line/column +// matter in this test. +void f0(float x, float y); +void f1(); +void test() { + f0(0, 0); + g0(0, 0); + f1(0, 0); + // RUN: %clang_cc1 -std=c89 -fsyntax-only -code-completion-at=%s:6:6 %s -o - | FileCheck -check-prefix=CC1 %s + // CHECK-CC1: f0(<#float x#>, float y) + // RUN: %clang_cc1 -std=c89 -fsyntax-only -code-completion-at=%s:6:9 %s -o - | FileCheck -check-prefix=CC2 %s + // CHECK-CC2: f0(float x, <#float y#>) + // RUN: %clang_cc1 -std=c89 -fsyntax-only -code-completion-at=%s:8:6 %s -o - | FileCheck -check-prefix=CC3 %s + // CHECK-CC3: f1() +} diff --git a/test/CodeGen/2009-10-20-GlobalDebug.c b/test/CodeGen/2009-10-20-GlobalDebug.c index f19ceb1..99be469 100644 --- a/test/CodeGen/2009-10-20-GlobalDebug.c +++ b/test/CodeGen/2009-10-20-GlobalDebug.c @@ -1,4 +1,4 @@ // RUN: %clang -ccc-host-triple i386-apple-darwin10 -S -g -dA %s -o - | FileCheck %s int global; -// CHECK: asciz "global" ## DW_AT_name +// CHECK: asciz "global" ## External Name int main() { return 0;} diff --git a/test/CodeGenCXX/copy-assign-synthesis-3.cpp b/test/CodeGenCXX/copy-assign-synthesis-3.cpp index 73c2261..ce4640a 100644 --- a/test/CodeGenCXX/copy-assign-synthesis-3.cpp +++ b/test/CodeGenCXX/copy-assign-synthesis-3.cpp @@ -1,18 +1,24 @@ // RUN: %clang_cc1 -emit-llvm-only -verify %s struct A { - A& operator=(const A&); + A& operator=(A&); }; struct B { + void operator=(B); +}; + +struct C { A a; - float b; - int (A::*c)(); - _Complex float d; - int e[10]; - A f[2]; + B b; + float c; + int (A::*d)(); + _Complex float e; + int f[10]; + A g[2]; + B h[2]; }; -void a(B& x, B& y) { +void a(C& x, C& y) { x = y; } diff --git a/test/CodeGenCXX/debug-info.cpp b/test/CodeGenCXX/debug-info.cpp index 705491e..cb6e830 100644 --- a/test/CodeGenCXX/debug-info.cpp +++ b/test/CodeGenCXX/debug-info.cpp @@ -18,3 +18,9 @@ void f() { int B::*a = 0; void (B::*b)() = 0; } + +namespace EmptyNameCrash { + struct A { A(); }; + typedef struct { A x; } B; + B x; +} diff --git a/test/CodeGenCXX/member-function-pointers.cpp b/test/CodeGenCXX/member-function-pointers.cpp index 2454dda..e1353a7 100644 --- a/test/CodeGenCXX/member-function-pointers.cpp +++ b/test/CodeGenCXX/member-function-pointers.cpp @@ -139,3 +139,14 @@ namespace PR5940 { void (foo::*ptr)(void) = &foo::baz; } } + +namespace MemberPointerImpCast { + struct A { + int x; + }; + struct B : public A { + }; + void f(B* obj, void (A::*method)()) { + (obj->*method)(); + } +} diff --git a/test/CodeGenCXX/temp-order.cpp b/test/CodeGenCXX/temp-order.cpp index e1ef7eb..05a9aed 100644 --- a/test/CodeGenCXX/temp-order.cpp +++ b/test/CodeGenCXX/temp-order.cpp @@ -167,13 +167,10 @@ void test() { if (f5() != ORDER4(5, 3, 7, 2)) error(); -// FIXME: Clang/LLVM currently can't fold this to a constant. If the error check -// is present (since it avoids single-caller inlining). PR5645. - -// CHECK: call void @print(i8* {{.*}}, i32 1251552576) +// CHECK: call void @print(i8* {{.*}}, i32 1251552576) print("f6", f6()); -// if (f6() != ORDER6(3, 7, 11, 5, 13, 2)) -// error(); + if (f6() != ORDER6(3, 7, 11, 5, 13, 2)) + error(); } diff --git a/test/CodeGenCXX/virt.cpp b/test/CodeGenCXX/virt.cpp index f7f4c9f..22e11fd 100644 --- a/test/CodeGenCXX/virt.cpp +++ b/test/CodeGenCXX/virt.cpp @@ -17,11 +17,7 @@ struct B { void B::bar1() { } void B::bar2() { } -// CHECK-LP64: __ZTV1B: -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad __ZTI1B -// CHECK-LP64-NEXT: .quad __ZN1B4bar1Ev -// CHECK-LP64-NEXT: .quad __ZN1B4bar2Ev +// CHECK-LPLL64:@_ZTV1B = constant [4 x i8*] [i8* null, i8* bitcast (%0* @_ZTI1B to i8*), i8* bitcast (void (%struct.B*)* @_ZN1B4bar1Ev to i8*), i8* bitcast (void (%struct.B*)* @_ZN1B4bar2Ev to i8*)] struct C { virtual void bee1(); @@ -52,42 +48,8 @@ public: }; void F::foo() { } -// CHECK-LP64: __ZTV1F: -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 16 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad __ZTI1F -// CHECK-LP64-NEXT: .quad __ZN1D3booEv -// CHECK-LP64-NEXT: .quad __ZN1F3fooEv -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 18446744073709551600 -// CHECK-LP64-NEXT: .quad __ZTI1F -// CHECK-LP64-NEXT: .quad __ZN2D13barEv -// CHECK-LP64-NEXT: .quad __ZN2D14bar2Ev -// CHECK-LP64-NEXT: .quad __ZN2D14bar3Ev -// CHECK-LP64-NEXT: .quad __ZN2D14bar4Ev -// CHECK-LP64-NEXT: .quad __ZN2D14bar5Ev - - -int j; -void *vp; -void test2() { - F f; - static int sz = (char *)(&f.f) - (char *)(&f); - vp = &sz; - j = sz; - // FIXME: These should result in a frontend constant a la fold, no run time - // initializer - // CHECK-LPLL64: define void @_Z5test2v() - // CHECK-LPLL64: = getelementptr inbounds %class.F* %f, i32 0, i32 1 -} +// CHECK-LPLL64:@_ZTV1F = constant [19 x i8*] [i8* null, i8* inttoptr (i64 16 to i8*), i8* null, i8* null, i8* bitcast (%1* @_ZTI1F to i8*), i8* bitcast (void (%class.test14*)* @_ZN1D3booEv to i8*), i8* bitcast (void (%class.F*)* @_ZN1F3fooEv to i8*), i8* null, i8* null, i8* null, i8* null, i8* null, i8* inttoptr (i64 -16 to i8*), i8* bitcast (%1* @_ZTI1F to i8*), i8* bitcast (void (%struct.D1*)* @_ZN2D13barEv to i8*), i8* bitcast (void (%struct.D1*)* @_ZN2D14bar2Ev to i8*), i8* bitcast (void (%struct.D1*)* @_ZN2D14bar3Ev to i8*), i8* bitcast (void (%struct.D1*)* @_ZN2D14bar4Ev to i8*), i8* bitcast (void (%struct.D1*)* @_ZN2D14bar5Ev to i8*)] -static_assert(sizeof(F) == sizeof(void*)*4, "invalid vbase size"); struct E { int e; @@ -105,6 +67,8 @@ public: void A::foo1() { } void A::foo2() { } +// CHECK-LPLL64:@_ZTV1A = constant [10 x i8*] [i8* null, i8* bitcast (%2* @_ZTI1A to i8*), i8* bitcast (void (%struct.B*)* @_ZN1B4bar1Ev to i8*), i8* bitcast (void (%struct.B*)* @_ZN1B4bar2Ev to i8*), i8* bitcast (void (%class.A*)* @_ZN1A4foo1Ev to i8*), i8* bitcast (void (%class.A*)* @_ZN1A4foo2Ev to i8*), i8* inttoptr (i64 -16 to i8*), i8* bitcast (%2* @_ZTI1A to i8*), i8* bitcast (void (%class.test14*)* @_ZN1C4bee1Ev to i8*), i8* bitcast (void (%class.test14*)* @_ZN1C4bee2Ev to i8*)] + int main() { A a; B b; @@ -112,18 +76,6 @@ int main() { ap->b = 2; } -// CHECK-LP64: __ZTV1A: -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad __ZTI1A -// CHECK-LP64-NEXT: .quad __ZN1B4bar1Ev -// CHECK-LP64-NEXT: .quad __ZN1B4bar2Ev -// CHECK-LP64-NEXT: .quad __ZN1A4foo1Ev -// CHECK-LP64-NEXT: .quad __ZN1A4foo2Ev -// CHECK-LP64-NEXT: .quad 18446744073709551600 -// CHECK-LP64-NEXT: .quad __ZTI1A -// CHECK-LP64-NEXT: .quad __ZN1C4bee1Ev -// CHECK-LP64-NEXT: .quad __ZN1C4bee2Ev - struct test12_A { virtual void foo0() { } @@ -136,24 +88,6 @@ struct test12_B : public test12_A { struct test12_D : public test12_B { } *test12_pd; -void test12_foo() { - test12_pa->foo0(); - test12_pb->foo0(); - test12_pd->foo0(); - test12_pa->foo(); - test12_pb->foo(); - test12_pd->foo(); - test12_pa->test12_A::foo(); -} - -// CHECK-LPLL64:define void @_Z10test12_foov() nounwind { -// CHECK-LPLL64: call void % -// CHECK-LPLL64: call void % -// CHECK-LPLL64: call void % -// CHECK-LPLL64: call void % -// CHECK-LPLL64: call void % -// CHECK-LPLL64: call void % -// CHECK-LPLL64: call void @_ZN8test12_A3fooEv(%class.test14* %{{.*}}) struct test6_B2 { virtual void funcB2(); char b[1000]; }; @@ -162,7 +96,7 @@ struct test6_B1 : virtual test6_B2 { virtual void funcB1(); }; struct test6_D : test6_B2, virtual test6_B1 { }; -// CHECK-LP64: .zerofill __DATA, __common, _d6, 2024, 4 +// CHECK-LP64: .zerofill __DATA,__common,_d6,2024,4 struct test7_B2 { virtual void funcB2(); }; struct test7_B1 : virtual test7_B2 { virtual void funcB1(); }; @@ -170,7 +104,7 @@ struct test7_B1 : virtual test7_B2 { virtual void funcB1(); }; struct test7_D : test7_B2, virtual test7_B1 { }; -// CHECK-LP64: .zerofill __DATA, __common, _d7, 16, 3 +// CHECK-LP64: .zerofill __DATA,__common,_d7,16,3 struct test3_B3 { virtual void funcB3(); }; @@ -181,38 +115,13 @@ struct test3_D : virtual test3_B1 { virtual void funcD() { } }; -// CHECK-LP64:__ZTV7test3_D: -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad __ZTI7test3_D -// CHECK-LP64-NEXT: .quad __ZN8test3_B36funcB3Ev -// CHECK-LP64-NEXT: .quad __ZN8test3_B26funcB2Ev -// CHECK-LP64-NEXT: .quad __ZN8test3_B16funcB1Ev -// CHECK-LP64-NEXT: .quad __ZN7test3_D5funcDEv +// CHECK-LPLL64:@_ZTV7test3_D = weak_odr constant [12 x i8*] [i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* bitcast (%3* @_ZTI7test3_D to i8*), i8* bitcast (void (%class.test14*)* @_ZN8test3_B36funcB3Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN8test3_B26funcB2Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN8test3_B16funcB1Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN7test3_D5funcDEv to i8*)] + struct test4_D : virtual B, virtual C { }; -// CHECK-LP64:__ZTV7test4_D: -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad __ZTI7test4_D -// CHECK-LP64-NEXT: .quad __ZN1C4bee1Ev -// CHECK-LP64-NEXT: .quad __ZN1C4bee2Ev -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 18446744073709551608 -// CHECK-LP64-NEXT: .quad __ZTI7test4_D -// CHECK-LP64-NEXT: .quad __ZN1B4bar1Ev -// CHECK-LP64-NEXT: .quad __ZN1B4bar2Ev +// CHECK-LPLL64:@_ZTV7test4_D = weak_odr constant [14 x i8*] [i8* null, i8* inttoptr (i64 8 to i8*), i8* null, i8* null, i8* null, i8* bitcast (%1* @_ZTI7test4_D to i8*), i8* bitcast (void (%class.test14*)* @_ZN1C4bee1Ev to i8*), i8* bitcast (void (%class.test14*)* @_ZN1C4bee2Ev to i8*), i8* null, i8* null, i8* inttoptr (i64 -8 to i8*), i8* bitcast (%1* @_ZTI7test4_D to i8*), i8* bitcast (void (%struct.B*)* @_ZN1B4bar1Ev to i8*), i8* bitcast (void (%struct.B*)* @_ZN1B4bar2Ev to i8*)] struct test5_B3 { virtual void funcB3(); }; @@ -235,57 +144,7 @@ struct test5_D : virtual test5_B1, virtual test5_B21, virtual test5_B31 { virtual void funcD() { } }; -// CHECK-LP64:__ZTV7test5_D: -// CHECK-LP64-NEXT: .quad 32 -// CHECK-LP64-NEXT: .quad 24 -// CHECK-LP64-NEXT: .quad 16 -// CHECK-LP64-NEXT: .quad 16 -// CHECK-LP64-NEXT: .quad 16 -// CHECK-LP64-NEXT: .quad 8 -// CHECK-LP64-NEXT: .quad 8 -// CHECK-LP64-NEXT: .quad 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad __ZTI7test5_D -// CHECK-LP64-NEXT: .quad __ZN8test5_B36funcB3Ev -// CHECK-LP64-NEXT: .quad __ZN8test5_B26funcB2Ev -// CHECK-LP64-NEXT: .quad __ZN8test5_B16funcB1Ev -// CHECK-LP64-NEXT: .quad __ZN7test5_D5funcDEv -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 18446744073709551608 -// CHECK-LP64-NEXT: .quad __ZTI7test5_D -// CHECK-LP64-NEXT: .quad __ZN9test5_B237funcB23Ev -// CHECK-LP64-NEXT: .quad __ZN9test5_B227funcB22Ev -// CHECK-LP64-NEXT: .quad __ZN9test5_B217funcB21Ev -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 16 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 18446744073709551600 -// CHECK-LP64-NEXT: .quad __ZTI7test5_D -// CHECK-LP64-NEXT: .quad __ZN9test5_B337funcB33Ev -// CHECK-LP64-NEXT: .quad __ZN9test5_B327funcB32Ev -// CHECK-LP64-NEXT: .quad __ZN9test5_B317funcB31Ev -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 18446744073709551592 -// CHECK-LP64-NEXT: .quad __ZTI7test5_D -// CHECK-LP64-NEXT: .quad __ZN4B2328funcB232Ev -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 18446744073709551584 -// CHECK-LP64-NEXT: .quad __ZTI7test5_D -// CHECK-LP64-NEXT: .quad __ZN4B2318funcB231Ev +// CHECK-LPLL64:@_ZTV7test5_D = weak_odr constant [50 x i8*] [i8* inttoptr (i64 32 to i8*), i8* inttoptr (i64 24 to i8*), i8* inttoptr (i64 16 to i8*), i8* inttoptr (i64 16 to i8*), i8* inttoptr (i64 16 to i8*), i8* inttoptr (i64 8 to i8*), i8* inttoptr (i64 8 to i8*), i8* inttoptr (i64 8 to i8*), i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* bitcast (%2* @_ZTI7test5_D to i8*), i8* bitcast (void (%class.test14*)* @_ZN8test5_B36funcB3Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN8test5_B26funcB2Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN8test5_B16funcB1Ev to i8*), i8* bitcast (void (%struct.test10_B2*)* @_ZN7test5_D5funcDEv to i8*), i8* null, i8* null, i8* null, i8* null, i8* null, i8* inttoptr (i64 -8 to i8*), i8* bitcast (%2* @_ZTI7test5_D to i8*), i8* bitcast (void (%class.test14*)* @_ZN9test5_B237funcB23Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN9test5_B227funcB22Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN9test5_B217funcB21Ev to i8*), i8* null, i8* inttoptr (i64 16 to i8*), i8* null, i8* null, i8* inttoptr (i64 8 to i8*), i8* null, i8* null, i8* inttoptr (i64 -16 to i8*), i8* bitcast (%2* @_ZTI7test5_D to i8*), i8* bitcast (void (%class.test14*)* @_ZN9test5_B337funcB33Ev to i8*), i8* bitcast (void (%class.test20_D*)* @_ZN9test5_B327funcB32Ev to i8*), i8* bitcast (void (%class.test23_D*)* @_ZN9test5_B317funcB31Ev to i8*), i8* null, i8* inttoptr (i64 -24 to i8*), i8* bitcast (%2* @_ZTI7test5_D to i8*), i8* bitcast (void (%class.test14*)* @_ZN4B2328funcB232Ev to i8*), i8* null, i8* inttoptr (i64 -32 to i8*), i8* bitcast (%2* @_ZTI7test5_D to i8*), i8* bitcast (void (%class.test14*)* @_ZN4B2318funcB231Ev to i8*)] struct test8_B1 { virtual void ftest8_B1() { } @@ -313,75 +172,13 @@ struct test8_B3 { class test8_D : test8_B1, test8_B2, test8_B3 { }; -// CHECK-LP64:__ZTV7test8_D: -// CHECK-LP64-NEXT: .quad 48 -// CHECK-LP64-NEXT: .quad 32 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad __ZTI7test8_D -// CHECK-LP64-NEXT: .quad __ZN8test8_B19ftest8_B1Ev -// CHECK-LP64-NEXT: .quad 40 -// CHECK-LP64-NEXT: .quad 24 -// CHECK-LP64-NEXT: .quad 18446744073709551608 -// CHECK-LP64-NEXT: .quad __ZTI7test8_D -// CHECK-LP64-NEXT: .quad __ZN9test8_B2a10ftest8_B2aEv -// CHECK-LP64-NEXT: .quad __ZN8test8_B29ftest8_B2Ev -// CHECK-LP64-NEXT: .quad 18446744073709551600 -// CHECK-LP64-NEXT: .quad __ZTI7test8_D -// CHECK-LP64-NEXT: .quad __ZN9test8_B2b10ftest8_B2bEv -// CHECK-LP64-NEXT: .quad 18446744073709551592 -// CHECK-LP64-NEXT: .quad __ZTI7test8_D -// CHECK-LP64-NEXT: .quad __ZN8test8_B39ftest8_B3Ev -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 18446744073709551584 -// CHECK-LP64-NEXT: .quad __ZTI7test8_D -// CHECK-LP64-NEXT: .quad __ZN10test8_B2aa11ftest8_B2aaEv -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 18446744073709551568 -// CHECK-LP64-NEXT: .quad __ZTI7test8_D -// CHECK-LP64-NEXT: .quad __ZN10test8_B2ab11ftest8_B2abEv - -// CHECK-LP64:__ZTC7test8_D8_8test8_B2: -// CHECK-LP64-NEXT: .quad 40 -// CHECK-LP64-NEXT: .quad 24 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad __ZTI8test8_B2 -// CHECK-LP64-NEXT: .quad __ZN9test8_B2a10ftest8_B2aEv -// CHECK-LP64-NEXT: .quad __ZN8test8_B29ftest8_B2Ev -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 18446744073709551592 -// CHECK-LP64-NEXT: .quad __ZTI8test8_B2 -// CHECK-LP64-NEXT: .quad __ZN10test8_B2aa11ftest8_B2aaEv -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 18446744073709551576 -// CHECK-LP64-NEXT: .quad __ZTI8test8_B2 -// CHECK-LP64-NEXT: .quad __ZN10test8_B2ab11ftest8_B2abEv - -// CHECK-LP64:__ZTC7test8_D8_9test8_B2a: -// CHECK-LP64-NEXT: .quad 40 -// CHECK-LP64-NEXT: .quad 24 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad __ZTI9test8_B2a -// CHECK-LP64-NEXT: .quad __ZN9test8_B2a10ftest8_B2aEv -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 18446744073709551592 -// CHECK-LP64-NEXT: .quad __ZTI9test8_B2a -// CHECK-LP64-NEXT: .quad __ZN10test8_B2aa11ftest8_B2aaEv -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 18446744073709551576 -// CHECK-LP64-NEXT: .quad __ZTI9test8_B2a -// CHECK-LP64-NEXT: .quad __ZN10test8_B2ab11ftest8_B2abEv - -// CHECK-LP64:__ZTT7test8_D: -// CHECK-LP64-NEXT: .quad (__ZTV7test8_D) + 32 -// CHECK-LP64-NEXT: .quad (__ZTC7test8_D8_8test8_B2) + 32 -// CHECK-LP64-NEXT: .quad (__ZTC7test8_D8_9test8_B2a) + 32 -// CHECK-LP64-NEXT .quad (__ZTC7test8_D8_9test8_B2a) + 64 -// CHECK-LP64-NEXT .quad (__ZTC7test8_D8_9test8_B2a) + 96 -// CHECK-LP64-NEXT .quad (__ZTC7test8_D8_8test8_B2) + 72 -// CHECK-LP64-NEXT .quad (__ZTC7test8_D8_8test8_B2) + 104 -// CHECK-LP64-NEXT .quad (__ZTV7test8_D) + 72 -// CHECK-LP64: .quad (__ZTV7test8_D) + 160 -// CHECK-LP64: .quad (__ZTV7test8_D) + 192 +// CHECK-LPLL64:@_ZTV7test8_D = weak_odr constant [25 x i8*] [i8* inttoptr (i64 48 to i8*), i8* inttoptr (i64 32 to i8*), i8* null, i8* bitcast (%2* @_ZTI7test8_D to i8*), i8* bitcast (void (%class.test14*)* @_ZN8test8_B19ftest8_B1Ev to i8*), i8* inttoptr (i64 40 to i8*), i8* inttoptr (i64 24 to i8*), i8* inttoptr (i64 -8 to i8*), i8* bitcast (%2* @_ZTI7test8_D to i8*), i8* bitcast (void (%struct.test10_B2a*)* @_ZN9test8_B2a10ftest8_B2aEv to i8*), i8* bitcast (void (%struct.test15_D*)* @_ZN8test8_B29ftest8_B2Ev to i8*), i8* inttoptr (i64 -16 to i8*), i8* bitcast (%2* @_ZTI7test8_D to i8*), i8* bitcast (void (%class.test14*)* @_ZN9test8_B2b10ftest8_B2bEv to i8*), i8* inttoptr (i64 -24 to i8*), i8* bitcast (%2* @_ZTI7test8_D to i8*), i8* bitcast (void (%class.test14*)* @_ZN8test8_B39ftest8_B3Ev to i8*), i8* null, i8* inttoptr (i64 -32 to i8*), i8* bitcast (%2* @_ZTI7test8_D to i8*), i8* bitcast (void (%struct.B*)* @_ZN10test8_B2aa11ftest8_B2aaEv to i8*), i8* null, i8* inttoptr (i64 -48 to i8*), i8* bitcast (%2* @_ZTI7test8_D to i8*), i8* bitcast (void (%struct.B*)* @_ZN10test8_B2ab11ftest8_B2abEv to i8*)] + +// CHECK-LPLL64:@_ZTC7test8_D8_8test8_B2 = internal constant [14 x i8*] [i8* inttoptr (i64 40 to i8*), i8* inttoptr (i64 24 to i8*), i8* null, i8* bitcast (%1* @_ZTI8test8_B2 to i8*), i8* bitcast (void (%struct.test10_B2a*)* @_ZN9test8_B2a10ftest8_B2aEv to i8*), i8* bitcast (void (%struct.test15_D*)* @_ZN8test8_B29ftest8_B2Ev to i8*), i8* null, i8* inttoptr (i64 -24 to i8*), i8* bitcast (%1* @_ZTI8test8_B2 to i8*), i8* bitcast (void (%struct.B*)* @_ZN10test8_B2aa11ftest8_B2aaEv to i8*), i8* null, i8* inttoptr (i64 -40 to i8*), i8* bitcast (%1* @_ZTI8test8_B2 to i8*), i8* bitcast (void (%struct.B*)* @_ZN10test8_B2ab11ftest8_B2abEv to i8*)] ; <[14 x i8*]*> [#uses=3] + +// CHECK-LPLL64:@_ZTC7test8_D8_9test8_B2a = internal constant [13 x i8*] [i8* inttoptr (i64 40 to i8*), i8* inttoptr (i64 24 to i8*), i8* null, i8* bitcast (%1* @_ZTI9test8_B2a to i8*), i8* bitcast (void (%struct.test10_B2a*)* @_ZN9test8_B2a10ftest8_B2aEv to i8*), i8* null, i8* inttoptr (i64 -24 to i8*), i8* bitcast (%1* @_ZTI9test8_B2a to i8*), i8* bitcast (void (%struct.B*)* @_ZN10test8_B2aa11ftest8_B2aaEv to i8*), i8* null, i8* inttoptr (i64 -40 to i8*), i8* bitcast (%1* @_ZTI9test8_B2a to i8*), i8* bitcast (void (%struct.B*)* @_ZN10test8_B2ab11ftest8_B2abEv to i8*)] ; <[13 x i8*]*> [#uses=3] + +// CHECK-LPLL64:@_ZTT7test8_D = weak_odr constant [10 x i8*] [i8* bitcast (i8** getelementptr inbounds ([25 x i8*]* @_ZTV7test8_D, i64 0, i64 4) to i8*), i8* bitcast (i8** getelementptr inbounds ([14 x i8*]* @_ZTC7test8_D8_8test8_B2, i64 0, i64 4) to i8*), i8* bitcast (i8** getelementptr inbounds ([13 x i8*]* @_ZTC7test8_D8_9test8_B2a, i64 0, i64 4) to i8*), i8* bitcast (i8** getelementptr inbounds ([13 x i8*]* @_ZTC7test8_D8_9test8_B2a, i64 0, i64 8) to i8*), i8* bitcast (i8** getelementptr inbounds ([13 x i8*]* @_ZTC7test8_D8_9test8_B2a, i64 0, i64 12) to i8*), i8* bitcast (i8** getelementptr inbounds ([14 x i8*]* @_ZTC7test8_D8_8test8_B2, i64 0, i64 9) to i8*), i8* bitcast (i8** getelementptr inbounds ([14 x i8*]* @_ZTC7test8_D8_8test8_B2, i64 0, i64 13) to i8*), i8* bitcast (i8** getelementptr inbounds ([25 x i8*]* @_ZTV7test8_D, i64 0, i64 9) to i8*), i8* bitcast (i8** getelementptr inbounds ([25 x i8*]* @_ZTV7test8_D, i64 0, i64 20) to i8*), i8* bitcast (i8** getelementptr inbounds ([25 x i8*]* @_ZTV7test8_D, i64 0, i64 24) to i8*)] struct test9_B3 { virtual void funcB3(); int i; }; @@ -404,77 +201,7 @@ struct test9_D : virtual test9_B1, virtual test9_B21, virtual test9_B31 { virtual void funcD() { } }; -// CHECK-LP64: __ZTV7test9_D: -// CHECK-LP64-NEXT: .quad 168 -// CHECK-LP64-NEXT: .quad 152 -// CHECK-LP64-NEXT: .quad 136 -// CHECK-LP64-NEXT: .quad 120 -// CHECK-LP64-NEXT: .quad 104 -// CHECK-LP64-NEXT: .quad 88 -// CHECK-LP64-NEXT: .quad 72 -// CHECK-LP64-NEXT: .quad 56 -// CHECK-LP64-NEXT: .quad 40 -// CHECK-LP64-NEXT: .quad 24 -// CHECK-LP64-NEXT: .quad 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad __ZTI7test9_D -// CHECK-LP64-NEXT: .quad __ZN7test9_D5funcDEv -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 32 -// CHECK-LP64-NEXT: .quad 16 -// CHECK-LP64-NEXT: .quad 18446744073709551608 -// CHECK-LP64-NEXT: .quad __ZTI7test9_D -// CHECK-LP64-NEXT: .quad __ZN8test9_B16funcB1Ev -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 16 -// CHECK-LP64-NEXT: .quad 18446744073709551592 -// CHECK-LP64-NEXT: .quad __ZTI7test9_D -// CHECK-LP64-NEXT: .quad __ZN8test9_B26funcB2Ev -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 18446744073709551576 -// CHECK-LP64-NEXT: .quad __ZTI7test9_D -// CHECK-LP64-NEXT: .quad __ZN8test9_B36funcB3Ev -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 32 -// CHECK-LP64-NEXT: .quad 16 -// CHECK-LP64-NEXT: .quad 18446744073709551560 -// CHECK-LP64-NEXT: .quad __ZTI7test9_D -// CHECK-LP64-NEXT: .quad __ZN9test9_B217funcB21Ev -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 16 -// CHECK-LP64-NEXT: .quad 18446744073709551544 -// CHECK-LP64-NEXT: .quad __ZTI7test9_D -// CHECK-LP64-NEXT: .quad __ZN9test9_B227funcB22Ev -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 18446744073709551528 -// CHECK-LP64-NEXT: .quad __ZTI7test9_D -// CHECK-LP64-NEXT: .quad __ZN9test9_B237funcB23Ev -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 64 -// CHECK-LP64-NEXT: .quad 48 -// CHECK-LP64-NEXT: .quad 32 -// CHECK-LP64-NEXT: .quad 16 -// CHECK-LP64-NEXT: .quad 18446744073709551512 -// CHECK-LP64-NEXT: .quad __ZTI7test9_D -// CHECK-LP64-NEXT: .quad __ZN9test9_B317funcB31Ev -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 32 -// CHECK-LP64-NEXT: .quad 16 -// CHECK-LP64-NEXT: .quad 18446744073709551496 -// CHECK-LP64-NEXT: .quad __ZTI7test9_D -// CHECK-LP64-NEXT: .quad __ZN9test9_B327funcB32Ev -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 18446744073709551480 -// CHECK-LP64-NEXT: .quad __ZTI7test9_D -// CHECK-LP64-NEXT: .quad __ZN9test9_B337funcB33Ev -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 18446744073709551464 -// CHECK-LP64-NEXT: .quad __ZTI7test9_D -// CHECK-LP64-NEXT: .quad __ZN10test9_B2328funcB232Ev -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 18446744073709551448 -// CHECK-LP64-NEXT: .quad __ZTI7test9_D -// CHECK-LP64-NEXT: .quad __ZN10test9_B2318funcB231Ev +// CHECK-LPLL64:@_ZTV7test9_D = weak_odr constant [70 x i8*] [i8* inttoptr (i64 168 to i8*), i8* inttoptr (i64 152 to i8*), i8* inttoptr (i64 136 to i8*), i8* inttoptr (i64 120 to i8*), i8* inttoptr (i64 104 to i8*), i8* inttoptr (i64 88 to i8*), i8* inttoptr (i64 72 to i8*), i8* inttoptr (i64 56 to i8*), i8* inttoptr (i64 40 to i8*), i8* inttoptr (i64 24 to i8*), i8* inttoptr (i64 8 to i8*), i8* null, i8* bitcast (%2* @_ZTI7test9_D to i8*), i8* bitcast (void (%struct.test9_D*)* @_ZN7test9_D5funcDEv to i8*), i8* null, i8* inttoptr (i64 32 to i8*), i8* inttoptr (i64 16 to i8*), i8* inttoptr (i64 -8 to i8*), i8* bitcast (%2* @_ZTI7test9_D to i8*), i8* bitcast (void (%struct.test9_B1*)* @_ZN8test9_B16funcB1Ev to i8*), i8* null, i8* inttoptr (i64 16 to i8*), i8* inttoptr (i64 -24 to i8*), i8* bitcast (%2* @_ZTI7test9_D to i8*), i8* bitcast (void (%struct.test13_B2*)* @_ZN8test9_B26funcB2Ev to i8*), i8* null, i8* inttoptr (i64 -40 to i8*), i8* bitcast (%2* @_ZTI7test9_D to i8*), i8* bitcast (void (%struct.B*)* @_ZN8test9_B36funcB3Ev to i8*), i8* null, i8* inttoptr (i64 32 to i8*), i8* inttoptr (i64 16 to i8*), i8* inttoptr (i64 -56 to i8*), i8* bitcast (%2* @_ZTI7test9_D to i8*), i8* bitcast (void (%struct.test9_B1*)* @_ZN9test9_B217funcB21Ev to i8*), i8* null, i8* inttoptr (i64 16 to i8*), i8* inttoptr (i64 -72 to i8*), i8* bitcast (%2* @_ZTI7test9_D to i8*), i8* bitcast (void (%struct.test13_B2*)* @_ZN9test9_B227funcB22Ev to i8*), i8* null, i8* inttoptr (i64 -88 to i8*), i8* bitcast (%2* @_ZTI7test9_D to i8*), i8* bitcast (void (%struct.B*)* @_ZN9test9_B237funcB23Ev to i8*), i8* null, i8* inttoptr (i64 64 to i8*), i8* inttoptr (i64 48 to i8*), i8* inttoptr (i64 32 to i8*), i8* inttoptr (i64 16 to i8*), i8* inttoptr (i64 -104 to i8*), i8* bitcast (%2* @_ZTI7test9_D to i8*), i8* bitcast (void (%struct.test9_B31*)* @_ZN9test9_B317funcB31Ev to i8*), i8* null, i8* inttoptr (i64 32 to i8*), i8* inttoptr (i64 16 to i8*), i8* inttoptr (i64 -120 to i8*), i8* bitcast (%2* @_ZTI7test9_D to i8*), i8* bitcast (void (%struct.test9_B1*)* @_ZN9test9_B327funcB32Ev to i8*), i8* null, i8* inttoptr (i64 -136 to i8*), i8* bitcast (%2* @_ZTI7test9_D to i8*), i8* bitcast (void (%struct.B*)* @_ZN9test9_B337funcB33Ev to i8*), i8* null, i8* inttoptr (i64 -152 to i8*), i8* bitcast (%2* @_ZTI7test9_D to i8*), i8* bitcast (void (%struct.B*)* @_ZN10test9_B2328funcB232Ev to i8*), i8* null, i8* inttoptr (i64 -168 to i8*), i8* bitcast (%2* @_ZTI7test9_D to i8*), i8* bitcast (void (%struct.B*)* @_ZN10test9_B2318funcB231Ev to i8*)] ; <[70 x i8*]*> [#uses=12] struct test10_O { int i; }; @@ -503,26 +230,7 @@ class test10_D : test10_B1, test10_B2 { void ftest10_B2aa() { } }; -// CHECK-LP64:__ZTV8test10_D: -// CHECK-LP64-NEXT: .quad 40 -// CHECK-LP64-NEXT: .quad 24 -// CHECK-LP64-NEXT: .quad 16 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad __ZTI8test10_D -// CHECK-LP64-NEXT: .quad __ZN9test10_B110ftest10_B1Ev -// CHECK-LP64-NEXT: .quad 32 -// CHECK-LP64-NEXT: .quad 8 -// CHECK-LP64-NEXT: .quad 16 -// CHECK-LP64-NEXT: .quad 18446744073709551608 -// CHECK-LP64-NEXT: .quad __ZTI8test10_D -// CHECK-LP64-NEXT: .quad __ZN10test10_B2a11ftest10_B2aEv -// CHECK-LP64-NEXT: .quad __ZN9test10_B210ftest10_B2Ev -// CHECK-LP64-NEXT: .quad 18446744073709551608 -// CHECK-LP64-NEXT: .quad 18446744073709551592 -// CHECK-LP64-NEXT: .quad __ZTI8test10_D -// CHECK-LP64-NEXT: .quad 18446744073709551592 -// CHECK-LP64-NEXT: .quad 18446744073709551576 -// CHECK-LP64-NEXT: .quad __ZTI8test10_D +// CHECK-LPLL64:@_ZTV8test10_D = weak_odr constant [19 x i8*] [i8* inttoptr (i64 40 to i8*), i8* inttoptr (i64 24 to i8*), i8* inttoptr (i64 16 to i8*), i8* null, i8* bitcast (%1* @_ZTI8test10_D to i8*), i8* bitcast (void (%struct.test10_B1*)* @_ZN9test10_B110ftest10_B1Ev to i8*), i8* inttoptr (i64 32 to i8*), i8* inttoptr (i64 8 to i8*), i8* inttoptr (i64 16 to i8*), i8* inttoptr (i64 -8 to i8*), i8* bitcast (%1* @_ZTI8test10_D to i8*), i8* bitcast (void (%struct.test10_B2a*)* @_ZN10test10_B2a11ftest10_B2aEv to i8*), i8* bitcast (void (%struct.test10_B2*)* @_ZN9test10_B210ftest10_B2Ev to i8*), i8* inttoptr (i64 -8 to i8*), i8* inttoptr (i64 -24 to i8*), i8* bitcast (%1* @_ZTI8test10_D to i8*), i8* inttoptr (i64 -24 to i8*), i8* inttoptr (i64 -40 to i8*), i8* bitcast (%1* @_ZTI8test10_D to i8*)] ; <[19 x i8*]*> [#uses=4] struct test11_B { @@ -537,14 +245,8 @@ struct test11_D : test11_B { virtual void D2() { } }; -// CHECK-LP64:__ZTV8test11_D: -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad __ZTI8test11_D -// CHECK-LP64-NEXT: .quad __ZN8test11_B2B1Ev -// CHECK-LP64-NEXT: .quad __ZN8test11_D1DEv -// CHECK-LP64-NEXT: .quad __ZN8test11_B2B2Ev -// CHECK-LP64-NEXT: .quad __ZN8test11_D2D1Ev -// CHECK-LP64-NEXT: .quad __ZN8test11_D2D2Ev +// CHECK-LPLL64:@_ZTV8test11_D = weak_odr constant [7 x i8*] [i8* null, i8* bitcast (%4* @_ZTI8test11_D to i8*), i8* bitcast (void (%class.test14*)* @_ZN8test11_B2B1Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN8test11_D1DEv to i8*), i8* bitcast (void (%class.test14*)* @_ZN8test11_B2B2Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN8test11_D2D1Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN8test11_D2D2Ev to i8*)] + struct test13_B { virtual void B1() { } @@ -583,46 +285,7 @@ struct test13_D : test13_NV1, virtual test13_B2 { virtual void fooNV1() { } }; -// CHECK-LP64:__ZTV8test13_D: -// CHECK-LP64-NEXT: .quad 24 -// CHECK-LP64-NEXT: .quad 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad __ZTI8test13_D -// CHECK-LP64-NEXT: .quad __ZN8test13_D6fooNV1Ev -// CHECK-LP64-NEXT: .quad __ZN8test13_D1DEv -// CHECK-LP64-NEXT: .quad __ZN8test13_D2D1Ev -// CHECK-LP64-NEXT: .quad __ZN8test13_D2DbEv -// CHECK-LP64-NEXT: .quad __ZN8test13_D2DdEv -// CHECK-LP64-NEXT: .quad __ZN8test13_D2D2Ev -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 18446744073709551608 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 18446744073709551608 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 16 -// CHECK-LP64-NEXT: .quad 18446744073709551608 -// CHECK-LP64-NEXT: .quad __ZTI8test13_D -// CHECK-LP64-NEXT: .quad __ZN9test13_B23B2aEv -// CHECK-LP64-NEXT: .quad __ZN9test13_B22B2Ev -// CHECK-LP64-NEXT: .quad __ZTv0_n48_N8test13_D1DEv -// CHECK-LP64-NEXT: .quad __ZN9test13_B22DaEv -// CHECK-LP64-NEXT: .quad __ZTv0_n64_N8test13_D2DdEv -// CHECK-LP64-NEXT: .quad __ZN9test13_B23B2bEv -// CHECK-LP64-NEXT: .quad 18446744073709551600 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 18446744073709551592 -// CHECK-LP64-NEXT: .quad 18446744073709551600 -// CHECK-LP64-NEXT: .quad 18446744073709551592 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 18446744073709551592 -// CHECK-LP64-NEXT: .quad __ZTI8test13_D -// CHECK-LP64-NEXT: .quad __ZN8test13_B2B1Ev -// CHECK-LP64-NEXT: .quad __ZTv0_n32_N8test13_D1DEv -// CHECK-LP64-NEXT: .quad __ZTv0_n40_N9test13_B22DaEv -// CHECK-LP64-NEXT: .quad __ZTv0_n48_N8test13_D2DbEv -// CHECK-LP64-NEXT: .quad __ZN8test13_B2DcEv -// CHECK-LP64-NEXT: .quad __ZTv0_n64_N9test13_B22B2Ev +// CHECK-LPLL64:@_ZTV8test13_D = weak_odr constant [39 x i8*] [i8* inttoptr (i64 24 to i8*), i8* inttoptr (i64 8 to i8*), i8* null, i8* bitcast (%1* @_ZTI8test13_D to i8*), i8* bitcast (void (%struct.test10_B2*)* @_ZN8test13_D6fooNV1Ev to i8*), i8* bitcast (void (%struct.test10_B2*)* @_ZN8test13_D1DEv to i8*), i8* bitcast (void (%struct.test10_B2*)* @_ZN8test13_D2D1Ev to i8*), i8* bitcast (void (%struct.test10_B2*)* @_ZN8test13_D2DbEv to i8*), i8* bitcast (void (%struct.test10_B2*)* @_ZN8test13_D2DdEv to i8*), i8* bitcast (void (%struct.test10_B2*)* @_ZN8test13_D2D2Ev to i8*), i8* null, i8* inttoptr (i64 -8 to i8*), i8* null, i8* inttoptr (i64 -8 to i8*), i8* null, i8* null, i8* inttoptr (i64 16 to i8*), i8* inttoptr (i64 -8 to i8*), i8* bitcast (%1* @_ZTI8test13_D to i8*), i8* bitcast (void (%struct.test13_B2*)* @_ZN9test13_B23B2aEv to i8*), i8* bitcast (void (%struct.test13_B2*)* @_ZN9test13_B22B2Ev to i8*), i8* bitcast (void (%struct.test10_B2*)* @_ZTv0_n48_N8test13_D1DEv to i8*), i8* bitcast (void (%struct.test13_B2*)* @_ZN9test13_B22DaEv to i8*), i8* bitcast (void (%struct.test10_B2*)* @_ZTv0_n64_N8test13_D2DdEv to i8*), i8* bitcast (void (%struct.test13_B2*)* @_ZN9test13_B23B2bEv to i8*), i8* inttoptr (i64 -16 to i8*), i8* null, i8* inttoptr (i64 -24 to i8*), i8* inttoptr (i64 -16 to i8*), i8* inttoptr (i64 -24 to i8*), i8* null, i8* inttoptr (i64 -24 to i8*), i8* bitcast (%1* @_ZTI8test13_D to i8*), i8* bitcast (void (%struct.B*)* @_ZN8test13_B2B1Ev to i8*), i8* bitcast (void (%struct.test10_B2*)* @_ZTv0_n32_N8test13_D1DEv to i8*), i8* bitcast (void (%struct.test13_B2*)* @_ZTv0_n40_N9test13_B22DaEv to i8*), i8* bitcast (void (%struct.test10_B2*)* @_ZTv0_n48_N8test13_D2DbEv to i8*), i8* bitcast (void (%struct.B*)* @_ZN8test13_B2DcEv to i8*), i8* bitcast (void (%struct.test13_B2*)* @_ZTv0_n64_N9test13_B22B2Ev to i8*)] class test14 { @@ -662,30 +325,7 @@ struct test15_D : test15_NV1, virtual test15_B2 { virtual test15_D *foo1() { return 0; } }; -// CHECK-LP64:__ZTV8test15_D: -// CHECK-LP64-NEXT: .quad 32 -// CHECK-LP64-NEXT: .quad 16 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad __ZTI8test15_D -// CHECK-LP64-NEXT: .quad __ZN10test15_NV16fooNV1Ev -// CHECK-LP64-NEXT: .quad __ZN8test15_D4foo1Ev -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 18446744073709551600 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 16 -// CHECK-LP64-NEXT: .quad 18446744073709551600 -// CHECK-LP64-NEXT: .quad __ZTI8test15_D -// CHECK-LP64-NEXT: .quad __ZN10test15_NV16fooNV1Ev -// CHECK-LP64-NEXT: .quad __ZTcv0_n40_v0_n24_N8test15_D4foo1Ev -// CHECK-LP64-NEXT: .quad __ZN9test15_B24foo2Ev -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 18446744073709551600 -// CHECK-LP64-NEXT: .quad 18446744073709551584 -// CHECK-LP64-NEXT: .quad 18446744073709551584 -// CHECK-LP64-NEXT: .quad __ZTI8test15_D -// CHECK-LP64-NEXT: .quad __ZTcv0_n24_v0_n32_N8test15_D4foo1Ev -// CHECK-LP64-NEXT: .quad __ZTcv0_n32_v0_n24_N9test15_B24foo2Ev -// CHECK-LP64-NEXT: .quad __ZN8test15_B4foo3Ev +// CHECK-LPLL64:@_ZTV8test15_D = weak_odr constant [23 x i8*] [i8* inttoptr (i64 32 to i8*), i8* inttoptr (i64 16 to i8*), i8* null, i8* bitcast (%1* @_ZTI8test15_D to i8*), i8* bitcast (void (%struct.B*)* @_ZN10test15_NV16fooNV1Ev to i8*), i8* bitcast (%struct.test15_D* (%struct.test15_D*)* @_ZN8test15_D4foo1Ev to i8*), i8* null, i8* inttoptr (i64 -16 to i8*), i8* null, i8* inttoptr (i64 16 to i8*), i8* inttoptr (i64 -16 to i8*), i8* bitcast (%1* @_ZTI8test15_D to i8*), i8* bitcast (void (%struct.B*)* @_ZN10test15_NV16fooNV1Ev to i8*), i8* bitcast (%struct.test15_D* (%struct.test15_D*)* @_ZTcv0_n40_v0_n24_N8test15_D4foo1Ev to i8*), i8* bitcast (%struct.test15_B2* (%struct.test15_B2*)* @_ZN9test15_B24foo2Ev to i8*), i8* null, i8* inttoptr (i64 -16 to i8*), i8* inttoptr (i64 -32 to i8*), i8* inttoptr (i64 -32 to i8*), i8* bitcast (%1* @_ZTI8test15_D to i8*), i8* bitcast (%struct.test15_D* (%struct.test15_D*)* @_ZTcv0_n24_v0_n32_N8test15_D4foo1Ev to i8*), i8* bitcast (%struct.test15_B2* (%struct.test15_B2*)* @_ZTcv0_n32_v0_n24_N9test15_B24foo2Ev to i8*), i8* bitcast (%struct.B* (%struct.B*)* @_ZN8test15_B4foo3Ev to i8*)] struct test16_NV1 { @@ -721,22 +361,23 @@ struct test16_D : test16_NV1, virtual test16_B2 { virtual test16_D *foo1() { return 0; } }; +// FIXME: // CHECK-LP64: __ZTV8test16_D: // CHECK-LP64-NEXT: .quad 32 // CHECK-LP64-NEXT: .quad 16 -// CHECK-LP64-NEXT: .space 8 +// CHECK-LP64-NEXT: .quad 0 // CHECK-LP64-NEXT: .quad __ZTI8test16_D // CHECK-LP64-NEXT: .quad __ZN10test16_NV16fooNV1Ev // CHECK-LP64-NEXT: .quad __ZN10test16_NV17foo_NV1Ev // CHECK-LP64-NEXT: .quad __ZN8test16_D3barEv // CHECK-LP64-NEXT: .quad __ZN8test16_D4foo1Ev -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 18446744073709551600 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 +// CHECK-LP64-NEXT: .quad 0 +// CHECK-LP64-NEXT: .quad 0 +// CHECK-LP64-NEXT: .quad -16 +// CHECK-LP64-NEXT: .quad 0 +// CHECK-LP64-NEXT: .quad 0 // CHECK-LP64-NEXT: .quad 16 -// CHECK-LP64-NEXT: .quad 18446744073709551600 +// CHECK-LP64-NEXT: .quad -16 // CHECK-LP64-NEXT: .quad __ZTI8test16_D // CHECK-LP64-NEXT: .quad __ZN10test16_NV16fooNV1Ev // CHECK-LP64-NEXT: .quad __ZN10test16_NV17foo_NV1Ev @@ -745,13 +386,13 @@ struct test16_D : test16_NV1, virtual test16_B2 { // CHECK-LP64-NEXT: .quad __ZN9test16_B26foo_B2Ev // CHECK-LP64-NEXT .quad 16 // CHECK-LP64-NEXT .quad 16 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64: .quad 18446744073709551600 -// CHECK-LP64-NEXT: .quad 18446744073709551584 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 18446744073709551584 +// CHECK-LP64-NEXT: .quad 0 +// CHECK-LP64-NEXT: .quad 0 +// CHECK-LP64: .quad -16 +// CHECK-LP64-NEXT: .quad -32 +// CHECK-LP64-NEXT: .quad 0 +// CHECK-LP64-NEXT: .quad 0 +// CHECK-LP64-NEXT: .quad -32 // CHECK-LP64-NEXT: .quad __ZTI8test16_D // CHECK-LP64-NEXT: .quad __ZN10test16_NV16fooNV1Ev // CHECK-LP64-NEXT: .quad __ZN10test16_NV17foo_NV1Ev @@ -759,64 +400,13 @@ struct test16_D : test16_NV1, virtual test16_B2 { // CHECK-LP64-NEXT: .quad __ZTcv0_n48_v0_n24_N9test16_B24foo2Ev // CHECK-LP64-NEXT: .quad __ZN8test16_B4foo3Ev // CHECK-LP64-NEXT: .quad __ZN8test16_B5foo_BEv -// CHECK-LP64-NEXT: .quad 18446744073709551568 +// CHECK-LP64-NEXT: .quad -48 // CHECK-LP64-NEXT: .quad __ZTI8test16_D // CHECK-LP64-NEXT .quad __ZTcvn16_n40_v16_n32_N8test16_D4foo1Ev // CHECK-LP64: .quad __ZN10test16_NV27foo_NV2Ev // CHECK-LP64-NEXT: .quad __ZN10test16_NV28foo_NV2bEv -// FIXME: This is the wrong thunk, but until these issues are fixed, better -// than nothing. -// CHECK-LPLL64:define weak %class.test8_D* @_ZTcvn16_n72_v16_n32_N8test16_D4foo1Ev(%class.test8_D*) -// CHECK-LPLL64: %{{retval|2}} = alloca %class.test8_D* -// CHECK-LPLL64: %.addr = alloca %class.test8_D* -// CHECK-LPLL64: store %class.test8_D* %0, %class.test8_D** %.addr -// CHECK-LPLL64: %{{this|3}} = load %class.test8_D** %.addr -// CHECK-LPLL64: %{{1|4}} = bitcast %class.test8_D* %{{this|3}} to i8* -// CHECK-LPLL64: %{{2|5}} = getelementptr inbounds i8* %{{1|4}}, i64 -16 -// CHECK-LPLL64: %{{3|6}} = bitcast i8* %{{2|5}} to %class.test8_D* -// CHECK-LPLL64: %{{4|7}} = bitcast %class.test8_D* %{{3|6}} to i8* -// CHECK-LPLL64: %{{5|8}} = bitcast %class.test8_D* %3 to i64** -// CHECK-LPLL64: %{{vtable|9}} = load i64** %{{5|8}} -// CHECK-LPLL64: %{{6|10}} = getelementptr inbounds i64* %{{vtable|9}}, i64 -9 -// CHECK-LPLL64: %{{7|11}} = load i64* %{{6|10}} -// CHECK-LPLL64: %{{8|12}} = getelementptr i8* %{{4|7}}, i64 %{{7|11}} -// CHECK-LPLL64: %{{9|13}} = bitcast i8* %{{8|12}} to %class.test8_D* -// CHECK-LPLL64: %{{call|14}} = call %class.test8_D* @_ZTch0_v16_n32_N8test16_D4foo1Ev(%class.test8_D* %{{9|13}}) -// CHECK-LPLL64: store %class.test8_D* %{{call|14}}, %class.test8_D** %{{retval|2}} -// CHECK-LPLL64: %{{10|15}} = load %class.test8_D** %{{retval|2}} -// CHECK-LPLL64: ret %class.test8_D* %{{10|15}} -// CHECK-LPLL64:} - -// CHECK-LPLL64:define weak %class.test8_D* @_ZTch0_v16_n32_N8test16_D4foo1Ev(%{{class.test8_D|.*}}*) -// CHECK-LPLL64: %{{retval|2}} = alloca %class.test8_D* -// CHECK-LPLL64: %.addr = alloca %class.test8_D* -// CHECK-LPLL64: store %class.test8_D* %0, %class.test8_D** %.addr -// CHECK-LPLL64: %{{this|3}} = load %class.test8_D** %.addr -// CHECK-LPLL64: %{{call|4}} = call %class.test8_D* @_ZN8test16_D4foo1Ev(%class.test8_D* %{{this|3}}) -// CHECK-LPLL64: %{{1|5}} = icmp ne %class.test8_D* %{{call|4}}, null -// CHECK-LPLL64: br i1 %{{1|5}}, label %{{2|6}}, label %{{12|17}} -// CHECK-LPLL64:; <label>:{{2|6}} -// CHECK-LPLL64: %{{3|7}} = bitcast %class.test8_D* %{{call|4}} to i8* -// CHECK-LPLL64: %{{4|8}} = getelementptr inbounds i8* %{{3|7}}, i64 16 -// CHECK-LPLL64: %{{5|9}} = bitcast i8* %4 to %class.test8_D* -// CHECK-LPLL64: %{{6|10}} = bitcast %class.test8_D* %{{5|9}} to i8* -// CHECK-LPLL64: %{{7|11}} = bitcast %class.test8_D* %{{5|9}} to i64** -// CHECK-LPLL64: %{{vtable|12}} = load i64** %{{7|11}} -// CHECK-LPLL64: %{{8|13}} = getelementptr inbounds i64* %vtable, i64 -4 -// CHECK-LPLL64: %{{9|14}} = load i64* %{{8|13}} -// CHECK-LPLL64: %{{10|15}} = getelementptr i8* %{{6|10}}, i64 %{{9|14}} -// CHECK-LPLL64: %{{11|16}} = bitcast i8* %{{10|15}} to %class.test8_D* -// CHECK-LPLL64: br label %{{13|18}} -// CHECK-LPLL64:; <label>:{{12|17}} -// CHECK-LPLL64: br label %{{13|18}} -// CHECK-LPLL64:; <label>:{{13|18}} -// CHECK-LPLL64: %{{14|19}} = phi %class.test8_D* [ %{{11|16}}, %{{2|6}} ], [ %{{call|4}}, %{{12|17}} ] -// CHECK-LPLL64: store %class.test8_D* %{{14|19}}, %class.test8_D** %{{retval|2}} -// CHECK-LPLL64: %{{15|20}} = load %class.test8_D** %{{retval|2}} -// CHECK-LPLL64: ret %class.test8_D* %{{15|20}} -// CHECK-LPLL64:} class test17_B1 { @@ -834,23 +424,11 @@ class test17_D : public test17_B2 { }; -// CHECK-LP64:__ZTV8test17_D: -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad __ZTI8test17_D -// CHECK-LP64-NEXT: .quad __ZN9test17_B23fooEv -// CHECK-LP64-NEXT: .quad __ZN8test17_D3barEv +// CHECK-LPLL64:@_ZTV8test17_D = weak_odr constant [4 x i8*] [i8* null, i8* bitcast (%4* @_ZTI8test17_D to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN9test17_B23fooEv to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN8test17_D3barEv to i8*)] -// CHECK-LP64:__ZTV9test17_B2: -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad __ZTI9test17_B2 -// CHECK-LP64-NEXT: .quad __ZN9test17_B23fooEv -// CHECK-LP64-NEXT: .quad ___cxa_pure_virtual +// CHECK-LPLL64:@_ZTV9test17_B2 = weak_odr constant [4 x i8*] [i8* null, i8* bitcast (%4* @_ZTI9test17_B2 to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN9test17_B23fooEv to i8*), i8* bitcast (void ()* @__cxa_pure_virtual to i8*)] -// CHECK-LP64:__ZTV9test17_B1: -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad __ZTI9test17_B1 -// CHECK-LP64-NEXT: .quad ___cxa_pure_virtual -// CHECK-LP64-NEXT: .quad __ZN9test17_B13barEv +// CHECK-LPLL64:@_ZTV9test17_B1 = weak_odr constant [4 x i8*] [i8* null, i8* bitcast (%0* @_ZTI9test17_B1 to i8*), i8* bitcast (void ()* @__cxa_pure_virtual to i8*), i8* bitcast (void (%class.test14*)* @_ZN9test17_B13barEv to i8*)] struct test18_NV1 { @@ -932,47 +510,19 @@ struct test19_D : virtual test19_B4 { }; -// CHECK-LP64: __ZTV8test19_D: -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad __ZTI8test19_D -// CHECK-LP64-NEXT: .quad __ZN9test19_B13fB1Ev -// CHECK-LP64-NEXT: .quad __ZN9test19_B26foB1B2Ev -// CHECK-LP64-NEXT: .quad __ZN9test19_B36foB1B3Ev -// CHECK-LP64-NEXT: .quad __ZN9test19_B46foB1B4Ev -// CHECK-LP64-NEXT: .quad __ZN9test19_B23fB2Ev -// CHECK-LP64-NEXT: .quad __ZN9test19_B36foB2B3Ev -// CHECK-LP64-NEXT: .quad __ZN9test19_B46foB2B4Ev -// CHECK-LP64-NEXT: .quad __ZN9test19_B33fB3Ev -// CHECK-LP64-NEXT: .quad __ZN9test19_B46foB3B4Ev -// CHECK-LP64-NEXT: .quad __ZN9test19_B43fB4Ev +// CHECK-LPLL64:@_ZTV8test19_D = weak_odr constant [28 x i8*] [i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* bitcast (%3* @_ZTI8test19_D to i8*), i8* bitcast (void (%class.test14*)* @_ZN9test19_B13fB1Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN9test19_B26foB1B2Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN9test19_B36foB1B3Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN9test19_B46foB1B4Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN9test19_B23fB2Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN9test19_B36foB2B3Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN9test19_B46foB2B4Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN9test19_B33fB3Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN9test19_B46foB3B4Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN9test19_B43fB4Ev to i8*)] +// FIXME: // CHECK-LP64: __ZTT8test19_D: -// CHECK-LP64-NEXT: .quad (__ZTV8test19_D) + 144 -// CHECK-LP64-NEXT: .quad (__ZTV8test19_D) + 144 -// CHECK-LP64-NEXT .quad (__ZTV8test19_D) + 144 -// CHECK-LP64-NEXT .quad (__ZTC8test19_D0_9test19_B4) + 136 -// CHECK-LP64-NEXT .quad (__ZTC8test19_D0_9test19_B3) + 104 -// CHECK-LP64-NEXT .quad (__ZTC8test19_D0_9test19_B3) + 104 -// CHECK-LP64-NEXT .quad (__ZTC8test19_D0_9test19_B4) + 136 -// CHECK-LP64-NEXT .quad (__ZTC8test19_D0_9test19_B2) + 88 -// CHECK-LP64-NEXT .quad (__ZTC8test19_D0_9test19_B1) + 24 - +// CHECK-LP64-NEXT: .quad __ZTV8test19_D+144 +// CHECK-LP64-NEXT: .quad __ZTV8test19_D+144 +// CHECK-LP64-NEXT .quad __ZTV8test19_D+144 +// CHECK-LP64-NEXT .quad __ZTC8test19_D0_9test19_B4+136 +// CHECK-LP64-NEXT .quad __ZTC8test19_D0_9test19_B3+104 +// CHECK-LP64-NEXT .quad __ZTC8test19_D0_9test19_B3+104 +// CHECK-LP64-NEXT .quad __ZTC8test19_D0_9test19_B4+136 +// CHECK-LP64-NEXT .quad __ZTC8test19_D0_9test19_B2+88 +// CHECK-LP64-NEXT .quad __ZTC8test19_D0_9test19_B1+24 class test20_V { virtual void foo1(); @@ -987,42 +537,22 @@ class test20_B1 : virtual test20_V1 { class test20_D : public test20_B, public test20_B1 { }; -// CHECK-LP64: __ZTV8test20_D: -// CHECK-LP64-NEXT: .quad 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad __ZTI8test20_D -// CHECK-LP64-NEXT: .quad __ZN8test20_V4foo1Ev -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 18446744073709551608 -// CHECK-LP64-NEXT: .quad __ZTI8test20_D -// CHECK-LP64-NEXT: .quad __ZN9test20_V14foo2Ev - -// CHECK-LP64: __ZTC8test20_D0_8test20_B: -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad __ZTI8test20_B -// CHECK-LP64-NEXT: .quad __ZN8test20_V4foo1Ev - -// CHECK-LP64: __ZTC8test20_D8_9test20_B1: -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad __ZTI9test20_B1 -// CHECK-LP64-NEXT: .quad __ZN9test20_V14foo2Ev +// CHECK-LPLL64:@_ZTV8test20_D = weak_odr constant [11 x i8*] [i8* inttoptr (i64 8 to i8*), i8* null, i8* null, i8* null, i8* bitcast (%1* @_ZTI8test20_D to i8*), i8* bitcast (void (%class.test14*)* @_ZN8test20_V4foo1Ev to i8*), i8* null, i8* null, i8* inttoptr (i64 -8 to i8*), i8* bitcast (%1* @_ZTI8test20_D to i8*), i8* bitcast (void (%class.test14*)* @_ZN9test20_V14foo2Ev to i8*)] + +// CHECK-LPLL64:@_ZTC8test20_D0_8test20_B = internal constant [5 x i8*] [i8* null, i8* null, i8* null, i8* bitcast (%3* @_ZTI8test20_B to i8*), i8* bitcast (void (%class.test14*)* @_ZN8test20_V4foo1Ev to i8*)] + +// CHECK-LPLL64:@_ZTC8test20_D8_9test20_B1 = internal constant [5 x i8*] [i8* null, i8* null, i8* null, i8* bitcast (%3* @_ZTI9test20_B1 to i8*), i8* bitcast (void (%class.test14*)* @_ZN9test20_V14foo2Ev to i8*)] ; <[5 x i8*]*> [#uses=1] +// FIXME: // CHECK-LP64: __ZTT8test20_D: -// CHECK-LP64-NEXT: .quad (__ZTV8test20_D) + 40 -// CHECK-LP64-NEXT: .quad (__ZTC8test20_D0_8test20_B) + 32 -// CHECK-LP64-NEXT: .quad (__ZTC8test20_D0_8test20_B) + 32 -// CHECK-LP64-NEXT: .quad (__ZTC8test20_D8_9test20_B1) + 32 -// CHECK-LP64-NEXT: .quad (__ZTC8test20_D8_9test20_B1) + 32 -// CHECK-LP64-NEXT .quad (__ZTV8test20_D) + 40 -// CHECK-LP64-NEXT .quad (__ZTV8test20_D) + 80 -// CHECK-LP64-NEXT .quad (__ZTV8test20_D) + 80 +// CHECK-LP64-NEXT: .quad __ZTV8test20_D+40 +// CHECK-LP64-NEXT: .quad __ZTC8test20_D0_8test20_B+32 +// CHECK-LP64-NEXT: .quad __ZTC8test20_D0_8test20_B+32 +// CHECK-LP64-NEXT: .quad __ZTC8test20_D8_9test20_B1+32 +// CHECK-LP64-NEXT: .quad __ZTC8test20_D8_9test20_B1+32 +// CHECK-LP64-NEXT .quad __ZTV8test20_D+40 +// CHECK-LP64-NEXT .quad __ZTV8test20_D+80 +// CHECK-LP64-NEXT .quad __ZTV8test20_D+80 class test21_V { @@ -1039,45 +569,73 @@ class test21_D : public test21_B, public test21_B1 { void foo() { } }; -// CHECK-LP64: __ZTV8test21_D: -// CHECK-LP64-NEXT: .quad 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad __ZTI8test21_D -// CHECK-LP64-NEXT: .quad __ZN8test21_D3fooEv -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad 18446744073709551608 -// CHECK-LP64-NEXT: .quad 18446744073709551608 -// CHECK-LP64-NEXT: .quad __ZTI8test21_D -// CHECK-LP64-NEXT: .quad __ZTv0_n24_N8test21_D3fooEv - -// CHECK-LP64: __ZTC8test21_D0_8test21_B: -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad __ZTI8test21_B -// CHECK-LP64-NEXT: .quad __ZN8test21_V3fooEv - -// CHECK-LP64: __ZTC8test21_D8_9test21_B1: -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .space 8 -// CHECK-LP64-NEXT: .quad __ZTI9test21_B1 -// CHECK-LP64-NEXT: .quad __ZN9test21_V13fooEv +// CHECK-LPLL64:@_ZTV8test21_D = weak_odr constant [11 x i8*] [i8* inttoptr (i64 8 to i8*), i8* null, i8* null, i8* null, i8* bitcast (%1* @_ZTI8test21_D to i8*), i8* bitcast (void (%class.test20_D*)* @_ZN8test21_D3fooEv to i8*), i8* null, i8* inttoptr (i64 -8 to i8*), i8* inttoptr (i64 -8 to i8*), i8* bitcast (%1* @_ZTI8test21_D to i8*), i8* bitcast (void (%class.test20_D*)* @_ZTv0_n24_N8test21_D3fooEv to i8*)] +// CHECK-LPLL64:@_ZTC8test21_D0_8test21_B = internal constant [5 x i8*] [i8* null, i8* null, i8* null, i8* bitcast (%3* @_ZTI8test21_B to i8*), i8* bitcast (void (%class.test14*)* @_ZN8test21_V3fooEv to i8*)] + +// CHECK-LPLL64:@_ZTC8test21_D8_9test21_B1 = internal constant [5 x i8*] [i8* null, i8* null, i8* null, i8* bitcast (%3* @_ZTI9test21_B1 to i8*), i8* bitcast (void (%class.test14*)* @_ZN9test21_V13fooEv to i8*)] ; <[5 x i8*]*> [#uses=1] + +// FIXME: // CHECK-LP64: __ZTT8test21_D: -// CHECK-LP64-NEXT: .quad (__ZTV8test21_D) + 40 -// CHECK-LP64-NEXT: .quad (__ZTC8test21_D0_8test21_B) + 32 -// CHECK-LP64-NEXT: .quad (__ZTC8test21_D0_8test21_B) + 32 -// CHECK-LP64-NEXT: .quad (__ZTC8test21_D8_9test21_B1) + 32 -// CHECK-LP64-NEXT: .quad (__ZTC8test21_D8_9test21_B1) + 32 -// CHECK-LP64-NEXT .quad (__ZTV8test21_D) + 40 -// CHECK-LP64-NEXT .quad (__ZTV8test21_D) + 80 -// CHECK-LP64-NEXT .quad (__ZTV8test21_D) + 80 +// CHECK-LP64-NEXT: .quad __ZTV8test21_D+40 +// CHECK-LP64-NEXT: .quad __ZTC8test21_D0_8test21_B+32 +// CHECK-LP64-NEXT: .quad __ZTC8test21_D0_8test21_B+32 +// CHECK-LP64-NEXT: .quad __ZTC8test21_D8_9test21_B1+32 +// CHECK-LP64-NEXT: .quad __ZTC8test21_D8_9test21_B1+32 +// CHECK-LP64-NEXT .quad __ZTV8test21_D+40 +// CHECK-LP64-NEXT .quad __ZTV8test21_D+80 +// CHECK-LP64-NEXT .quad __ZTV8test21_D+80 + + +struct test22_s1 { virtual void dtor() { } }; +struct test22_s2 { virtual void dtor() { } }; +struct test22_s3 : test22_s1, test22_s2 { virtual void dtor() { } }; +struct test22_D : test22_s3 { virtual void dtor() { } }; + +// CHECK-LPLL64:@_ZTV8test22_D = weak_odr constant [6 x i8*] [i8* null, i8* bitcast (%4* @_ZTI8test22_D to i8*), i8* bitcast (void (%class.test20_D*)* @_ZN8test22_D4dtorEv to i8*), i8* inttoptr (i64 -8 to i8*), i8* bitcast (%4* @_ZTI8test22_D to i8*), i8* bitcast (void (%class.test20_D*)* @_ZThn8_N8test22_D4dtorEv to i8*)] + + +class test23_s1 { + virtual void fun1(char *t) { } +}; +class test23_s2 { + virtual void fun2(char *t) { } +}; +class test23_s3 { + virtual void fun3(char *t) { } +}; +class test23_s4: virtual test23_s1, test23_s2, test23_s3 { + virtual void fun4(char *t) { } +}; +class test23_D: virtual test23_s4 { + virtual void fun5(char *t) { } +}; + +// FIXME: +// CHECK-LP64: __ZTV8test23_D: +// CHECK-LP64-NEXT: .quad 0 +// CHECK-LP64-NEXT: .quad 8 +// CHECK-LP64-NEXT: .quad 0 +// CHECK-LP64-NEXT: .quad 0 +// CHECK-LP64-NEXT: .quad __ZTI8test23_D +// CHECK-LP64-NEXT: .quad __ZN9test23_s14fun1EPc +// CHECK-LP64-NEXT: .quad __ZN8test23_D4fun5EPc +// CHECK-LP64-NEXT .quad 8 +// CHECK-LP64: .quad 0 +// CHECK-LP64-NEXT: .quad 0 +// CHECK-LP64: .quad -8 +// CHECK-LP64-NEXT: .quad -8 +// CHECK-LP64-NEXT: .quad __ZTI8test23_D +// CHECK-LP64-NEXT: .quad __ZN9test23_s24fun2EPc +// CHECK-LP64-NEXT: .quad __ZN9test23_s44fun4EPc +// CHECK-LP64-NEXT: .quad -16 +// CHECK-LP64-NEXT: .quad __ZTI8test23_D +// CHECK-LP64-NEXT: .quad __ZN9test23_s34fun3EPc +test23_D d23; +test22_D d22; test21_D d21; test20_D d20; test19_D d19; @@ -1097,3 +655,93 @@ test3_D d3; test6_D d6; test7_D d7; + + +int j; +void *vp; +void test2() { + F f; + static int sz = (char *)(&f.f) - (char *)(&f); + vp = &sz; + j = sz; + // FIXME: These should result in a frontend constant a la fold, no run time + // initializer + // CHECK-LPLL64: define void @_Z5test2v() + // CHECK-LPLL64: = getelementptr inbounds %class.F* %f, i32 0, i32 1 +} + +static_assert(sizeof(F) == sizeof(void*)*4, "invalid vbase size"); + + +void test12_foo() { + test12_pa->foo0(); + test12_pb->foo0(); + test12_pd->foo0(); + test12_pa->foo(); + test12_pb->foo(); + test12_pd->foo(); + test12_pa->test12_A::foo(); +} + + +// CHECK-LPLL64:define void @_Z10test12_foov() nounwind { +// CHECK-LPLL64: call void % +// CHECK-LPLL64: call void % +// CHECK-LPLL64: call void % +// CHECK-LPLL64: call void % +// CHECK-LPLL64: call void % +// CHECK-LPLL64: call void % +// CHECK-LPLL64: call void @_ZN8test12_A3fooEv(%class.test14* %{{.*}}) + + +// FIXME: This is the wrong thunk, but until these issues are fixed, better +// than nothing. +// CHECK-LPLL64:define weak %class.test8_D* @_ZTcvn16_n72_v16_n32_N8test16_D4foo1Ev(%class.test8_D*) +// CHECK-LPLL64: %{{retval|2}} = alloca %class.test8_D* +// CHECK-LPLL64: %.addr = alloca %class.test8_D* +// CHECK-LPLL64: store %class.test8_D* %0, %class.test8_D** %.addr +// CHECK-LPLL64: %{{this|3}} = load %class.test8_D** %.addr +// CHECK-LPLL64: %{{1|4}} = bitcast %class.test8_D* %{{this|3}} to i8* +// CHECK-LPLL64: %{{2|5}} = getelementptr inbounds i8* %{{1|4}}, i64 -16 +// CHECK-LPLL64: %{{3|6}} = bitcast i8* %{{2|5}} to %class.test8_D* +// CHECK-LPLL64: %{{4|7}} = bitcast %class.test8_D* %{{3|6}} to i8* +// CHECK-LPLL64: %{{5|8}} = bitcast %class.test8_D* %3 to i64** +// CHECK-LPLL64: %{{vtable|9}} = load i64** %{{5|8}} +// CHECK-LPLL64: %{{6|10}} = getelementptr inbounds i64* %{{vtable|9}}, i64 -9 +// CHECK-LPLL64: %{{7|11}} = load i64* %{{6|10}} +// CHECK-LPLL64: %{{8|12}} = getelementptr i8* %{{4|7}}, i64 %{{7|11}} +// CHECK-LPLL64: %{{9|13}} = bitcast i8* %{{8|12}} to %class.test8_D* +// CHECK-LPLL64: %{{call|14}} = call %class.test8_D* @_ZTch0_v16_n32_N8test16_D4foo1Ev(%class.test8_D* %{{9|13}}) +// CHECK-LPLL64: store %class.test8_D* %{{call|14}}, %class.test8_D** %{{retval|2}} +// CHECK-LPLL64: %{{10|15}} = load %class.test8_D** %{{retval|2}} +// CHECK-LPLL64: ret %class.test8_D* %{{10|15}} +// CHECK-LPLL64:} + +// CHECK-LPLL64:define weak %class.test8_D* @_ZTch0_v16_n32_N8test16_D4foo1Ev(%{{class.test8_D|.*}}*) +// CHECK-LPLL64: %{{retval|2}} = alloca %class.test8_D* +// CHECK-LPLL64: %.addr = alloca %class.test8_D* +// CHECK-LPLL64: store %class.test8_D* %0, %class.test8_D** %.addr +// CHECK-LPLL64: %{{this|3}} = load %class.test8_D** %.addr +// CHECK-LPLL64: %{{call|4}} = call %class.test8_D* @_ZN8test16_D4foo1Ev(%class.test8_D* %{{this|3}}) +// CHECK-LPLL64: %{{1|5}} = icmp ne %class.test8_D* %{{call|4}}, null +// CHECK-LPLL64: br i1 %{{1|5}}, label %{{2|6}}, label %{{12|17}} +// CHECK-LPLL64:; <label>:{{2|6}} +// CHECK-LPLL64: %{{3|7}} = bitcast %class.test8_D* %{{call|4}} to i8* +// CHECK-LPLL64: %{{4|8}} = getelementptr inbounds i8* %{{3|7}}, i64 16 +// CHECK-LPLL64: %{{5|9}} = bitcast i8* %4 to %class.test8_D* +// CHECK-LPLL64: %{{6|10}} = bitcast %class.test8_D* %{{5|9}} to i8* +// CHECK-LPLL64: %{{7|11}} = bitcast %class.test8_D* %{{5|9}} to i64** +// CHECK-LPLL64: %{{vtable|12}} = load i64** %{{7|11}} +// CHECK-LPLL64: %{{8|13}} = getelementptr inbounds i64* %vtable, i64 -4 +// CHECK-LPLL64: %{{9|14}} = load i64* %{{8|13}} +// CHECK-LPLL64: %{{10|15}} = getelementptr i8* %{{6|10}}, i64 %{{9|14}} +// CHECK-LPLL64: %{{11|16}} = bitcast i8* %{{10|15}} to %class.test8_D* +// CHECK-LPLL64: br label %{{13|18}} +// CHECK-LPLL64:; <label>:{{12|17}} +// CHECK-LPLL64: br label %{{13|18}} +// CHECK-LPLL64:; <label>:{{13|18}} +// CHECK-LPLL64: %{{14|19}} = phi %class.test8_D* [ %{{11|16}}, %{{2|6}} ], [ %{{call|4}}, %{{12|17}} ] +// CHECK-LPLL64: store %class.test8_D* %{{14|19}}, %class.test8_D** %{{retval|2}} +// CHECK-LPLL64: %{{15|20}} = load %class.test8_D** %{{retval|2}} +// CHECK-LPLL64: ret %class.test8_D* %{{15|20}} +// CHECK-LPLL64:} diff --git a/test/CodeGenCXX/vtt-layout.cpp b/test/CodeGenCXX/vtt-layout.cpp new file mode 100644 index 0000000..d7d4227 --- /dev/null +++ b/test/CodeGenCXX/vtt-layout.cpp @@ -0,0 +1,64 @@ +// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s + +// Test1::B should just have a single entry in its VTT, which points to the vtable. +namespace Test1 { +struct A { }; + +struct B : virtual A { + virtual void f(); +}; + +void B::f() { } +} + +// Check that we don't add a secondary virtual pointer for Test2::A, since Test2::A doesn't have any virtual member functions or bases. +namespace Test2 { + struct A { }; + + struct B : A { virtual void f(); }; + struct C : virtual B { }; + + C c; +} + +// This is the sample from the C++ Itanium ABI, p2.6.2. +namespace Test3 { + class A1 { int i; }; + class A2 { int i; virtual void f(); }; + class V1 : public A1, public A2 { int i; }; + class B1 { int i; }; + class B2 { int i; }; + class V2 : public B1, public B2, public virtual V1 { int i; }; + class V3 {virtual void g(); }; + class C1 : public virtual V1 { int i; }; + class C2 : public virtual V3, virtual V2 { int i; }; + class X1 { int i; }; + class C3 : public X1 { int i; }; + class D : public C1, public C2, public C3 { int i; }; + + D d; +} + +// This is the sample from the C++ Itanium ABI, p2.6.2, with the change suggested +// (making A2 a virtual base of V1) +namespace Test4 { + class A1 { int i; }; + class A2 { int i; virtual void f(); }; + class V1 : public A1, public virtual A2 { int i; }; + class B1 { int i; }; + class B2 { int i; }; + class V2 : public B1, public B2, public virtual V1 { int i; }; + class V3 {virtual void g(); }; + class C1 : public virtual V1 { int i; }; + class C2 : public virtual V3, virtual V2 { int i; }; + class X1 { int i; }; + class C3 : public X1 { int i; }; + class D : public C1, public C2, public C3 { int i; }; + + D d; +} + +// CHECK: @_ZTTN5Test11BE = constant [1 x i8*] [i8* bitcast (i8** getelementptr inbounds ([4 x i8*]* @_ZTVN5Test11BE, i64 0, i64 3) to i8*)] +// CHECK: @_ZTTN5Test41DE = weak_odr constant [19 x i8*] [i8* bitcast (i8** getelementptr inbounds ([25 x i8*]* @_ZTVN5Test41DE, i64 0, i64 6) to i8*), i8* bitcast (i8** getelementptr inbounds ([11 x i8*]* @_ZTCN5Test41DE0_NS_2C1E, i64 0, i64 4) to i8*), i8* bitcast (i8** getelementptr inbounds ([11 x i8*]* @_ZTCN5Test41DE0_NS_2C1E, i64 0, i64 7) to i8*), i8* bitcast (i8** getelementptr inbounds ([11 x i8*]* @_ZTCN5Test41DE0_NS_2C1E, i64 0, i64 10) to i8*), i8* bitcast (i8** getelementptr inbounds ([19 x i8*]* @_ZTCN5Test41DE16_NS_2C2E, i64 0, i64 7) to i8*), i8* bitcast (i8** getelementptr inbounds ([19 x i8*]* @_ZTCN5Test41DE16_NS_2C2E, i64 0, i64 7) to i8*), i8* bitcast (i8** getelementptr inbounds ([19 x i8*]* @_ZTCN5Test41DE16_NS_2C2E, i64 0, i64 12) to i8*), i8* bitcast (i8** getelementptr inbounds ([19 x i8*]* @_ZTCN5Test41DE16_NS_2C2E, i64 0, i64 15) to i8*), i8* bitcast (i8** getelementptr inbounds ([19 x i8*]* @_ZTCN5Test41DE16_NS_2C2E, i64 0, i64 18) to i8*), i8* bitcast (i8** getelementptr inbounds ([25 x i8*]* @_ZTVN5Test41DE, i64 0, i64 17) to i8*), i8* bitcast (i8** getelementptr inbounds ([25 x i8*]* @_ZTVN5Test41DE, i64 0, i64 20) to i8*), i8* bitcast (i8** getelementptr inbounds ([25 x i8*]* @_ZTVN5Test41DE, i64 0, i64 13) to i8*), i8* bitcast (i8** getelementptr inbounds ([25 x i8*]* @_ZTVN5Test41DE, i64 0, i64 13) to i8*), i8* bitcast (i8** getelementptr inbounds ([25 x i8*]* @_ZTVN5Test41DE, i64 1, i64 0) to i8*), i8* bitcast (i8** getelementptr inbounds ([7 x i8*]* @_ZTCN5Test41DE40_NS_2V1E, i64 0, i64 3) to i8*), i8* bitcast (i8** getelementptr inbounds ([7 x i8*]* @_ZTCN5Test41DE40_NS_2V1E, i64 0, i64 6) to i8*), i8* bitcast (i8** getelementptr inbounds ([11 x i8*]* @_ZTCN5Test41DE72_NS_2V2E, i64 0, i64 4) to i8*), i8* bitcast (i8** getelementptr inbounds ([11 x i8*]* @_ZTCN5Test41DE72_NS_2V2E, i64 0, i64 7) to i8*), i8* bitcast (i8** getelementptr inbounds ([11 x i8*]* @_ZTCN5Test41DE72_NS_2V2E, i64 0, i64 10) to i8*)] ; <[19 x i8*]*> [#uses=4] +// CHECK: @_ZTTN5Test31DE = weak_odr constant [13 x i8*] [i8* bitcast (i8** getelementptr inbounds ([19 x i8*]* @_ZTVN5Test31DE, i64 0, i64 5) to i8*), i8* bitcast (i8** getelementptr inbounds ([7 x i8*]* @_ZTCN5Test31DE0_NS_2C1E, i64 0, i64 3) to i8*), i8* bitcast (i8** getelementptr inbounds ([7 x i8*]* @_ZTCN5Test31DE0_NS_2C1E, i64 0, i64 6) to i8*), i8* bitcast (i8** getelementptr inbounds ([14 x i8*]* @_ZTCN5Test31DE16_NS_2C2E, i64 0, i64 6) to i8*), i8* bitcast (i8** getelementptr inbounds ([14 x i8*]* @_ZTCN5Test31DE16_NS_2C2E, i64 0, i64 6) to i8*), i8* bitcast (i8** getelementptr inbounds ([14 x i8*]* @_ZTCN5Test31DE16_NS_2C2E, i64 0, i64 10) to i8*), i8* bitcast (i8** getelementptr inbounds ([14 x i8*]* @_ZTCN5Test31DE16_NS_2C2E, i64 0, i64 13) to i8*), i8* bitcast (i8** getelementptr inbounds ([19 x i8*]* @_ZTVN5Test31DE, i64 0, i64 15) to i8*), i8* bitcast (i8** getelementptr inbounds ([19 x i8*]* @_ZTVN5Test31DE, i64 0, i64 11) to i8*), i8* bitcast (i8** getelementptr inbounds ([19 x i8*]* @_ZTVN5Test31DE, i64 0, i64 11) to i8*), i8* bitcast (i8** getelementptr inbounds ([19 x i8*]* @_ZTVN5Test31DE, i64 1, i64 0) to i8*), i8* bitcast (i8** getelementptr inbounds ([7 x i8*]* @_ZTCN5Test31DE64_NS_2V2E, i64 0, i64 3) to i8*), i8* bitcast (i8** getelementptr inbounds ([7 x i8*]* @_ZTCN5Test31DE64_NS_2V2E, i64 0, i64 6) to i8*)] ; <[13 x i8*]*> [#uses=3] +// CHECK: @_ZTTN5Test21CE = weak_odr constant [2 x i8*] [i8* bitcast (i8** getelementptr inbounds ([5 x i8*]* @_ZTVN5Test21CE, i64 0, i64 4) to i8*), i8* bitcast (i8** getelementptr inbounds ([5 x i8*]* @_ZTVN5Test21CE, i64 0, i64 4) to i8*)] ; <[2 x i8*]*> [#uses=0] diff --git a/test/Driver/darwin-arm.c b/test/Driver/darwin-arm.c deleted file mode 100644 index 330918d..0000000 --- a/test/Driver/darwin-arm.c +++ /dev/null @@ -1,4 +0,0 @@ -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -arch arm -print-search-dirs | FileCheck %s - -// Check that we look in the relative libexec directory. -// CHECK: {{programs: =.*/../libexec:}} diff --git a/test/FixIt/typo.m b/test/FixIt/typo.m index 4c3ee5f..c2069dd 100644 --- a/test/FixIt/typo.m +++ b/test/FixIt/typo.m @@ -12,6 +12,7 @@ void test() { } @protocol P1 +@optional @property int *sprop; // expected-note{{'sprop' declared here}} @end diff --git a/test/Index/Inputs/remap-load-to.c b/test/Index/Inputs/remap-load-to.c new file mode 100644 index 0000000..8f9e1eb --- /dev/null +++ b/test/Index/Inputs/remap-load-to.c @@ -0,0 +1,3 @@ +int foo(int parm1, float parm2) { + return parm1 + parm2; +} diff --git a/test/Index/TestClassDecl.m b/test/Index/TestClassDecl.m index fb97de1..f962712 100644 --- a/test/Index/TestClassDecl.m +++ b/test/Index/TestClassDecl.m @@ -16,23 +16,18 @@ void function(Foo * arg) } // CHECK-scan: {start_line=1 start_col=1 end_line=7 end_col=1} Invalid Cursor => NoDeclFound -// CHECK-scan: {start_line=8 start_col=1 end_line=8 end_col=7} Invalid Cursor => NotImplemented -// CHECK-scan: {start_line=8 start_col=8 end_line=8 end_col=10} ObjCClassRef=Foo:8:1 +// CHECK-scan: {start_line=8 start_col=1 end_line=8 end_col=7} UnexposedDecl=:8:1 +// CHECK-scan: {start_line=8 start_col=8 end_line=8 end_col=10} ObjCClassRef=Foo:10:12 // CHECK-scan: {start_line=8 start_col=11 end_line=9 end_col=1} Invalid Cursor => NoDeclFound -// CHECK-scan: {start_line=10 start_col=1 end_line=11 end_col=4} ObjCInterfaceDecl=Foo:10:1 -// CHECK-scan: {start_line=11 start_col=5 end_line=12 end_col=1} Invalid Cursor => NoDeclFound -// CHECK-scan: {start_line=13 start_col=1 end_line=13 end_col=4} FunctionDecl=function:13:6 -// CHECK-scan: {start_line=13 start_col=5 end_line=13 end_col=5} Invalid Cursor => NoDeclFound -// CHECK-scan: {start_line=13 start_col=6 end_line=13 end_col=14} FunctionDecl=function:13:6 -// CHECK-scan: {start_line=13 start_col=15 end_line=13 end_col=17} ObjCClassRef=Foo:13:21 -// CHECK-scan: {start_line=13 start_col=18 end_line=13 end_col=18} FunctionDecl=function:13:6 -// CHECK-scan: {start_line=13 start_col=19 end_line=13 end_col=19} ParmDecl=arg:13:21 -// CHECK-scan: {start_line=13 start_col=20 end_line=13 end_col=20} FunctionDecl=function:13:6 -// CHECK-scan: {start_line=13 start_col=21 end_line=13 end_col=23} ParmDecl=arg:13:21 -// CHECK-scan: {start_line=13 start_col=24 end_line=16 end_col=1} FunctionDecl=function:13:6 -// CHECK-scan: {start_line=16 start_col=2 end_line=38 end_col=1} Invalid Cursor => NoDeclFound +// CHECK-scan: {start_line=10 start_col=1 end_line=11 end_col=4} ObjCInterfaceDecl=Foo:10:12 +// CHECK-scan: {start_line=11 start_col=5 end_line=13 end_col=5} Invalid Cursor => NoDeclFound +// CHECK-scan: {start_line=13 start_col=6 end_line=13 end_col=14} FunctionDecl=function:13:6 (Definition) +// CHECK-scan: {start_line=13 start_col=15 end_line=13 end_col=17} ObjCClassRef=Foo:10:12 +// CHECK-scan: {start_line=13 start_col=18 end_line=13 end_col=23} ParmDecl=arg:13:21 (Definition) +// CHECK-scan: {start_line=13 start_col=24 end_line=13 end_col=25} FunctionDecl=function:13:6 (Definition) +// CHECK-scan: {start_line=14 start_col=1 end_line=16 end_col=1} UnexposedStmt=function -// CHECK-load: TestClassDecl.m:10:12: ObjCInterfaceDecl=Foo:10:1 [Context=TestClassDecl.m] [Extent=10:1:11:4] -// CHECK-load: TestClassDecl.m:13:6: FunctionDefn=function [Context=TestClassDecl.m] [Extent=13:6:16:1] -// CHECK-load: TestClassDecl.m:13:21: ParmDecl=arg:13:21 [Context=function] [Extent=13:21:13:23] +// CHECK-load: TestClassDecl.m:10:12: ObjCInterfaceDecl=Foo:10:12 [Extent=10:1:11:4] +// CHECK-load: TestClassDecl.m:13:6: FunctionDecl=function:13:6 (Definition) [Extent=13:6:16:1] +// CHECK-load: TestClassDecl.m:13:21: ParmDecl=arg:13:21 (Definition) [Extent=13:15:13:23] diff --git a/test/Index/TestClassForwardDecl.m b/test/Index/TestClassForwardDecl.m index e795972..c53453b 100644 --- a/test/Index/TestClassForwardDecl.m +++ b/test/Index/TestClassForwardDecl.m @@ -13,19 +13,14 @@ void function(Foo * arg) } // CHECK-scan: {start_line=1 start_col=1 end_line=7 end_col=1} Invalid Cursor => NoDeclFound -// CHECK-scan: {start_line=8 start_col=1 end_line=8 end_col=7} Invalid Cursor => NotImplemented -// CHECK-scan: {start_line=8 start_col=8 end_line=8 end_col=10} ObjCClassRef=Foo:8:1 -// CHECK-scan: {start_line=8 start_col=11 end_line=9 end_col=1} Invalid Cursor => NoDeclFound -// CHECK-scan: {start_line=10 start_col=1 end_line=10 end_col=4} FunctionDecl=function:10:6 -// CHECK-scan: {start_line=10 start_col=5 end_line=10 end_col=5} Invalid Cursor => NoDeclFound -// CHECK-scan: {start_line=10 start_col=6 end_line=10 end_col=14} FunctionDecl=function:10:6 -// CHECK-scan: {start_line=10 start_col=15 end_line=10 end_col=17} ObjCClassRef=Foo:10:21 -// CHECK-scan: {start_line=10 start_col=18 end_line=10 end_col=18} FunctionDecl=function:10:6 -// CHECK-scan: {start_line=10 start_col=19 end_line=10 end_col=19} ParmDecl=arg:10:21 -// CHECK-scan: {start_line=10 start_col=20 end_line=10 end_col=20} FunctionDecl=function:10:6 -// CHECK-scan: {start_line=10 start_col=21 end_line=10 end_col=23} ParmDecl=arg:10:21 -// CHECK-scan: {start_line=10 start_col=24 end_line=13 end_col=1} FunctionDecl=function:10:6 -// CHECK-scan: {start_line=13 start_col=2 end_line=46 end_col=1} Invalid Cursor => NoDeclFound +// CHECK-scan: {start_line=8 start_col=1 end_line=8 end_col=7} UnexposedDecl=:8:1 +// CHECK-scan: {start_line=8 start_col=8 end_line=8 end_col=10} ObjCClassRef=Foo:8:8 +// CHECK-scan: {start_line=8 start_col=11 end_line=10 end_col=5} Invalid Cursor => NoDeclFound +// CHECK-scan: {start_line=10 start_col=6 end_line=10 end_col=14} FunctionDecl=function:10:6 (Definition) +// CHECK-scan: {start_line=10 start_col=15 end_line=10 end_col=17} ObjCClassRef=Foo:8:8 +// CHECK-scan: {start_line=10 start_col=18 end_line=10 end_col=23} ParmDecl=arg:10:21 (Definition) +// CHECK-scan: {start_line=10 start_col=24 end_line=10 end_col=25} FunctionDecl=function:10:6 (Definition) +// CHECK-scan: {start_line=11 start_col=1 end_line=13 end_col=1} UnexposedStmt=function @@ -41,6 +36,6 @@ void function(Foo * arg) -// CHECK-load: TestClassForwardDecl.m:10:6: FunctionDefn=function [Context=TestClassForwardDecl.m] -// CHECK-load: TestClassForwardDecl.m:10:21: ParmDecl=arg:10:21 [Context=function] +// CHECK-load: TestClassForwardDecl.m:10:6: FunctionDecl=function:10:6 (Definition) +// CHECK-load: TestClassForwardDecl.m:10:21: ParmDecl=arg:10:21 diff --git a/test/Index/c-index-api-fn-scan.m b/test/Index/c-index-api-fn-scan.m deleted file mode 100644 index 8cbc036..0000000 --- a/test/Index/c-index-api-fn-scan.m +++ /dev/null @@ -1,217 +0,0 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fblocks -emit-pch -x objective-c %s -o %t.ast -// RUN: c-index-test -test-load-tu %t.ast scan-function | FileCheck %s - - - - - - - - - - - - - - - - - -@interface Foo -{ -} - -- foo; -+ fooC; - -@end - -@interface Bar : Foo -{ -} - -@end - -@interface Foo (FooCat) -- (int) catMethodWithFloat:(float) fArg; -- (float) floatMethod; -@end - -@protocol Proto -- pMethod; -@end - -@protocol SubP <Proto> -- spMethod; -@end - -@interface Baz : Bar <SubP> -{ - int _anIVar; -} - -- (Foo *) bazMethod; - -@end - -enum { - someEnum -}; - - - - - - - - - - - - - - - - - - - - - - - -int main (int argc, const char * argv[]) { - Baz * bee; - id a = [bee foo]; - id <SubP> c = [Foo fooC]; - id <Proto> d; - d = c; - [d pMethod]; - [bee catMethodWithFloat:[bee floatMethod]]; - main(someEnum, (const char **)bee); -} - -// CHECK: c-index-api-fn-scan.m:84:2: ObjCClassRef=Baz:84:8 [Context:Baz] -// CHECK: c-index-api-fn-scan.m:84:3: ObjCClassRef=Baz:84:8 [Context:Baz] -// CHECK: c-index-api-fn-scan.m:84:4: ObjCClassRef=Baz:84:8 [Context:Baz] -// CHECK: c-index-api-fn-scan.m:84:6: VarDecl=bee:84:8 [Context:bee] -// CHECK: c-index-api-fn-scan.m:84:8: VarDecl=bee:84:8 [Context:bee] -// CHECK: c-index-api-fn-scan.m:84:9: VarDecl=bee:84:8 [Context:bee] -// CHECK: c-index-api-fn-scan.m:84:10: VarDecl=bee:84:8 [Context:bee] -// CHECK: <invalid loc>:85:2: TypedefDecl=id:0:0 [Context:id] -// CHECK: <invalid loc>:85:3: TypedefDecl=id:0:0 [Context:id] -// CHECK: c-index-api-fn-scan.m:85:5: VarDecl=a:85:5 [Context:a] -// CHECK: c-index-api-fn-scan.m:85:6: VarDecl=a:85:5 [Context:a] -// CHECK: c-index-api-fn-scan.m:85:7: VarDecl=a:85:5 [Context:a] -// CHECK: c-index-api-fn-scan.m:85:8: VarDecl=a:85:5 [Context:a] -// CHECK: c-index-api-fn-scan.m:85:9: ObjCSelectorRef=foo:24:1 [Context:a] -// CHECK: c-index-api-fn-scan.m:85:10: VarRef=bee:84:8 [Context:a] -// CHECK: c-index-api-fn-scan.m:85:11: VarRef=bee:84:8 [Context:a] -// CHECK: c-index-api-fn-scan.m:85:12: VarRef=bee:84:8 [Context:a] -// CHECK: c-index-api-fn-scan.m:85:13: ObjCSelectorRef=foo:24:1 [Context:a] -// CHECK: c-index-api-fn-scan.m:85:14: ObjCSelectorRef=foo:24:1 [Context:a] -// CHECK: c-index-api-fn-scan.m:85:15: ObjCSelectorRef=foo:24:1 [Context:a] -// CHECK: c-index-api-fn-scan.m:85:16: ObjCSelectorRef=foo:24:1 [Context:a] -// CHECK: c-index-api-fn-scan.m:85:17: ObjCSelectorRef=foo:24:1 [Context:a] -// CHECK: <invalid loc>:86:2: TypedefDecl=id:0:0 [Context:id] -// CHECK: <invalid loc>:86:3: TypedefDecl=id:0:0 [Context:id] -// CHECK: c-index-api-fn-scan.m:86:5: VarDecl=c:86:12 [Context:c] -// CHECK: c-index-api-fn-scan.m:86:6: ObjCProtocolRef=SubP:86:12 [Context:SubP] -// CHECK: c-index-api-fn-scan.m:86:7: ObjCProtocolRef=SubP:86:12 [Context:SubP] -// CHECK: c-index-api-fn-scan.m:86:8: ObjCProtocolRef=SubP:86:12 [Context:SubP] -// CHECK: c-index-api-fn-scan.m:86:9: ObjCProtocolRef=SubP:86:12 [Context:SubP] -// CHECK: c-index-api-fn-scan.m:86:10: VarDecl=c:86:12 [Context:c] -// CHECK: c-index-api-fn-scan.m:86:12: VarDecl=c:86:12 [Context:c] -// CHECK: c-index-api-fn-scan.m:86:13: VarDecl=c:86:12 [Context:c] -// CHECK: c-index-api-fn-scan.m:86:14: VarDecl=c:86:12 [Context:c] -// CHECK: c-index-api-fn-scan.m:86:15: VarDecl=c:86:12 [Context:c] -// CHECK: c-index-api-fn-scan.m:86:16: ObjCSelectorRef=fooC:25:1 [Context:c] -// CHECK: c-index-api-fn-scan.m:86:17: ObjCSelectorRef=fooC:25:1 [Context:c] -// CHECK: c-index-api-fn-scan.m:86:18: ObjCSelectorRef=fooC:25:1 [Context:c] -// CHECK: c-index-api-fn-scan.m:86:19: ObjCSelectorRef=fooC:25:1 [Context:c] -// CHECK: c-index-api-fn-scan.m:86:20: ObjCSelectorRef=fooC:25:1 [Context:c] -// CHECK: c-index-api-fn-scan.m:86:21: ObjCSelectorRef=fooC:25:1 [Context:c] -// CHECK: c-index-api-fn-scan.m:86:22: ObjCSelectorRef=fooC:25:1 [Context:c] -// CHECK: c-index-api-fn-scan.m:86:23: ObjCSelectorRef=fooC:25:1 [Context:c] -// CHECK: c-index-api-fn-scan.m:86:24: ObjCSelectorRef=fooC:25:1 [Context:c] -// CHECK: c-index-api-fn-scan.m:86:25: ObjCSelectorRef=fooC:25:1 [Context:c] -// CHECK: <invalid loc>:87:2: TypedefDecl=id:0:0 [Context:id] -// CHECK: <invalid loc>:87:3: TypedefDecl=id:0:0 [Context:id] -// CHECK: c-index-api-fn-scan.m:87:5: VarDecl=d:87:13 [Context:d] -// CHECK: c-index-api-fn-scan.m:87:6: ObjCProtocolRef=Proto:87:13 [Context:Proto] -// CHECK: c-index-api-fn-scan.m:87:7: ObjCProtocolRef=Proto:87:13 [Context:Proto] -// CHECK: c-index-api-fn-scan.m:87:8: ObjCProtocolRef=Proto:87:13 [Context:Proto] -// CHECK: c-index-api-fn-scan.m:87:9: ObjCProtocolRef=Proto:87:13 [Context:Proto] -// CHECK: c-index-api-fn-scan.m:87:10: ObjCProtocolRef=Proto:87:13 [Context:Proto] -// CHECK: c-index-api-fn-scan.m:87:11: VarDecl=d:87:13 [Context:d] -// CHECK: c-index-api-fn-scan.m:87:13: VarDecl=d:87:13 [Context:d] -// CHECK: c-index-api-fn-scan.m:88:2: VarRef=d:87:13 [Context:main] -// CHECK: c-index-api-fn-scan.m:88:6: VarRef=c:86:12 [Context:main] -// CHECK: c-index-api-fn-scan.m:89:2: ObjCSelectorRef=pMethod:41:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:89:3: VarRef=d:87:13 [Context:main] -// CHECK: c-index-api-fn-scan.m:89:4: ObjCSelectorRef=pMethod:41:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:89:5: ObjCSelectorRef=pMethod:41:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:89:6: ObjCSelectorRef=pMethod:41:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:89:7: ObjCSelectorRef=pMethod:41:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:89:8: ObjCSelectorRef=pMethod:41:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:89:9: ObjCSelectorRef=pMethod:41:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:89:10: ObjCSelectorRef=pMethod:41:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:89:11: ObjCSelectorRef=pMethod:41:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:89:12: ObjCSelectorRef=pMethod:41:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:2: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:3: VarRef=bee:84:8 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:4: VarRef=bee:84:8 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:5: VarRef=bee:84:8 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:6: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:7: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:8: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:9: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:10: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:11: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:12: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:13: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:14: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:15: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:16: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:17: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:18: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:19: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:20: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:21: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:22: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:23: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:24: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:25: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:26: ObjCSelectorRef=floatMethod:37:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:27: VarRef=bee:84:8 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:28: VarRef=bee:84:8 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:29: VarRef=bee:84:8 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:30: ObjCSelectorRef=floatMethod:37:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:31: ObjCSelectorRef=floatMethod:37:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:32: ObjCSelectorRef=floatMethod:37:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:33: ObjCSelectorRef=floatMethod:37:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:34: ObjCSelectorRef=floatMethod:37:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:35: ObjCSelectorRef=floatMethod:37:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:36: ObjCSelectorRef=floatMethod:37:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:37: ObjCSelectorRef=floatMethod:37:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:38: ObjCSelectorRef=floatMethod:37:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:39: ObjCSelectorRef=floatMethod:37:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:40: ObjCSelectorRef=floatMethod:37:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:41: ObjCSelectorRef=floatMethod:37:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:42: ObjCSelectorRef=floatMethod:37:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:90:43: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] -// CHECK: c-index-api-fn-scan.m:91:3: FunctionRef=main:83:5 [Context:main] -// CHECK: c-index-api-fn-scan.m:91:4: FunctionRef=main:83:5 [Context:main] -// CHECK: c-index-api-fn-scan.m:91:5: FunctionRef=main:83:5 [Context:main] -// CHECK: c-index-api-fn-scan.m:91:6: FunctionRef=main:83:5 [Context:main] -// CHECK: c-index-api-fn-scan.m:91:8: EnumConstantRef=someEnum:58:3 [Context:main] -// CHECK: c-index-api-fn-scan.m:91:9: EnumConstantRef=someEnum:58:3 [Context:main] -// CHECK: c-index-api-fn-scan.m:91:10: EnumConstantRef=someEnum:58:3 [Context:main] -// CHECK: c-index-api-fn-scan.m:91:11: EnumConstantRef=someEnum:58:3 [Context:main] -// CHECK: c-index-api-fn-scan.m:91:12: EnumConstantRef=someEnum:58:3 [Context:main] -// CHECK: c-index-api-fn-scan.m:91:13: EnumConstantRef=someEnum:58:3 [Context:main] -// CHECK: c-index-api-fn-scan.m:91:14: EnumConstantRef=someEnum:58:3 [Context:main] -// CHECK: c-index-api-fn-scan.m:91:15: EnumConstantRef=someEnum:58:3 [Context:main] -// CHECK: c-index-api-fn-scan.m:91:33: VarRef=bee:84:8 [Context:main] -// CHECK: c-index-api-fn-scan.m:91:34: VarRef=bee:84:8 [Context:main] -// CHECK: c-index-api-fn-scan.m:91:35: VarRef=bee:84:8 [Context:main] diff --git a/test/Index/c-index-api-loadTU-test.m b/test/Index/c-index-api-loadTU-test.m index 8a1e4d1..cf0dbff 100644 --- a/test/Index/c-index-api-loadTU-test.m +++ b/test/Index/c-index-api-loadTU-test.m @@ -53,33 +53,79 @@ int main (int argc, const char * argv[]) { main(someEnum, (const char **)bee); } -// CHECK: c-index-api-loadTU-test.m:4:12: ObjCInterfaceDecl=Foo:4:1 [Context=c-index-api-loadTU-test.m] [Extent=4:1:11:4] -// CHECK: c-index-api-loadTU-test.m:8:1: ObjCInstanceMethodDecl=foo:8:1 [Context=Foo] [Extent=8:1:8:6] -// CHECK: c-index-api-loadTU-test.m:9:1: ObjCClassMethodDecl=fooC:9:1 [Context=Foo] [Extent=9:1:9:7] -// CHECK: c-index-api-loadTU-test.m:13:12: ObjCInterfaceDecl=Bar:13:1 [Context=c-index-api-loadTU-test.m] [Extent=13:1:17:4] -// CHECK: c-index-api-loadTU-test.m:13:18: ObjCSuperClassRef=Foo:13:1 [Context=Bar] [Extent=13:1:17:4] -// CHECK: c-index-api-loadTU-test.m:19:1: ObjCCategoryDecl=FooCat:19:1 [Context=c-index-api-loadTU-test.m] [Extent=19:1:22:4] -// CHECK: c-index-api-loadTU-test.m:4:1: ObjCClassRef=Foo:19:1 [Context=FooCat] [Extent=19:1:22:4] -// CHECK: c-index-api-loadTU-test.m:20:1: ObjCInstanceMethodDecl=catMethodWithFloat::20:1 [Context=FooCat] [Extent=20:1:20:40] -// CHECK: c-index-api-loadTU-test.m:21:1: ObjCInstanceMethodDecl=floatMethod:21:1 [Context=FooCat] [Extent=21:1:21:22] -// CHECK: c-index-api-loadTU-test.m:24:1: ObjCProtocolDecl=Proto:24:1 [Context=c-index-api-loadTU-test.m] [Extent=24:1:26:4] -// CHECK: c-index-api-loadTU-test.m:25:1: ObjCInstanceMethodDecl=pMethod:25:1 [Context=Proto] [Extent=25:1:25:10] -// CHECK: c-index-api-loadTU-test.m:28:1: ObjCProtocolDecl=SubP:28:1 [Context=c-index-api-loadTU-test.m] [Extent=28:1:30:4] -// CHECK: c-index-api-loadTU-test.m:24:1: ObjCProtocolRef=Proto:24:1 [Context=SubP] [Extent=24:1:26:4] -// CHECK: c-index-api-loadTU-test.m:29:1: ObjCInstanceMethodDecl=spMethod:29:1 [Context=SubP] [Extent=29:1:29:11] -// CHECK: c-index-api-loadTU-test.m:32:12: ObjCInterfaceDecl=Baz:32:1 [Context=c-index-api-loadTU-test.m] [Extent=32:1:39:4] -// CHECK: c-index-api-loadTU-test.m:32:18: ObjCSuperClassRef=Bar:32:1 [Context=Baz] [Extent=32:1:39:4] -// CHECK: c-index-api-loadTU-test.m:28:1: ObjCProtocolRef=SubP:28:1 [Context=Baz] [Extent=28:1:30:4] -// CHECK: c-index-api-loadTU-test.m:34:9: ObjCIvarDecl=_anIVar:34:9 [Context=Baz] [Extent=34:9:34:15] -// CHECK: c-index-api-loadTU-test.m:37:1: ObjCInstanceMethodDecl=bazMethod:37:1 [Context=Baz] [Extent=37:1:37:20] -// CHECK: c-index-api-loadTU-test.m:41:1: EnumDecl=:41:1 [Context=c-index-api-loadTU-test.m] [Extent=41:1:43:1] -// CHECK: c-index-api-loadTU-test.m:42:3: EnumConstantDecl=someEnum:42:3 [Context=] [Extent=42:3:42:10] -// CHECK: c-index-api-loadTU-test.m:45:5: FunctionDefn=main [Context=c-index-api-loadTU-test.m] [Extent=45:5:54:1] -// CHECK: c-index-api-loadTU-test.m:45:15: ParmDecl=argc:45:15 [Context=main] [Extent=45:15:45:18] -// CHECK: c-index-api-loadTU-test.m:45:34: ParmDecl=argv:45:34 [Context=main] [Extent=45:34:45:37] -// CHECK: c-index-api-loadTU-test.m:46:8: VarDecl=bee:46:8 [Context=main] [Extent=46:8:46:10] -// CHECK: c-index-api-loadTU-test.m:47:5: VarDecl=a:47:5 [Context=main] [Extent=47:5:47:17] -// CHECK: c-index-api-loadTU-test.m:48:12: VarDecl=c:48:12 [Context=main] [Extent=48:12:48:25] -// CHECK: c-index-api-loadTU-test.m:49:13: VarDecl=d:49:13 [Context=main] [Extent=49:13:49:13] - - +// CHECK: <invalid loc>:0:0: TypedefDecl=__int128_t:0:0 (Definition) +// CHECK: <invalid loc>:0:0: TypedefDecl=__uint128_t:0:0 (Definition) +// CHECK: <invalid loc>:0:0: TypedefDecl=SEL:0:0 (Definition) +// CHECK: <invalid loc>:0:0: TypeRef=SEL:0:0 +// CHECK: <invalid loc>:0:0: TypedefDecl=id:0:0 (Definition) +// CHECK: <invalid loc>:0:0: TypedefDecl=Class:0:0 (Definition) +// CHECK: <invalid loc>:87:16: StructDecl=__va_list_tag:87:16 (Definition) +// CHECK: <invalid loc>:87:42: FieldDecl=gp_offset:87:42 (Definition) +// CHECK: <invalid loc>:87:63: FieldDecl=fp_offset:87:63 (Definition) +// CHECK: <invalid loc>:87:81: FieldDecl=overflow_arg_area:87:81 (Definition) +// CHECK: <invalid loc>:87:107: FieldDecl=reg_save_area:87:107 (Definition) +// CHECK: <invalid loc>:87:123: TypedefDecl=__va_list_tag:87:123 (Definition) +// CHECK: <invalid loc>:87:9: TypeRef=struct __va_list_tag:87:16 +// CHECK: <invalid loc>:87:159: TypedefDecl=__builtin_va_list:87:159 (Definition) +// CHECK: <invalid loc>:87:145: TypeRef=__va_list_tag:87:123 +// CHECK: <invalid loc>:87:177: UnexposedExpr= +// CHECK: c-index-api-loadTU-test.m:4:12: ObjCInterfaceDecl=Foo:4:12 [Extent=4:1:11:4] +// CHECK: c-index-api-loadTU-test.m:8:1: ObjCInstanceMethodDecl=foo:8:1 [Extent=8:1:8:6] +// CHECK: c-index-api-loadTU-test.m:9:1: ObjCClassMethodDecl=fooC:9:1 [Extent=9:1:9:7] +// CHECK: c-index-api-loadTU-test.m:13:12: ObjCInterfaceDecl=Bar:13:12 [Extent=13:1:17:4] +// CHECK: c-index-api-loadTU-test.m:13:18: ObjCSuperClassRef=Foo:4:12 [Extent=13:18:13:20] +// CHECK: c-index-api-loadTU-test.m:19:12: ObjCCategoryDecl=FooCat:19:12 [Extent=19:1:22:4] +// CHECK: c-index-api-loadTU-test.m:19:12: ObjCClassRef=Foo:4:12 [Extent=19:12:19:14] +// CHECK: c-index-api-loadTU-test.m:20:1: ObjCInstanceMethodDecl=catMethodWithFloat::20:1 [Extent=20:1:20:40] +// CHECK: c-index-api-loadTU-test.m:20:36: ParmDecl=fArg:20:36 (Definition) [Extent=20:29:20:39] +// CHECK: c-index-api-loadTU-test.m:21:1: ObjCInstanceMethodDecl=floatMethod:21:1 [Extent=21:1:21:22] +// CHECK: c-index-api-loadTU-test.m:24:1: ObjCProtocolDecl=Proto:24:1 (Definition) [Extent=24:1:26:4] +// CHECK: c-index-api-loadTU-test.m:25:1: ObjCInstanceMethodDecl=pMethod:25:1 [Extent=25:1:25:10] +// CHECK: c-index-api-loadTU-test.m:28:1: ObjCProtocolDecl=SubP:28:1 (Definition) [Extent=28:1:30:4] +// CHECK: c-index-api-loadTU-test.m:28:17: ObjCProtocolRef=Proto:24:1 [Extent=28:17:28:21] +// CHECK: c-index-api-loadTU-test.m:29:1: ObjCInstanceMethodDecl=spMethod:29:1 [Extent=29:1:29:11] +// CHECK: c-index-api-loadTU-test.m:32:12: ObjCInterfaceDecl=Baz:32:12 [Extent=32:1:39:4] +// CHECK: c-index-api-loadTU-test.m:32:18: ObjCSuperClassRef=Bar:13:12 [Extent=32:18:32:20] +// CHECK: c-index-api-loadTU-test.m:32:23: ObjCProtocolRef=SubP:28:1 [Extent=32:23:32:26] +// CHECK: c-index-api-loadTU-test.m:34:9: ObjCIvarDecl=_anIVar:34:9 (Definition) [Extent=34:9:34:15] +// CHECK: c-index-api-loadTU-test.m:37:1: ObjCInstanceMethodDecl=bazMethod:37:1 [Extent=37:1:37:20] +// CHECK: c-index-api-loadTU-test.m:41:1: EnumDecl=:41:1 (Definition) [Extent=41:1:43:1] +// CHECK: c-index-api-loadTU-test.m:42:3: EnumConstantDecl=someEnum:42:3 (Definition) [Extent=42:3:42:10] +// CHECK: c-index-api-loadTU-test.m:45:5: FunctionDecl=main:45:5 (Definition) [Extent=45:5:54:1] +// CHECK: c-index-api-loadTU-test.m:45:15: ParmDecl=argc:45:15 (Definition) [Extent=45:11:45:18] +// CHECK: c-index-api-loadTU-test.m:45:34: ParmDecl=argv:45:34 (Definition) [Extent=45:27:45:37] +// CHECK: c-index-api-loadTU-test.m:45:5: UnexposedStmt=main [Extent=45:42:54:1] +// CHECK: c-index-api-loadTU-test.m:45:5: UnexposedStmt=main [Extent=46:2:46:11] +// CHECK: c-index-api-loadTU-test.m:46:8: VarDecl=bee:46:8 (Definition) [Extent=46:2:46:10] +// CHECK: c-index-api-loadTU-test.m:46:2: ObjCClassRef=Baz:32:12 [Extent=46:2:46:4] +// CHECK: c-index-api-loadTU-test.m:46:8: UnexposedStmt=bee [Extent=47:2:47:18] +// CHECK: c-index-api-loadTU-test.m:47:5: VarDecl=a:47:5 (Definition) [Extent=47:2:47:17] +// CHECK: c-index-api-loadTU-test.m:47:2: TypeRef=id:0:0 [Extent=47:2:47:3] +// CHECK: c-index-api-loadTU-test.m:47:9: ObjCMessageExpr=foo:8:1 [Extent=47:9:47:17] +// CHECK: c-index-api-loadTU-test.m:47:10: DeclRefExpr=bee:46:8 [Extent=47:10:47:12] +// CHECK: c-index-api-loadTU-test.m:47:5: UnexposedStmt=a [Extent=48:2:48:26] +// CHECK: c-index-api-loadTU-test.m:48:12: VarDecl=c:48:12 (Definition) [Extent=48:2:48:25] +// CHECK: c-index-api-loadTU-test.m:48:2: TypeRef=id:0:0 [Extent=48:2:48:3] +// CHECK: c-index-api-loadTU-test.m:48:6: ObjCProtocolRef=SubP:28:1 [Extent=48:6:48:9] +// CHECK: c-index-api-loadTU-test.m:48:16: UnexposedExpr=fooC:9:1 [Extent=48:16:48:25] +// CHECK: c-index-api-loadTU-test.m:48:16: ObjCMessageExpr=fooC:9:1 [Extent=48:16:48:25] +// CHECK: c-index-api-loadTU-test.m:48:12: UnexposedStmt=c [Extent=49:2:49:14] +// CHECK: c-index-api-loadTU-test.m:49:13: VarDecl=d:49:13 (Definition) [Extent=49:2:49:13] +// CHECK: c-index-api-loadTU-test.m:49:2: TypeRef=id:0:0 [Extent=49:2:49:3] +// CHECK: c-index-api-loadTU-test.m:49:6: ObjCProtocolRef=Proto:24:1 [Extent=49:6:49:10] +// CHECK: c-index-api-loadTU-test.m:50:2: UnexposedExpr= [Extent=50:2:50:6] +// CHECK: c-index-api-loadTU-test.m:50:2: DeclRefExpr=d:49:13 [Extent=50:2:50:2] +// CHECK: c-index-api-loadTU-test.m:50:6: UnexposedExpr=c:48:12 [Extent=50:6:50:6] +// CHECK: c-index-api-loadTU-test.m:50:6: DeclRefExpr=c:48:12 [Extent=50:6:50:6] +// CHECK: c-index-api-loadTU-test.m:51:2: ObjCMessageExpr=pMethod:25:1 [Extent=51:2:51:12] +// CHECK: c-index-api-loadTU-test.m:51:3: DeclRefExpr=d:49:13 [Extent=51:3:51:3] +// CHECK: c-index-api-loadTU-test.m:52:2: ObjCMessageExpr=catMethodWithFloat::20:1 [Extent=52:2:52:43] +// CHECK: c-index-api-loadTU-test.m:52:3: DeclRefExpr=bee:46:8 [Extent=52:3:52:5] +// CHECK: c-index-api-loadTU-test.m:52:26: ObjCMessageExpr=floatMethod:21:1 [Extent=52:26:52:42] +// CHECK: c-index-api-loadTU-test.m:52:27: DeclRefExpr=bee:46:8 [Extent=52:27:52:29] +// CHECK: c-index-api-loadTU-test.m:53:3: CallExpr=main:45:5 [Extent=53:3:53:36] +// CHECK: c-index-api-loadTU-test.m:53:3: UnexposedExpr=main:45:5 [Extent=53:3:53:6] +// CHECK: c-index-api-loadTU-test.m:53:3: DeclRefExpr=main:45:5 [Extent=53:3:53:6] +// CHECK: c-index-api-loadTU-test.m:53:8: DeclRefExpr=someEnum:42:3 [Extent=53:8:53:15] +// CHECK: c-index-api-loadTU-test.m:53:18: UnexposedExpr=bee:46:8 [Extent=53:18:53:35] +// CHECK: c-index-api-loadTU-test.m:53:33: DeclRefExpr=bee:46:8 [Extent=53:33:53:35] diff --git a/test/Index/c-index-getCursor-test.m b/test/Index/c-index-getCursor-test.m index 03ab5a8..8fb7ffc 100644 --- a/test/Index/c-index-getCursor-test.m +++ b/test/Index/c-index-getCursor-test.m @@ -53,108 +53,101 @@ int main (int argc, const char * argv[]) { } // CHECK: {start_line=1 start_col=1 end_line=2 end_col=62} Invalid Cursor => NoDeclFound -// CHECK: {start_line=3 start_col=1 end_line=6 end_col=1} ObjCInterfaceDecl=Foo:3:1 +// CHECK: {start_line=3 start_col=1 end_line=6 end_col=1} ObjCInterfaceDecl=Foo:3:12 // CHECK: {start_line=7 start_col=1 end_line=7 end_col=6} ObjCInstanceMethodDecl=foo:7:1 -// CHECK: {start_line=7 start_col=7 end_line=7 end_col=7} ObjCInterfaceDecl=Foo:3:1 +// CHECK: {start_line=7 start_col=7 end_line=7 end_col=7} ObjCInterfaceDecl=Foo:3:12 // CHECK: {start_line=8 start_col=1 end_line=8 end_col=7} ObjCClassMethodDecl=fooC:8:1 -// CHECK: {start_line=8 start_col=8 end_line=10 end_col=4} ObjCInterfaceDecl=Foo:3:1 +// CHECK: {start_line=8 start_col=8 end_line=10 end_col=4} ObjCInterfaceDecl=Foo:3:12 // CHECK: {start_line=10 start_col=5 end_line=11 end_col=1} Invalid Cursor => NoDeclFound -// CHECK: {start_line=12 start_col=1 end_line=16 end_col=4} ObjCInterfaceDecl=Bar:12:1 +// CHECK: {start_line=12 start_col=1 end_line=12 end_col=17} ObjCInterfaceDecl=Bar:12:12 +// CHECK: {start_line=12 start_col=18 end_line=12 end_col=20} ObjCSuperClassRef=Foo:3:12 +// CHECK: {start_line=12 start_col=21 end_line=16 end_col=4} ObjCInterfaceDecl=Bar:12:12 // CHECK: {start_line=16 start_col=5 end_line=17 end_col=1} Invalid Cursor => NoDeclFound -// CHECK: {start_line=18 start_col=1 end_line=18 end_col=24} ObjCCategoryDecl=FooCat:18:1 +// CHECK: {start_line=18 start_col=1 end_line=18 end_col=11} ObjCCategoryDecl=FooCat:18:12 +// CHECK: {start_line=18 start_col=12 end_line=18 end_col=14} ObjCClassRef=Foo:3:12 +// CHECK: {start_line=18 start_col=15 end_line=18 end_col=24} ObjCCategoryDecl=FooCat:18:12 // CHECK: {start_line=19 start_col=1 end_line=19 end_col=28} ObjCInstanceMethodDecl=catMethodWithFloat::19:1 -// CHECK: {start_line=19 start_col=29 end_line=19 end_col=33} ParmDecl=fArg:19:36 -// CHECK: {start_line=19 start_col=34 end_line=19 end_col=35} ObjCInstanceMethodDecl=catMethodWithFloat::19:1 -// CHECK: {start_line=19 start_col=36 end_line=19 end_col=39} ParmDecl=fArg:19:36 +// CHECK: {start_line=19 start_col=29 end_line=19 end_col=39} ParmDecl=fArg:19:36 (Definition) // CHECK: {start_line=19 start_col=40 end_line=19 end_col=40} ObjCInstanceMethodDecl=catMethodWithFloat::19:1 -// CHECK: {start_line=19 start_col=41 end_line=19 end_col=41} ObjCCategoryDecl=FooCat:18:1 +// CHECK: {start_line=19 start_col=41 end_line=19 end_col=41} ObjCCategoryDecl=FooCat:18:12 // CHECK: {start_line=20 start_col=1 end_line=20 end_col=22} ObjCInstanceMethodDecl=floatMethod:20:1 -// CHECK: {start_line=20 start_col=23 end_line=21 end_col=4} ObjCCategoryDecl=FooCat:18:1 +// CHECK: {start_line=20 start_col=23 end_line=21 end_col=4} ObjCCategoryDecl=FooCat:18:12 // CHECK: {start_line=21 start_col=5 end_line=22 end_col=1} Invalid Cursor => NoDeclFound -// CHECK: {start_line=23 start_col=1 end_line=23 end_col=16} ObjCProtocolDecl=Proto:23:1 +// CHECK: {start_line=23 start_col=1 end_line=23 end_col=16} ObjCProtocolDecl=Proto:23:1 (Definition) // CHECK: {start_line=24 start_col=1 end_line=24 end_col=10} ObjCInstanceMethodDecl=pMethod:24:1 -// CHECK: {start_line=24 start_col=11 end_line=25 end_col=4} ObjCProtocolDecl=Proto:23:1 +// CHECK: {start_line=24 start_col=11 end_line=25 end_col=4} ObjCProtocolDecl=Proto:23:1 (Definition) // CHECK: {start_line=25 start_col=5 end_line=26 end_col=1} Invalid Cursor => NoDeclFound -// CHECK: {start_line=27 start_col=1 end_line=27 end_col=23} ObjCProtocolDecl=SubP:27:1 +// CHECK: {start_line=27 start_col=1 end_line=27 end_col=16} ObjCProtocolDecl=SubP:27:1 (Definition) +// CHECK: {start_line=27 start_col=17 end_line=27 end_col=21} ObjCProtocolRef=Proto:23:1 +// CHECK: {start_line=27 start_col=22 end_line=27 end_col=23} ObjCProtocolDecl=SubP:27:1 (Definition) // CHECK: {start_line=28 start_col=1 end_line=28 end_col=11} ObjCInstanceMethodDecl=spMethod:28:1 -// CHECK: {start_line=28 start_col=12 end_line=29 end_col=4} ObjCProtocolDecl=SubP:27:1 +// CHECK: {start_line=28 start_col=12 end_line=29 end_col=4} ObjCProtocolDecl=SubP:27:1 (Definition) // CHECK: {start_line=29 start_col=5 end_line=30 end_col=1} Invalid Cursor => NoDeclFound -// CHECK: {start_line=31 start_col=1 end_line=33 end_col=4} ObjCInterfaceDecl=Baz:31:1 -// CHECK: {start_line=33 start_col=5 end_line=33 end_col=7} Invalid Cursor => NotImplemented -// CHECK: {start_line=33 start_col=8 end_line=33 end_col=8} ObjCInterfaceDecl=Baz:31:1 -// CHECK: {start_line=33 start_col=9 end_line=33 end_col=15} Invalid Cursor => NotImplemented -// CHECK: {start_line=33 start_col=16 end_line=35 end_col=1} ObjCInterfaceDecl=Baz:31:1 +// CHECK: {start_line=31 start_col=1 end_line=31 end_col=17} ObjCInterfaceDecl=Baz:31:12 +// CHECK: {start_line=31 start_col=18 end_line=31 end_col=20} ObjCSuperClassRef=Bar:12:12 +// CHECK: {start_line=31 start_col=21 end_line=31 end_col=22} ObjCInterfaceDecl=Baz:31:12 +// CHECK: {start_line=31 start_col=23 end_line=31 end_col=26} ObjCProtocolRef=SubP:27:1 +// CHECK: {start_line=31 start_col=27 end_line=33 end_col=8} ObjCInterfaceDecl=Baz:31:12 +// CHECK: {start_line=33 start_col=9 end_line=33 end_col=15} ObjCIvarDecl=_anIVar:33:9 (Definition) +// CHECK: {start_line=33 start_col=16 end_line=35 end_col=1} ObjCInterfaceDecl=Baz:31:12 // CHECK: {start_line=36 start_col=1 end_line=36 end_col=20} ObjCInstanceMethodDecl=bazMethod:36:1 -// CHECK: {start_line=36 start_col=21 end_line=38 end_col=4} ObjCInterfaceDecl=Baz:31:1 +// CHECK: {start_line=36 start_col=21 end_line=38 end_col=4} ObjCInterfaceDecl=Baz:31:12 // CHECK: {start_line=38 start_col=5 end_line=39 end_col=1} Invalid Cursor => NoDeclFound -// CHECK: {start_line=40 start_col=1 end_line=41 end_col=2} EnumDecl=:40:1 -// CHECK: {start_line=41 start_col=3 end_line=41 end_col=10} EnumConstantDecl=someEnum:41:3 -// CHECK: {start_line=41 start_col=11 end_line=42 end_col=1} EnumDecl=:40:1 -// CHECK: {start_line=42 start_col=2 end_line=43 end_col=1} Invalid Cursor => NoDeclFound -// CHECK: {start_line=44 start_col=1 end_line=44 end_col=3} FunctionDecl=main:44:5 -// CHECK: {start_line=44 start_col=4 end_line=44 end_col=4} Invalid Cursor => NoDeclFound -// CHECK: {start_line=44 start_col=5 end_line=44 end_col=10} FunctionDecl=main:44:5 -// CHECK: {start_line=44 start_col=11 end_line=44 end_col=13} ParmDecl=argc:44:15 -// CHECK: {start_line=44 start_col=14 end_line=44 end_col=14} FunctionDecl=main:44:5 -// CHECK: {start_line=44 start_col=15 end_line=44 end_col=18} ParmDecl=argc:44:15 -// CHECK: {start_line=44 start_col=19 end_line=44 end_col=26} FunctionDecl=main:44:5 -// CHECK: {start_line=44 start_col=27 end_line=44 end_col=30} ParmDecl=argv:44:34 -// CHECK: {start_line=44 start_col=31 end_line=44 end_col=31} FunctionDecl=main:44:5 -// CHECK: {start_line=44 start_col=32 end_line=44 end_col=32} ParmDecl=argv:44:34 -// CHECK: {start_line=44 start_col=33 end_line=44 end_col=33} FunctionDecl=main:44:5 -// CHECK: {start_line=44 start_col=34 end_line=44 end_col=39} ParmDecl=argv:44:34 -// CHECK: {start_line=44 start_col=40 end_line=45 end_col=1} FunctionDecl=main:44:5 -// CHECK: {start_line=45 start_col=2 end_line=45 end_col=4} ObjCClassRef=Baz:45:8 -// CHECK: {start_line=45 start_col=5 end_line=45 end_col=5} FunctionDecl=main:44:5 -// CHECK: {start_line=45 start_col=6 end_line=45 end_col=6} VarDecl=bee:45:8 -// CHECK: {start_line=45 start_col=7 end_line=45 end_col=7} FunctionDecl=main:44:5 -// CHECK: {start_line=45 start_col=8 end_line=45 end_col=10} VarDecl=bee:45:8 -// CHECK: {start_line=45 start_col=11 end_line=46 end_col=1} FunctionDecl=main:44:5 -// CHECK: {start_line=46 start_col=2 end_line=46 end_col=3} TypedefDecl=id:0:0 -// CHECK: {start_line=46 start_col=4 end_line=46 end_col=4} FunctionDecl=main:44:5 -// CHECK: {start_line=46 start_col=5 end_line=46 end_col=8} VarDecl=a:46:5 -// CHECK: {start_line=46 start_col=9 end_line=46 end_col=9} ObjCSelectorRef=foo:7:1 -// CHECK: {start_line=46 start_col=10 end_line=46 end_col=12} VarRef=bee:45:8 -// CHECK: {start_line=46 start_col=13 end_line=46 end_col=17} ObjCSelectorRef=foo:7:1 -// CHECK: {start_line=46 start_col=18 end_line=47 end_col=1} FunctionDecl=main:44:5 -// CHECK: {start_line=47 start_col=2 end_line=47 end_col=3} TypedefDecl=id:0:0 -// CHECK: {start_line=47 start_col=4 end_line=47 end_col=4} FunctionDecl=main:44:5 -// CHECK: {start_line=47 start_col=5 end_line=47 end_col=5} VarDecl=c:47:12 -// CHECK: {start_line=47 start_col=6 end_line=47 end_col=9} ObjCProtocolRef=SubP:47:12 -// CHECK: {start_line=47 start_col=10 end_line=47 end_col=10} VarDecl=c:47:12 -// CHECK: {start_line=47 start_col=11 end_line=47 end_col=11} FunctionDecl=main:44:5 -// CHECK: {start_line=47 start_col=12 end_line=47 end_col=15} VarDecl=c:47:12 -// CHECK: {start_line=47 start_col=16 end_line=47 end_col=25} ObjCSelectorRef=fooC:8:1 -// CHECK: {start_line=47 start_col=26 end_line=48 end_col=1} FunctionDecl=main:44:5 -// CHECK: {start_line=48 start_col=2 end_line=48 end_col=3} TypedefDecl=id:0:0 -// CHECK: {start_line=48 start_col=4 end_line=48 end_col=4} FunctionDecl=main:44:5 -// CHECK: {start_line=48 start_col=5 end_line=48 end_col=5} VarDecl=d:48:13 -// CHECK: {start_line=48 start_col=6 end_line=48 end_col=10} ObjCProtocolRef=Proto:48:13 -// CHECK: {start_line=48 start_col=11 end_line=48 end_col=11} VarDecl=d:48:13 -// CHECK: {start_line=48 start_col=12 end_line=48 end_col=12} FunctionDecl=main:44:5 -// CHECK: {start_line=48 start_col=13 end_line=48 end_col=13} VarDecl=d:48:13 -// CHECK: {start_line=48 start_col=14 end_line=49 end_col=1} FunctionDecl=main:44:5 -// CHECK: {start_line=49 start_col=2 end_line=49 end_col=2} VarRef=d:48:13 -// CHECK: {start_line=49 start_col=3 end_line=49 end_col=5} FunctionDecl=main:44:5 -// CHECK: {start_line=49 start_col=6 end_line=49 end_col=6} VarRef=c:47:12 -// CHECK: {start_line=49 start_col=7 end_line=50 end_col=1} FunctionDecl=main:44:5 -// CHECK: {start_line=50 start_col=2 end_line=50 end_col=2} ObjCSelectorRef=pMethod:24:1 -// CHECK: {start_line=50 start_col=3 end_line=50 end_col=3} VarRef=d:48:13 -// CHECK: {start_line=50 start_col=4 end_line=50 end_col=12} ObjCSelectorRef=pMethod:24:1 -// CHECK: {start_line=50 start_col=13 end_line=51 end_col=1} FunctionDecl=main:44:5 -// CHECK: {start_line=51 start_col=2 end_line=51 end_col=2} ObjCSelectorRef=catMethodWithFloat::19:1 -// CHECK: {start_line=51 start_col=3 end_line=51 end_col=5} VarRef=bee:45:8 -// CHECK: {start_line=51 start_col=6 end_line=51 end_col=25} ObjCSelectorRef=catMethodWithFloat::19:1 -// CHECK: {start_line=51 start_col=26 end_line=51 end_col=26} ObjCSelectorRef=floatMethod:20:1 -// CHECK: {start_line=51 start_col=27 end_line=51 end_col=29} VarRef=bee:45:8 -// CHECK: {start_line=51 start_col=30 end_line=51 end_col=42} ObjCSelectorRef=floatMethod:20:1 -// CHECK: {start_line=51 start_col=43 end_line=51 end_col=43} ObjCSelectorRef=catMethodWithFloat::19:1 -// CHECK: {start_line=51 start_col=44 end_line=52 end_col=2} FunctionDecl=main:44:5 -// CHECK: {start_line=52 start_col=3 end_line=52 end_col=6} FunctionRef=main:44:5 -// CHECK: {start_line=52 start_col=7 end_line=52 end_col=7} FunctionDecl=main:44:5 -// CHECK: {start_line=52 start_col=8 end_line=52 end_col=15} EnumConstantRef=someEnum:41:3 -// CHECK: {start_line=52 start_col=16 end_line=52 end_col=32} FunctionDecl=main:44:5 -// CHECK: {start_line=52 start_col=33 end_line=52 end_col=35} VarRef=bee:45:8 -// CHECK: {start_line=52 start_col=36 end_line=53 end_col=1} FunctionDecl=main:44:5 -// CHECK: {start_line=53 start_col=2 end_line=160 end_col=1} Invalid Cursor => NoDeclFound - +// CHECK: {start_line=40 start_col=1 end_line=41 end_col=2} EnumDecl=:40:1 (Definition) +// CHECK: {start_line=41 start_col=3 end_line=41 end_col=10} EnumConstantDecl=someEnum:41:3 (Definition) +// CHECK: {start_line=41 start_col=11 end_line=42 end_col=1} EnumDecl=:40:1 (Definition) +// CHECK: {start_line=42 start_col=2 end_line=44 end_col=4} Invalid Cursor => NoDeclFound +// CHECK: {start_line=44 start_col=5 end_line=44 end_col=10} FunctionDecl=main:44:5 (Definition) +// CHECK: {start_line=44 start_col=11 end_line=44 end_col=18} ParmDecl=argc:44:15 (Definition) +// CHECK: {start_line=44 start_col=19 end_line=44 end_col=26} FunctionDecl=main:44:5 (Definition) +// CHECK: {start_line=44 start_col=27 end_line=44 end_col=37} ParmDecl=argv:44:34 (Definition) +// CHECK: {start_line=44 start_col=38 end_line=44 end_col=41} FunctionDecl=main:44:5 (Definition) +// CHECK: {start_line=44 start_col=42 end_line=45 end_col=1} UnexposedStmt=main +// CHECK: {start_line=45 start_col=2 end_line=45 end_col=4} ObjCClassRef=Baz:31:12 +// CHECK: {start_line=45 start_col=5 end_line=45 end_col=10} VarDecl=bee:45:8 (Definition) +// CHECK: {start_line=45 start_col=11 end_line=45 end_col=11} UnexposedStmt=main +// CHECK: {start_line=45 start_col=12 end_line=46 end_col=1} UnexposedStmt=main +// CHECK: {start_line=46 start_col=2 end_line=46 end_col=3} TypeRef=id:0:0 +// CHECK: {start_line=46 start_col=4 end_line=46 end_col=8} VarDecl=a:46:5 (Definition) +// CHECK: {start_line=46 start_col=9 end_line=46 end_col=9} ObjCMessageExpr=foo:7:1 +// CHECK: {start_line=46 start_col=10 end_line=46 end_col=12} DeclRefExpr=bee:45:8 +// CHECK: {start_line=46 start_col=13 end_line=46 end_col=17} ObjCMessageExpr=foo:7:1 +// CHECK: {start_line=46 start_col=18 end_line=46 end_col=18} UnexposedStmt=main +// CHECK: {start_line=46 start_col=19 end_line=47 end_col=1} UnexposedStmt=main +// CHECK: {start_line=47 start_col=2 end_line=47 end_col=3} TypeRef=id:0:0 +// CHECK: {start_line=47 start_col=4 end_line=47 end_col=5} VarDecl=c:47:12 (Definition) +// CHECK: {start_line=47 start_col=6 end_line=47 end_col=9} ObjCProtocolRef=SubP:27:1 +// CHECK: {start_line=47 start_col=10 end_line=47 end_col=15} VarDecl=c:47:12 (Definition) +// CHECK: {start_line=47 start_col=16 end_line=47 end_col=25} ObjCMessageExpr=fooC:8:1 +// CHECK: {start_line=47 start_col=26 end_line=47 end_col=26} UnexposedStmt=main +// CHECK: {start_line=47 start_col=27 end_line=48 end_col=1} UnexposedStmt=main +// CHECK: {start_line=48 start_col=2 end_line=48 end_col=3} TypeRef=id:0:0 +// CHECK: {start_line=48 start_col=4 end_line=48 end_col=5} VarDecl=d:48:13 (Definition) +// CHECK: {start_line=48 start_col=6 end_line=48 end_col=10} ObjCProtocolRef=Proto:23:1 +// CHECK: {start_line=48 start_col=11 end_line=48 end_col=13} VarDecl=d:48:13 (Definition) +// CHECK: {start_line=48 start_col=14 end_line=48 end_col=14} UnexposedStmt=main +// CHECK: {start_line=48 start_col=15 end_line=49 end_col=1} UnexposedStmt=main +// CHECK: {start_line=49 start_col=2 end_line=49 end_col=2} DeclRefExpr=d:48:13 +// CHECK: {start_line=49 start_col=3 end_line=49 end_col=5} UnexposedExpr= +// CHECK: {start_line=49 start_col=6 end_line=49 end_col=6} DeclRefExpr=c:47:12 +// CHECK: {start_line=49 start_col=7 end_line=50 end_col=1} UnexposedStmt=main +// CHECK: {start_line=50 start_col=2 end_line=50 end_col=2} ObjCMessageExpr=pMethod:24:1 +// CHECK: {start_line=50 start_col=3 end_line=50 end_col=3} DeclRefExpr=d:48:13 +// CHECK: {start_line=50 start_col=4 end_line=50 end_col=12} ObjCMessageExpr=pMethod:24:1 +// CHECK: {start_line=50 start_col=13 end_line=51 end_col=1} UnexposedStmt=main +// CHECK: {start_line=51 start_col=2 end_line=51 end_col=2} ObjCMessageExpr=catMethodWithFloat::19:1 +// CHECK: {start_line=51 start_col=3 end_line=51 end_col=5} DeclRefExpr=bee:45:8 +// CHECK: {start_line=51 start_col=6 end_line=51 end_col=25} ObjCMessageExpr=catMethodWithFloat::19:1 +// CHECK: {start_line=51 start_col=26 end_line=51 end_col=26} ObjCMessageExpr=floatMethod:20:1 +// CHECK: {start_line=51 start_col=27 end_line=51 end_col=29} DeclRefExpr=bee:45:8 +// CHECK: {start_line=51 start_col=30 end_line=51 end_col=42} ObjCMessageExpr=floatMethod:20:1 +// CHECK: {start_line=51 start_col=43 end_line=51 end_col=43} ObjCMessageExpr=catMethodWithFloat::19:1 +// CHECK: {start_line=51 start_col=44 end_line=52 end_col=2} UnexposedStmt=main +// CHECK: {start_line=52 start_col=3 end_line=52 end_col=6} DeclRefExpr=main:44:5 +// CHECK: {start_line=52 start_col=7 end_line=52 end_col=7} CallExpr=main:44:5 +// CHECK: {start_line=52 start_col=8 end_line=52 end_col=15} DeclRefExpr=someEnum:41:3 +// CHECK: {start_line=52 start_col=16 end_line=52 end_col=17} CallExpr=main:44:5 +// CHECK: {start_line=52 start_col=18 end_line=52 end_col=32} UnexposedExpr=bee:45:8 +// CHECK: {start_line=52 start_col=33 end_line=52 end_col=35} DeclRefExpr=bee:45:8 +// CHECK: {start_line=52 start_col=36 end_line=52 end_col=36} CallExpr=main:44:5 +// CHECK: {start_line=52 start_col=37 end_line=53 end_col=1} UnexposedStmt=main diff --git a/test/Index/cindex-from-source.m b/test/Index/cindex-from-source.m index e775bb7..8f79304 100644 --- a/test/Index/cindex-from-source.m +++ b/test/Index/cindex-from-source.m @@ -2,8 +2,8 @@ // RUN: %clang -x objective-c-header %t.pfx.h -o %t.pfx.h.gch // RUN: c-index-test -test-load-source local %s -include %t.pfx.h > %t // RUN: FileCheck %s < %t -// CHECK: cindex-from-source.m:{{.*}}:{{.*}}: StructDecl=s0:{{.*}}:{{.*}} [Context=cindex-from-source.m] -// CHECK: cindex-from-source.m:{{.*}}:{{.*}}: VarDecl=g0:{{.*}}:{{.*}} [Context=cindex-from-source.m] - +// CHECK: cindex-from-source.m:{{.*}}:{{.*}}: StructDecl=s0:{{.*}}:{{.*}} +// CHECK: cindex-from-source.m:{{.*}}:{{.*}}: VarDecl=g0:{{.*}}:{{.*}} +// CHECK: cindex-from-source.m:9:1: TypeRef=t0:1:13 [Extent=9:1:9:2] struct s0 {}; t0 g0; diff --git a/test/Index/comments.c b/test/Index/comments.c deleted file mode 100644 index 0343177..0000000 --- a/test/Index/comments.c +++ /dev/null @@ -1,34 +0,0 @@ -// Run lines are sensitive to line numbers and come below the code. - -//! It all starts here. -/*! It's a little odd to continue line this, - * - * but we need more multi-line comments. */ -/// This comment comes before my other comments -/** This is a block comment that is associated with the function f. It - * runs for three lines. - */ -void f(int, int); - -// NOT IN THE COMMENT -/// This is a BCPL comment that is associated with the function g. -/// It has only two lines. -/** But there are other blocks that are part of the comment, too. */ -void g(int); - -void h(int); ///< This is a member comment. - - -// RUN: %clang_cc1 -emit-pch -o %t.ast %s - -// RUN: index-test %t.ast -point-at %s:11:6 > %t -// RUN: grep "starts here" %t -// RUN: grep "block comment" %t - -// RUN: index-test %t.ast -point-at %s:17:6 > %t -// RUN: grep "BCPL" %t -// RUN: grep "But" %t - -// RUN: index-test %t.ast -point-at %s:19:6 > %t -// RUN: grep "NOT" %t | count 0 -// RUN: grep "member" %t diff --git a/test/Index/find-decls.c b/test/Index/find-decls.c deleted file mode 100644 index f1999b2..0000000 --- a/test/Index/find-decls.c +++ /dev/null @@ -1,25 +0,0 @@ -// RUN: %clang_cc1 -fblocks -emit-pch %S/Inputs/t1.c -o %t1.ast -// RUN: %clang_cc1 -fblocks -emit-pch %S/Inputs/t2.c -o %t2.ast - -// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/t1.c:8:7 -print-decls > %t -// RUN: cat %t | count 3 -// RUN: grep 'foo.h:4:6,' %t | count 2 -// RUN: grep 't2.c:5:6,' %t - -// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/t1.c:5:47 -print-decls > %t -// RUN: cat %t | count 1 -// RUN: grep 't1.c:5:12,' %t - -// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/t1.c:6:20 -print-decls > %t -// RUN: cat %t | count 1 -// RUN: grep 't1.c:3:19,' %t - -// field test - -// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/t1.c:21:6 -print-decls > %t -// RUN: cat %t | count 1 -// RUN: grep 't1.c:12:7,' %t - -// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/t1.c:22:21 -print-decls > %t -// RUN: cat %t | count 1 -// RUN: grep 't1.c:16:7,' %t diff --git a/test/Index/find-defs.c b/test/Index/find-defs.c deleted file mode 100644 index 5129270..0000000 --- a/test/Index/find-defs.c +++ /dev/null @@ -1,18 +0,0 @@ -// RUN: %clang_cc1 -fblocks -emit-pch %S/Inputs/t1.c -o %t1.ast -// RUN: %clang_cc1 -fblocks -emit-pch %S/Inputs/t2.c -o %t2.ast - -// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/foo.h:1:14 -print-defs > %t -// RUN: cat %t | count 1 -// RUN: grep 't2.c:3:5,' %t - -// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/foo.h:3:9 -print-defs > %t -// RUN: cat %t | count 1 -// RUN: grep 't1.c:3:6,' %t - -// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/foo.h:4:9 -print-defs > %t -// RUN: cat %t | count 1 -// RUN: grep 't2.c:5:6,' %t - -// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/t1.c:8:7 -print-defs > %t -// RUN: cat %t | count 1 -// RUN: grep 't2.c:5:6,' %t diff --git a/test/Index/find-refs.c b/test/Index/find-refs.c deleted file mode 100644 index 1f29a77..0000000 --- a/test/Index/find-refs.c +++ /dev/null @@ -1,47 +0,0 @@ -// RUN: %clang_cc1 -fblocks -emit-pch %S/Inputs/t1.c -o %t1.ast -// RUN: %clang_cc1 -fblocks -emit-pch %S/Inputs/t2.c -o %t2.ast - -// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/foo.h:1:14 -print-refs > %t -// RUN: cat %t | count 4 -// RUN: grep 't1.c:4:19,' %t -// RUN: grep 't1.c:28:40,' %t -// RUN: grep 't2.c:6:3,' %t -// RUN: grep 't2.c:7:12,' %t - -// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/foo.h:3:9 -print-refs > %t -// RUN: cat %t | count 1 -// RUN: grep 't2.c:7:3,' %t - -// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/foo.h:4:9 -print-refs > %t -// RUN: cat %t | count 1 -// RUN: grep 't1.c:8:3,' %t - -// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/t1.c:3:22 -print-refs > %t -// RUN: cat %t | count 1 -// RUN: grep 't1.c:6:17,' %t - -// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/t1.c:4:11 -print-refs > %t -// RUN: cat %t | count 1 -// RUN: grep 't1.c:6:5,' %t - -// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/t1.c:5:30 -print-refs > %t -// RUN: cat %t | count 3 -// RUN: grep 't1.c:5:27,' %t -// RUN: grep 't1.c:5:44,' %t -// RUN: grep 't1.c:6:26,' %t - -// field test - -// FIXME: References point at the start of MemberExpr, make them point at the field instead. -// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/t1.c:12:7 -print-refs > %t -// RUN: cat %t | count 1 -// RUN: grep 't1.c:21:3,' %t - -// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/t1.c:16:7 -print-refs > %t -// RUN: cat %t | count 1 -// RUN: grep 't1.c:22:3,' %t - -// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/foo.h:7:11 -print-refs > %t -// RUN: cat %t | count 2 -// RUN: grep 't1.c:25:3,' %t -// RUN: grep 't2.c:10:3,' %t diff --git a/test/Index/load-exprs.c b/test/Index/load-exprs.c new file mode 100644 index 0000000..a360efd --- /dev/null +++ b/test/Index/load-exprs.c @@ -0,0 +1,13 @@ +typedef int T; +struct X { int a, b; }; +void f(void *ptr) { + T* t_ptr = (T *)ptr; + (void)sizeof(T); + struct X x = (struct X){1, 2}; +} + +// RUN: c-index-test -test-load-source all %s | FileCheck %s + +// CHECK: load-exprs.c:4:15: TypeRef=T:1:13 [Extent=4:15:4:15] +// CHECK: load-exprs.c:5:16: TypeRef=T:1:13 [Extent=5:16:5:16] +// FIXME: the source location for "struct X" points at "struct", not "X" diff --git a/test/Index/multiple-redecls.c b/test/Index/multiple-redecls.c deleted file mode 100644 index faea88f..0000000 --- a/test/Index/multiple-redecls.c +++ /dev/null @@ -1,12 +0,0 @@ -// RUN: %clang_cc1 -emit-pch %s -o %t.ast -// RUN: index-test %t.ast -point-at %s:8:4 -print-decls | count 2 -// RUN: index-test %t.ast -point-at %s:8:4 -print-defs | count 1 - -static void foo(int x); - -static void bar(void) { - foo(10); -} - -void foo(int x) { -} diff --git a/test/Index/objc-decls.m b/test/Index/objc-decls.m deleted file mode 100644 index 4fcd830..0000000 --- a/test/Index/objc-decls.m +++ /dev/null @@ -1,16 +0,0 @@ -// RUN: %clang_cc1 -emit-pch %S/Inputs/t1.m -o %t1.m.ast -// RUN: %clang_cc1 -emit-pch %S/Inputs/t2.m -o %t2.m.ast - -// RUN: index-test %t1.m.ast %t2.m.ast -point-at %S/Inputs/t1.m:12:12 -print-decls > %t -// RUN: cat %t | count 2 -// RUN: grep 'objc.h:2:9,' %t | count 2 - -// RUN: index-test %t1.m.ast %t2.m.ast -point-at %S/Inputs/objc.h:5:13 -print-decls > %t -// RUN: cat %t | count 3 -// RUN: grep 'objc.h:5:1,' %t | count 2 -// RUN: grep 't1.m:15:1,' %t | count 1 - -// RUN: index-test %t1.m.ast %t2.m.ast -point-at %S/Inputs/objc.h:10:13 -print-decls > %t -// RUN: cat %t | count 3 -// RUN: grep 'objc.h:10:1,' %t | count 2 -// RUN: grep 't2.m:11:1,' %t | count 1 diff --git a/test/Index/objc-message.m b/test/Index/objc-message.m deleted file mode 100644 index 151565b..0000000 --- a/test/Index/objc-message.m +++ /dev/null @@ -1,38 +0,0 @@ -// RUN: %clang_cc1 -emit-pch %S/Inputs/t1.m -o %t1.m.ast -// RUN: %clang_cc1 -emit-pch %S/Inputs/t2.m -o %t2.m.ast - -// RUN: index-test %t1.m.ast %t2.m.ast -point-at %S/Inputs/objc.h:5:13 -print-refs > %t -// RUN: cat %t | count 1 -// RUN: grep 't1.m:6:3,' %t - -// RUN: index-test %t1.m.ast %t2.m.ast -point-at %S/Inputs/objc.h:6:13 -print-refs > %t -// RUN: cat %t | count 2 -// RUN: grep 't1.m:7:3,' %t -// RUN: grep 't2.m:7:3,' %t - -// RUN: index-test %t1.m.ast %t2.m.ast -point-at %S/Inputs/objc.h:10:13 -print-refs > %t -// RUN: cat %t | count 2 -// RUN: grep 't1.m:6:3,' %t -// RUN: grep 't2.m:6:3,' %t - -// RUN: index-test %t1.m.ast %t2.m.ast -point-at %S/Inputs/t1.m:6:15 -print-decls > %t -// RUN: cat %t | count 6 -// RUN: grep 'objc.h:5:1,' %t | count 2 -// RUN: grep 'objc.h:10:1,' %t | count 2 -// RUN: grep 't1.m:15:1,' %t -// RUN: grep 't2.m:11:1,' %t - -// RUN: index-test %t1.m.ast %t2.m.ast -point-at %S/Inputs/t1.m:7:15 -print-decls > %t -// RUN: cat %t | count 3 -// RUN: grep 'objc.h:6:1,' %t | count 2 -// RUN: grep 't1.m:18:1,' %t - -// RUN: index-test %t2.m.ast %t1.m.ast -point-at %S/Inputs/t2.m:6:15 -print-decls > %t -// RUN: cat %t | count 3 -// RUN: grep 'objc.h:10:1,' %t | count 2 -// RUN: grep 't2.m:11:1,' %t - -// RUN: index-test %t2.m.ast %t1.m.ast -point-at %S/Inputs/t2.m:7:15 -print-decls > %t -// RUN: cat %t | count 3 -// RUN: grep 'objc.h:6:1,' %t | count 2 -// RUN: grep 't1.m:18:1,' %t diff --git a/test/Index/remap-cursor-at.c b/test/Index/remap-cursor-at.c new file mode 100644 index 0000000..f7bcf79 --- /dev/null +++ b/test/Index/remap-cursor-at.c @@ -0,0 +1,5 @@ +// RUN: c-index-test -cursor-at=%s:1:15 -cursor-at=%s:2:21 -remap-file="%s;%S/Inputs/remap-load-to.c" %s | FileCheck %s +// RUN: CINDEXTEST_USE_EXTERNAL_AST_GENERATION=1 c-index-test -cursor-at=%s:1:15 -cursor-at=%s:2:21 -remap-file="%s;%S/Inputs/remap-load-to.c" %s | FileCheck %s + +// CHECK: ParmDecl=parm1:1:13 (Definition) +// CHECK: DeclRefExpr=parm2:1:26 diff --git a/test/Index/remap-load.c b/test/Index/remap-load.c new file mode 100644 index 0000000..84e45bc --- /dev/null +++ b/test/Index/remap-load.c @@ -0,0 +1,13 @@ +// RUN: c-index-test -test-load-source all -remap-file="%s;%S/Inputs/remap-load-to.c" %s | FileCheck -check-prefix=CHECK %s +// RUN: CINDEXTEST_USE_EXTERNAL_AST_GENERATION=1 c-index-test -test-load-source all -remap-file="%s;%S/Inputs/remap-load-to.c" %s | FileCheck -check-prefix=CHECK %s + +// CHECK: remap-load.c:1:5: FunctionDecl=foo:1:5 (Definition) [Extent=1:5:3:1] +// CHECK: remap-load.c:1:13: ParmDecl=parm1:1:13 (Definition) [Extent=1:9:1:17] +// CHECK: remap-load.c:1:26: ParmDecl=parm2:1:26 (Definition) [Extent=1:20:1:30] +// CHECK: remap-load.c:1:5: UnexposedStmt=foo [Extent=1:33:3:1] +// CHECK: remap-load.c:1:5: UnexposedStmt=foo [Extent=2:3:2:22] +// CHECK: remap-load.c:2:10: UnexposedExpr= [Extent=2:10:2:22] +// CHECK: remap-load.c:2:10: UnexposedExpr= [Extent=2:10:2:22] +// CHECK: remap-load.c:2:10: UnexposedExpr=parm1:1:13 [Extent=2:10:2:14] +// CHECK: remap-load.c:2:10: DeclRefExpr=parm1:1:13 [Extent=2:10:2:14] +// CHECK: remap-load.c:2:18: DeclRefExpr=parm2:1:26 [Extent=2:18:2:22] diff --git a/test/Index/resolve-loc.c b/test/Index/resolve-loc.c deleted file mode 100644 index 68504ee..0000000 --- a/test/Index/resolve-loc.c +++ /dev/null @@ -1,37 +0,0 @@ -// Run lines are sensitive to line numbers and come below the code. - -int top_var; - -void top_func_decl(int param1); - -void top_func_def(int param2) { - int local_var1; - for (int for_var = 100; for_var < 500; ++for_var) { - int local_var2 = for_var + 1; - } -} - -struct S { - int field_var; -}; - - -// RUN: %clang_cc1 -emit-pch %s -o %t.ast -// RUN: index-test %t.ast -point-at %s:3:8 | grep top_var -// RUN: index-test %t.ast -point-at %s:5:15 | grep top_func_decl -// RUN: index-test %t.ast -point-at %s:5:25 | grep param1 -// RUN: index-test %t.ast -point-at %s:7:17 | grep top_func_def -// RUN: index-test %t.ast -point-at %s:7:23 | grep param2 -// RUN: index-test %t.ast -point-at %s:8:10 | grep local_var1 -// RUN: index-test %t.ast -point-at %s:9:15 | grep for_var - -// RUN: index-test %t.ast -point-at %s:9:43 > %t -// RUN: grep '++for_var' %t - -// RUN: index-test %t.ast -point-at %s:10:9 | grep local_var2 - -// RUN: index-test %t.ast -point-at %s:10:30 > %t -// RUN: grep 'for_var + 1' %t - -// fields test. -// RUN: index-test %t.ast -point-at %s:15:10 | grep field_var diff --git a/test/Lexer/constants-ms.c b/test/Lexer/constants-ms.c index 5b3f826..97e6600 100644 --- a/test/Lexer/constants-ms.c +++ b/test/Lexer/constants-ms.c @@ -7,6 +7,19 @@ __int64 x5 = 0x42i64; __int64 x4 = 70000000i128; __int64 y = 0x42i64u; // expected-error {{invalid suffix}} -__int64 w = 0x43ui64; // expected-error {{invalid suffix}} +__int64 w = 0x43ui64; __int64 z = 9Li64; // expected-error {{invalid suffix}} __int64 q = 10lli64; // expected-error {{invalid suffix}} + +// radar 7562363 +#define ULLONG_MAX 0xffffffffffffffffui64 +#define UINT 0xffffffffui32 +#define USHORT 0xffffui16 +#define UCHAR 0xffui8 + +void a() { + unsigned long long m = ULLONG_MAX; + unsigned int n = UINT; + unsigned short s = USHORT; + unsigned char c = UCHAR; +} diff --git a/test/Misc/tabstop.c b/test/Misc/tabstop.c index 3fabda7..66685c6 100644 --- a/test/Misc/tabstop.c +++ b/test/Misc/tabstop.c @@ -28,3 +28,23 @@ void* d = 1; //CHECK-5: {{^ void\* b = 1;}} //CHECK-5: {{^ void\* c = 1;}} //CHECK-5: {{^void\* d = 1;}} + +// Test code modification hints + +void f(void) +{ + if (0 & 1 == 1) + {} +} + +// CHECK-3: {{^ }}if (0 & 1 == 1) +// CHECK-3: {{^ }} ( ) +// CHECK-3: {{^ }} ( ) + +// CHECK-4: {{^ }}if (0 & 1 == 1) +// CHECK-4: {{^ }} ( ) +// CHECK-4: {{^ }} ( ) + +// CHECK-5: {{^ }}if (0 & 1 == 1) +// CHECK-5: {{^ }} ( ) +// CHECK-5: {{^ }} ( ) diff --git a/test/PCH/cxx_exprs.cpp b/test/PCH/cxx_exprs.cpp new file mode 100644 index 0000000..51269d5 --- /dev/null +++ b/test/PCH/cxx_exprs.cpp @@ -0,0 +1,26 @@ +// Test this without pch. +// RUN: %clang_cc1 -include %S/cxx_exprs.h -fsyntax-only -verify %s + +// Test with pch. +// RUN: %clang_cc1 -x c++-header -emit-pch -o %t %S/cxx_exprs.h +// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s + +int integer; +double floating; +char character; + +// CXXStaticCastExpr +static_cast_result void_ptr = &integer; + +// CXXDynamicCastExpr +Derived *d; +dynamic_cast_result derived_ptr = d; + +// CXXReinterpretCastExpr +reinterpret_cast_result void_ptr2 = &integer; + +// CXXConstCastExpr +const_cast_result char_ptr = &character; + +// CXXFunctionalCastExpr +functional_cast_result *double_ptr = &floating; diff --git a/test/PCH/cxx_exprs.h b/test/PCH/cxx_exprs.h new file mode 100644 index 0000000..b649428 --- /dev/null +++ b/test/PCH/cxx_exprs.h @@ -0,0 +1,21 @@ +// Header for PCH test cxx_exprs.cpp + +// CXXStaticCastExpr +typedef typeof(static_cast<void *>(0)) static_cast_result; + +// CXXDynamicCastExpr +struct Base { virtual void f(); }; +struct Derived : Base { }; +Base *base_ptr; +typedef typeof(dynamic_cast<Derived *>(base_ptr)) dynamic_cast_result; + +// CXXReinterpretCastExpr +typedef typeof(reinterpret_cast<void *>(0)) reinterpret_cast_result; + +// CXXConstCastExpr +const char *const_char_ptr_value; +typedef typeof(const_cast<char *>(const_char_ptr_value)) const_cast_result; + +// CXXFunctionalCastExpr +int int_value; +typedef typeof(double(int_value)) functional_cast_result; diff --git a/test/Preprocessor/foo.framework/Headers/bar.h b/test/Preprocessor/foo.framework/Headers/bar.h deleted file mode 100644 index 574e851..0000000 --- a/test/Preprocessor/foo.framework/Headers/bar.h +++ /dev/null @@ -1,3 +0,0 @@ - -int y; - diff --git a/test/Preprocessor/foo.framework/Headers/foo.h b/test/Preprocessor/foo.framework/Headers/foo.h deleted file mode 100644 index b08d948..0000000 --- a/test/Preprocessor/foo.framework/Headers/foo.h +++ /dev/null @@ -1,6 +0,0 @@ -// This should warn: published framework headers should always -// #import headers within the framework with framework paths. -#include "bar.h" - -int x; - diff --git a/test/Preprocessor/framework-include.m b/test/Preprocessor/framework-include.m deleted file mode 100644 index 7e50f18..0000000 --- a/test/Preprocessor/framework-include.m +++ /dev/null @@ -1,5 +0,0 @@ -// RUN: %clang -E -F%S %s 2>&1 | grep "published framework headers should always #import headers within the framework with framework paths" - -// rdar://7520940 -#include <foo/foo.h> - diff --git a/test/Rewriter/rewrite-byref-vars.mm b/test/Rewriter/rewrite-byref-vars.mm index 581437b..1489c59 100644 --- a/test/Rewriter/rewrite-byref-vars.mm +++ b/test/Rewriter/rewrite-byref-vars.mm @@ -31,5 +31,16 @@ __declspec(dllexport) extern "C" __declspec(dllexport) void XXXXBreakTheRewriter } +@interface I +{ + id list; +} +- (void) Meth; +@end + +@implementation I +- (void) Meth { __attribute__((__blocks__(byref))) void ** listp = (void **)list; } +@end + // $CLANG -cc1 -fms-extensions -rewrite-objc -x objective-c++ -fblocks bug.mm // g++ -c -D"__declspec(X)=" bug.cpp diff --git a/test/Rewriter/rewrite-extern-c.mm b/test/Rewriter/rewrite-extern-c.mm new file mode 100644 index 0000000..1c8e90f --- /dev/null +++ b/test/Rewriter/rewrite-extern-c.mm @@ -0,0 +1,8 @@ +// RUN: %clang_cc1 -x objective-c++ -fblocks -rewrite-objc -o - %s +// radar 7546096 + +extern "C" { + short foo() { } +} +typedef unsigned char Boolean; + diff --git a/test/Rewriter/rewrite-protocol-type-1.m b/test/Rewriter/rewrite-protocol-type-1.m index 902559d..2bdf8e4 100644 --- a/test/Rewriter/rewrite-protocol-type-1.m +++ b/test/Rewriter/rewrite-protocol-type-1.m @@ -22,3 +22,6 @@ INTF <MyProto1, MyProto2> * Func1(INTF *p2, INTF<MyProto1, MyProto2> *p3, INTF * return p3; } +@interface Foo +@property int (*hashFunction)(const void *item, int (*size)(const void *item)); +@end diff --git a/test/Rewriter/rewrite-typeof.mm b/test/Rewriter/rewrite-typeof.mm new file mode 100644 index 0000000..f95cd9a --- /dev/null +++ b/test/Rewriter/rewrite-typeof.mm @@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc -o - %s + +extern "C" { +extern "C" void *_Block_copy(const void *aBlock); +extern "C" void _Block_release(const void *aBlock); +} + +int main() { + __attribute__((__blocks__(byref))) int a = 42; + int save_a = a; + + void (^b)(void) = ^{ + ((__typeof(^{ a = 2; }))_Block_copy((const void *)(^{ a = 2; }))); + }; + + ((__typeof(b))_Block_copy((const void *)(b))); + + return 0; +} + diff --git a/test/Sema/block-literal.c b/test/Sema/block-literal.c index e9c2341..c303b84 100644 --- a/test/Sema/block-literal.c +++ b/test/Sema/block-literal.c @@ -33,7 +33,8 @@ void test2() { break; // expected-error {{'break' statement not in loop or switch statement}} continue; // expected-error {{'continue' statement not in loop statement}} while(1) break; // ok - goto foo; // expected-error {{goto not allowed}} + goto foo; // expected-error {{use of undeclared label 'foo'}} + a: goto a; // ok }); break; } diff --git a/test/Sema/block-misc.c b/test/Sema/block-misc.c index 52cebfe..1109be6 100644 --- a/test/Sema/block-misc.c +++ b/test/Sema/block-misc.c @@ -87,8 +87,7 @@ int test7(void (^p)()) { void test8() { somelabel: - // FIXME: This should say "jump out of block not legal" when gotos are allowed. - ^{ goto somelabel; }(); // expected-error {{goto not allowed in block literal}} + ^{ goto somelabel; }(); // expected-error {{use of undeclared label 'somelabel'}} } void test9() { diff --git a/test/Sema/compound-literal.c b/test/Sema/compound-literal.c index a650d12..0c8ddd4 100644 --- a/test/Sema/compound-literal.c +++ b/test/Sema/compound-literal.c @@ -31,3 +31,6 @@ void IncompleteFunc(unsigned x) { (void){1,2,3}; // -expected-error {{variable has incomplete type}} (void(void)) { 0 }; // -expected-error{{illegal initializer type 'void (void)'}} } + +// PR6080 +int array[(sizeof(int[3]) == sizeof( (int[]) {0,1,2} )) ? 1 : -1]; diff --git a/test/Sema/scope-check.c b/test/Sema/scope-check.c index 4d3f6cb..74bc7c4 100644 --- a/test/Sema/scope-check.c +++ b/test/Sema/scope-check.c @@ -181,15 +181,14 @@ void test11(int n) { // TODO: When and if gotos are allowed in blocks, this should work. void test12(int n) { void *P = ^{ - goto L1; // expected-error {{goto not allowed in block literal}} + goto L1; L1: - goto L2; // expected-error {{goto not allowed in block literal}} + goto L2; L2: - goto L3; // expected-error {{goto not allowed in block literal}} - // todo-error {{illegal goto into protected scope}} - int Arr[n]; // todo-note {{jump bypasses initialization of variable length array}} + goto L3; // expected-error {{illegal goto into protected scope}} + int Arr[n]; // expected-note {{jump bypasses initialization of variable length array}} L3: - goto L4; // expected-error {{goto not allowed in block literal}} + goto L4; L4: return; }; } diff --git a/test/Sema/warn-unreachable.c b/test/Sema/warn-unreachable.c index 2c123d0..1eef637 100644 --- a/test/Sema/warn-unreachable.c +++ b/test/Sema/warn-unreachable.c @@ -1,4 +1,8 @@ -// RUN: %clang %s -fsyntax-only -Xclang -verify -fblocks -Wunreachable-code +// RUN: %clang %s -fsyntax-only -Xclang -verify -fblocks -Wunreachable-code -Wno-unused-value + +int halt() __attribute__((noreturn)); +int live(); +int dead(); void test1() { goto c; @@ -18,3 +22,79 @@ void test1() { goto d; f: ; } + +void test2() { + int i; + switch (live()) { + case 1: + halt(), + dead(); // expected-warning {{will never be executed}} + + case 2: + live(), halt(), + dead(); // expected-warning {{will never be executed}} + + case 3: + live() + + // expected-warning {{will never be executed}} + halt(); + dead(); + + case 4: + a4: + live(), + halt(); + goto a4; // expected-warning {{will never be executed}} + + case 5: + goto a5; + c5: + dead(); // expected-warning {{will never be executed}} + goto b5; + a5: + live(), + halt(); + b5: + goto c5; + + case 6: + if (live()) + goto e6; + live(), + halt(); + d6: + dead(); // expected-warning {{will never be executed}} + goto b6; + c6: + dead(); + goto b6; + e6: + live(), + halt(); + b6: + goto c6; + case 7: + halt() + + // expected-warning {{will never be executed}} + dead(); + - // expected-warning {{will never be executed}} + halt(); + case 8: + i + += // expected-warning {{will never be executed}} + halt(); + case 9: + halt() + ? // expected-warning {{will never be executed}} + dead() : dead(); + case 10: + ( // expected-warning {{will never be executed}} + float)halt(); + case 11: { + int a[5]; + live(), + a[halt() + ]; // expected-warning {{will never be executed}} + } + } +} diff --git a/test/SemaCXX/access-control-check.cpp b/test/SemaCXX/access-control-check.cpp index e6e261c..cf2d191 100644 --- a/test/SemaCXX/access-control-check.cpp +++ b/test/SemaCXX/access-control-check.cpp @@ -5,12 +5,11 @@ class M { }; class P { - int iP; - int PPR(); + int iP; // expected-note {{declared private here}} + int PPR(); // expected-note {{declared private here}} }; class N : M,P { N() {} - // FIXME. No access violation is reported in method call or member access. - int PR() { return iP + PPR(); } + int PR() { return iP + PPR(); } // expected-error 2 {{access to private member of 'class P'}} }; diff --git a/test/SemaCXX/anonymous-union.cpp b/test/SemaCXX/anonymous-union.cpp index 374241c..0590db2 100644 --- a/test/SemaCXX/anonymous-union.cpp +++ b/test/SemaCXX/anonymous-union.cpp @@ -111,3 +111,13 @@ struct BadMembers { // <rdar://problem/6481130> typedef union { }; // expected-error{{declaration does not declare anything}} + +// <rdar://problem/7562438> +typedef struct objc_module *Foo ; + +typedef struct _s { + union { + int a; + int Foo; + }; +} s, *ps; diff --git a/test/SemaCXX/enum.cpp b/test/SemaCXX/enum.cpp index f1b02f5..47ae06a 100644 --- a/test/SemaCXX/enum.cpp +++ b/test/SemaCXX/enum.cpp @@ -56,3 +56,14 @@ namespace test1 { enum enum4 { v4 = __LONG_MAX__ * 2UL }; int test4[is_same<__typeof(+v4), unsigned long>::value]; } + +// PR6061 +namespace PR6061 { + struct A { enum { id }; }; + struct B { enum { id }; }; + + struct C : public A, public B + { + enum { id }; + }; +} diff --git a/test/SemaCXX/new-delete.cpp b/test/SemaCXX/new-delete.cpp index 0e0f630..b058fc1 100644 --- a/test/SemaCXX/new-delete.cpp +++ b/test/SemaCXX/new-delete.cpp @@ -65,7 +65,7 @@ void bad_news(int *ip) (void)new S(1); // expected-error {{no matching constructor}} (void)new S(1, 1); // expected-error {{call to constructor of 'struct S' is ambiguous}} (void)new const int; // expected-error {{default initialization of an object of const type 'int const'}} - (void)new float*(ip); // expected-error {{cannot initialize a value of type 'float *' with an lvalue of type 'int *'}} + (void)new float*(ip); // expected-error {{cannot initialize a new value of type 'float *' with an lvalue of type 'int *'}} // Undefined, but clang should reject it directly. (void)new int[-1]; // expected-error {{array size is negative}} (void)new int[*(S*)0]; // expected-error {{array size expression must have integral or enumerated type, not 'struct S'}} diff --git a/test/SemaCXX/overload-call.cpp b/test/SemaCXX/overload-call.cpp index d20bf23..12dc5da 100644 --- a/test/SemaCXX/overload-call.cpp +++ b/test/SemaCXX/overload-call.cpp @@ -333,3 +333,17 @@ namespace test2 { inline bool operator!=(const qrgb666 &v) const { return !(*this == v); } }; } + +// PR 6117 +namespace test3 { + struct Base {}; + struct Incomplete; + + void foo(Base *); // expected-note 2 {{cannot convert argument of incomplete type}} + void foo(Base &); // expected-note 2 {{cannot convert argument of incomplete type}} + + void test(Incomplete *P) { + foo(P); // expected-error {{no matching function for call to 'foo'}} + foo(*P); // expected-error {{no matching function for call to 'foo'}} + } +} diff --git a/test/SemaCXX/unused.cpp b/test/SemaCXX/unused.cpp index 6fd1081..88783ce 100644 --- a/test/SemaCXX/unused.cpp +++ b/test/SemaCXX/unused.cpp @@ -13,3 +13,12 @@ APSInt& APSInt::operator=(const APSInt &RHS) { APInt::operator=(RHS); return *this; } + +template<typename T> +struct X { + X(); +}; + +void test() { + X<int>(); +} diff --git a/test/SemaCXX/virtual-override.cpp b/test/SemaCXX/virtual-override.cpp index 4fdac85..5e1e9b0 100644 --- a/test/SemaCXX/virtual-override.cpp +++ b/test/SemaCXX/virtual-override.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -faccess-control -verify %s +// RUN: %clang_cc1 -fsyntax-only -faccess-control -verify %s -std=c++0x namespace T1 { class A { @@ -197,3 +197,59 @@ namespace PR5920 { virtual Derived<int>* Method(); }; } + +// Look through template types and typedefs to see whether return types are +// pointers or references. +namespace PR6110 { + class Base {}; + class Derived : public Base {}; + + typedef Base* BaseP; + typedef Derived* DerivedP; + + class X { virtual BaseP f(); }; + class X1 : public X { virtual DerivedP f(); }; + + template <typename T> class Y { virtual T f(); }; + template <typename T1, typename T> class Y1 : public Y<T> { virtual T1 f(); }; + Y1<Derived*, Base*> y; +} + +namespace T10 { + struct A { }; + struct B : A { }; + + struct C { + virtual A&& f(); + }; + + struct D : C { + virtual B&& f(); + }; +}; + +namespace T11 { + struct A { }; + struct B : A { }; + + struct C { + virtual A& f(); // expected-note {{overridden virtual function is here}} + }; + + struct D : C { + virtual B&& f(); // expected-error {{virtual function 'f' has a different return type ('struct T11::B &&') than the function it overrides (which has return type 'struct T11::A &')}} + }; +}; + +namespace T12 { + struct A { }; + struct B : A { }; + + struct C { + virtual A&& f(); // expected-note {{overridden virtual function is here}} + }; + + struct D : C { + virtual B& f(); // expected-error {{virtual function 'f' has a different return type ('struct T12::B &') than the function it overrides (which has return type 'struct T12::A &&')}} + }; +}; diff --git a/test/SemaCXX/warn-unreachable.cpp b/test/SemaCXX/warn-unreachable.cpp new file mode 100644 index 0000000..a7ed91d --- /dev/null +++ b/test/SemaCXX/warn-unreachable.cpp @@ -0,0 +1,76 @@ +// RUN: %clang %s -fsyntax-only -Xclang -verify -fblocks -Wunreachable-code -Wno-unused-value + +int &halt() __attribute__((noreturn)); +int &live(); +int dead(); +int liveti() throw(int); +int (*livetip)() throw(int); + +int test1() { + try { + live(); + } catch (int i) { + live(); + } + return 1; +} + +void test2() { + try { + live(); + } catch (int i) { + live(); + } + try { + liveti(); + } catch (int i) { + live(); + } + try { + livetip(); + } catch (int i) { + live(); + } + throw 1; + dead(); // expected-warning {{will never be executed}} +} + + +void test3() { + halt() + --; // expected-warning {{will never be executed}} + halt() + ? // expected-warning {{will never be executed}} + dead() : dead(); + live(), + float // expected-warning {{will never be executed}} + (halt()); +} + +void test4() { + struct S { + int mem; + } s; + S &foor(); + halt(), foor() + .mem; // expected-warning {{will never be executed}} +} + +void test5() { + struct S { + int mem; + } s; + S &foor() __attribute__((noreturn)); + foor() + .mem; // expected-warning {{will never be executed}} +} + +void test6() { + struct S { + ~S() { } + S(int i) { } + }; + live(), + S // expected-warning {{will never be executed}} + (halt()); +} diff --git a/test/SemaObjC/method-unused-attribute.m b/test/SemaObjC/method-unused-attribute.m new file mode 100644 index 0000000..a4e5321 --- /dev/null +++ b/test/SemaObjC/method-unused-attribute.m @@ -0,0 +1,15 @@ +// RUN: %clang_cc1 -fsyntax-only -Wunused-parameter -verify %s + +@interface INTF +- (void) correct_use_of_unused: (void *) notice : (id)another_arg; +- (void) will_warn_unused_arg: (void *) notice : (id)warn_unused; +- (void) unused_attr_on_decl_ignored: (void *) __attribute__((unused)) will_warn; +@end + +@implementation INTF +- (void) correct_use_of_unused: (void *) __attribute__((unused)) notice : (id) __attribute__((unused)) newarg{ +} +- (void) will_warn_unused_arg: (void *) __attribute__((unused)) notice : (id)warn_unused {} // expected-warning {{unused parameter 'warn_unused'}} +- (void) unused_attr_on_decl_ignored: (void *) will_warn{} // expected-warning {{unused parameter 'will_warn'}} +@end + diff --git a/test/SemaObjC/property-category-2.m b/test/SemaObjC/property-category-2.m index f258b2c..e63672b 100644 --- a/test/SemaObjC/property-category-2.m +++ b/test/SemaObjC/property-category-2.m @@ -4,7 +4,8 @@ @protocol MyProtocol @property float myFloat; -@property float anotherFloat; +@property float anotherFloat; // expected-warning {{property 'anotherFloat' requires method 'anotherFloat' to be defined - use @dynamic}} \ + // expected-warning {{property 'anotherFloat' requires method 'setAnotherFloat:' to be defined }} @end @interface MyObject { float anotherFloat; } @@ -13,7 +14,7 @@ @interface MyObject (CAT) <MyProtocol> @end -@implementation MyObject (CAT) +@implementation MyObject (CAT) // expected-note 2 {{implementation is here}} @dynamic myFloat; // OK @synthesize anotherFloat; // expected-error {{@synthesize not allowed in a category's implementation}} @end diff --git a/test/SemaObjC/property-category-impl.m b/test/SemaObjC/property-category-impl.m new file mode 100644 index 0000000..9979497 --- /dev/null +++ b/test/SemaObjC/property-category-impl.m @@ -0,0 +1,31 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +/* This test is for categories which don't implement the accessors but some accessors are + implemented in their base class implementation. In this case,no warning must be issued. +*/ + +@interface MyClass +{ + int _foo; +} +@property(readonly) int foo; +@end + +@implementation MyClass +- (int) foo { return _foo; } +@end + +@interface MyClass (private) +@property(readwrite) int foo; +@end + +@implementation MyClass (private) +- (void) setFoo:(int)foo { _foo = foo; } +@end + +@interface MyClass (public) +@property(readwrite) int foo; // expected-warning {{property 'foo' requires method 'setFoo:' to be defined }} +@end + +@implementation MyClass (public)// expected-note {{implementation is here}} +@end diff --git a/test/SemaObjC/property-user-setter.m b/test/SemaObjC/property-user-setter.m index c06f2b6..babccee 100644 --- a/test/SemaObjC/property-user-setter.m +++ b/test/SemaObjC/property-user-setter.m @@ -80,11 +80,24 @@ static int g_val; } @end +@interface C {} +// - (int)Foo; +- (void)setFoo:(int)value; +@end + +void g(int); + +void f(C *c) { + c.Foo = 17; // expected-error {{property 'Foo' not found on object of type 'C *'}} + g(c.Foo); // expected-error {{property 'Foo' not found on object of type 'C *'}} +} + + void abort(void); int main (void) { Subclass *x = [[Subclass alloc] init]; - x.setterOnly = 4; + x.setterOnly = 4; // expected-error {{property 'setterOnly' not found on object of type 'Subclass *'}} if (g_val != 4) abort (); return 0; diff --git a/test/SemaObjC/property.m b/test/SemaObjC/property.m index bc2056c..b7f0fca 100644 --- a/test/SemaObjC/property.m +++ b/test/SemaObjC/property.m @@ -11,7 +11,8 @@ @end @interface I(CAT) -@property int d1; +@property int d1; // expected-warning {{property 'd1' requires method 'd1' to be defined }} \ + // expected-warning {{property 'd1' requires method 'setD1:' to be defined }} @end @implementation I @@ -22,7 +23,7 @@ @synthesize name; // OK! property with same name as an accessible ivar of same name @end -@implementation I(CAT) +@implementation I(CAT) // expected-note 2 {{implementation is here}} @synthesize d1; // expected-error {{@synthesize not allowed in a category's implementation}} @dynamic bad; // expected-error {{property implementation must have its declaration in the category 'CAT'}} @end diff --git a/test/SemaObjC/super.m b/test/SemaObjC/super.m index 3b86972..a61d72f 100644 --- a/test/SemaObjC/super.m +++ b/test/SemaObjC/super.m @@ -39,3 +39,10 @@ void f0(int super) { void f1(int puper) { [super m]; // expected-error{{use of undeclared identifier 'super'}} } + +// radar 7400691 +typedef Foo super; + +void test() { + [super cMethod]; +} diff --git a/test/SemaObjC/unimplemented-protocol-prop.m b/test/SemaObjC/unimplemented-protocol-prop.m new file mode 100644 index 0000000..d3de50e --- /dev/null +++ b/test/SemaObjC/unimplemented-protocol-prop.m @@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +@protocol PROTOCOL0 +@required +@property float MyProperty0; // expected-warning {{property 'MyProperty0' requires method 'MyProperty0' to be defined }} \ + // expected-warning {{property 'MyProperty0' requires method 'setMyProperty0:' to be defined}} +@end + +@protocol PROTOCOL<PROTOCOL0> +@required +@property float MyProperty; // expected-warning {{property 'MyProperty' requires method 'MyProperty' to be defined}} \ + // expected-warning {{property 'MyProperty' requires method 'setMyProperty:' to be defined}} +@optional +@property float OptMyProperty; +@end + +@interface I <PROTOCOL> +@end + +@implementation I @end // expected-note 4 {{implementation is here}} diff --git a/test/SemaObjCXX/cstyle-block-pointer-cast.mm b/test/SemaObjCXX/cstyle-block-pointer-cast.mm new file mode 100644 index 0000000..72f5283 --- /dev/null +++ b/test/SemaObjCXX/cstyle-block-pointer-cast.mm @@ -0,0 +1,42 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -fblocks %s +// radar 7562285 + +typedef int (^blocktype)(int a, int b); + +@interface A { + A* a; + id b; + Class c; +} +- (blocktype)Meth; +@end + +@implementation A +- (blocktype)Meth { + if (b) + return (blocktype)b; + else if (a) + return (blocktype)a; // expected-error {{C-style cast from 'A *' to 'blocktype' (aka 'int (^)(int, int)') is not allowed}} + else + return (blocktype)c; +} +@end + +@interface B { + blocktype a; + blocktype b; + blocktype c; +} +- (id)Meth; +@end + +@implementation B +- (id)Meth { + if (a) + return (A*)a; // expected-error {{C-style cast from 'blocktype' (aka 'int (^)(int, int)') to 'A *' is not allowed}} + if (b) + return (id)b; + if (c) + return (Class)b; +} +@end diff --git a/test/SemaObjCXX/pointer-to-objc-pointer-conv.mm b/test/SemaObjCXX/pointer-to-objc-pointer-conv.mm new file mode 100644 index 0000000..80383eb --- /dev/null +++ b/test/SemaObjCXX/pointer-to-objc-pointer-conv.mm @@ -0,0 +1,21 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +@interface G +@end + +@interface F +- (void)bar:(id *)objects; +- (void)foo:(G**)objects; +@end + + +void a() { + F *b; + G **keys; + [b bar:keys]; + + id *PID; + [b foo:PID]; + +} + diff --git a/test/SemaTemplate/dependent-base-classes.cpp b/test/SemaTemplate/dependent-base-classes.cpp index 79b28c2..80d20b0 100644 --- a/test/SemaTemplate/dependent-base-classes.cpp +++ b/test/SemaTemplate/dependent-base-classes.cpp @@ -82,3 +82,31 @@ namespace Ambig { Derived<int> di; // expected-note{{instantiation of}} } + +namespace PR6081 { + template<typename T> + struct A { }; + + template<typename T> + class B : public A<T> + { + public: + template< class X > + void f0(const X & k) + { + this->template f1<int>()(k); + } + }; + + template<typename T> + class C + { + public: + template< class X > + void f0(const X & k) + { + this->template f1<int>()(k); // expected-error{{'f1' following the 'template' keyword does not refer to a template}} \ + // FIXME: expected-error{{unqualified-id}} + } + }; +} diff --git a/test/SemaTemplate/dependent-base-member-init.cpp b/test/SemaTemplate/dependent-base-member-init.cpp index c9823d2..1f13149 100644 --- a/test/SemaTemplate/dependent-base-member-init.cpp +++ b/test/SemaTemplate/dependent-base-member-init.cpp @@ -34,3 +34,26 @@ template<typename T> struct s1 : s0<typename s0_traits<T>::t0> { s1() {} }; +// PR6062 +namespace PR6062 { + template <typename T> + class A : public T::type + { + A() : T::type() + { + } + + template <typename U> + A(U const& init) + : T::type(init) + { } + + template<typename U> + A(U& init) : U::other_type(init) { } + }; +} + +template<typename T, typename U> +struct X0 : T::template apply<U> { + X0(int i) : T::template apply<U>(i) { } +}; diff --git a/test/SemaTemplate/dependent-expr.cpp b/test/SemaTemplate/dependent-expr.cpp index 412a811..3f481b5 100644 --- a/test/SemaTemplate/dependent-expr.cpp +++ b/test/SemaTemplate/dependent-expr.cpp @@ -5,3 +5,22 @@ template <typename Iterator> void Test(Iterator it) { *(it += 1); } + +namespace PR6045 { + template<unsigned int r> + class A + { + static const unsigned int member = r; + void f(); + }; + + template<unsigned int r> + const unsigned int A<r>::member; + + template<unsigned int r> + void A<r>::f() + { + unsigned k; + (void)(k % member); + } +} diff --git a/test/SemaTemplate/friend-template.cpp b/test/SemaTemplate/friend-template.cpp index 05289b1..8bc2631 100644 --- a/test/SemaTemplate/friend-template.cpp +++ b/test/SemaTemplate/friend-template.cpp @@ -1,5 +1,4 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s - // PR5057 namespace test0 { namespace std { @@ -107,3 +106,20 @@ namespace test5 { template <typename T> friend struct cache; }; } + +// PR6022 +namespace PR6022 { + template <class T1, class T2 , class T3 > class A; + + namespace inner { + template<class T1, class T2, class T3, class T> + A<T1, T2, T3>& f0(A<T1, T2, T3>&, T); + } + + template<class T1, class T2, class T3> + class A { + template<class U1, class U2, class U3, class T> + friend A<U1, U2, U3>& inner::f0(A<U1, U2, U3>&, T); + }; +} + diff --git a/test/SemaTemplate/instantiate-local-class.cpp b/test/SemaTemplate/instantiate-local-class.cpp new file mode 100644 index 0000000..768eb21 --- /dev/null +++ b/test/SemaTemplate/instantiate-local-class.cpp @@ -0,0 +1,34 @@ +// RUN: %clang_cc1 -verify %s +template<typename T> +void f0() { + struct X; + typedef struct Y { + T (X::* f1())(int) { return 0; } + } Y2; + + Y2 y = Y(); +} + +template void f0<int>(); + +// PR5764 +namespace PR5764 { + class X { + template <typename T> + void Bar() { + typedef T ValueType; + class Y { + Y() { V = ValueType(); } + + ValueType V; + }; + + Y y; + } + }; + + void test(X x) { + x.Bar<int>(); + } +} + diff --git a/test/SemaTemplate/member-template-access-expr.cpp b/test/SemaTemplate/member-template-access-expr.cpp index 9edefe8..ea17cdb 100644 --- a/test/SemaTemplate/member-template-access-expr.cpp +++ b/test/SemaTemplate/member-template-access-expr.cpp @@ -103,3 +103,23 @@ struct X5 { this->f<T*>(); } }; + +namespace PR6021 { + template< class T1, class T2 > + class Outer + { + public: // Range operations + template< class X > X tmpl( const X* = 0 ) const; + + struct Inner + { + const Outer& o; + + template< class X > + operator X() const + { + return o.tmpl<X>(); + } + }; + }; +} |