[cfe-commits] r163674 - in /cfe/trunk/test/Analysis: Inputs/ Inputs/system-header-simulator-cxx.h Inputs/system-header-simulator-objc.h Inputs/system-header-simulator.h coverage.c global-region-invalidation.c inlining/stl.cpp malloc-interprocedural.c malloc.c malloc.m malloc.mm system-header-simulator-cxx.h system-header-simulator-objc.h system-header-simulator.h

Chandler Carruth chandlerc at gmail.com
Tue Sep 11 18:11:10 PDT 2012


Author: chandlerc
Date: Tue Sep 11 20:11:10 2012
New Revision: 163674

URL: http://llvm.org/viewvc/llvm-project?rev=163674&view=rev
Log:
Adjust some analyzer tests to place widely shared inputs inside of an
'Inputs' subdirectory.

The general desire has been to have essentially all of the non-test
input files live in such directories, with some exceptions for obvious
and common patterns like 'foo.c' using 'foo.h'.

This came up because our distributed test runner couldn't find some of
the headers, for example with stl.cpp.

No functionality changed, just shuffling around here.

Added:
    cfe/trunk/test/Analysis/Inputs/
    cfe/trunk/test/Analysis/Inputs/system-header-simulator-cxx.h
      - copied, changed from r163673, cfe/trunk/test/Analysis/system-header-simulator-cxx.h
    cfe/trunk/test/Analysis/Inputs/system-header-simulator-objc.h
      - copied, changed from r163673, cfe/trunk/test/Analysis/system-header-simulator-objc.h
    cfe/trunk/test/Analysis/Inputs/system-header-simulator.h
      - copied, changed from r163673, cfe/trunk/test/Analysis/system-header-simulator.h
Removed:
    cfe/trunk/test/Analysis/system-header-simulator-cxx.h
    cfe/trunk/test/Analysis/system-header-simulator-objc.h
    cfe/trunk/test/Analysis/system-header-simulator.h
Modified:
    cfe/trunk/test/Analysis/coverage.c
    cfe/trunk/test/Analysis/global-region-invalidation.c
    cfe/trunk/test/Analysis/inlining/stl.cpp
    cfe/trunk/test/Analysis/malloc-interprocedural.c
    cfe/trunk/test/Analysis/malloc.c
    cfe/trunk/test/Analysis/malloc.m
    cfe/trunk/test/Analysis/malloc.mm

Copied: cfe/trunk/test/Analysis/Inputs/system-header-simulator-cxx.h (from r163673, cfe/trunk/test/Analysis/system-header-simulator-cxx.h)
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/Inputs/system-header-simulator-cxx.h?p2=cfe/trunk/test/Analysis/Inputs/system-header-simulator-cxx.h&p1=cfe/trunk/test/Analysis/system-header-simulator-cxx.h&r1=163673&r2=163674&rev=163674&view=diff
==============================================================================
    (empty)

Copied: cfe/trunk/test/Analysis/Inputs/system-header-simulator-objc.h (from r163673, cfe/trunk/test/Analysis/system-header-simulator-objc.h)
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/Inputs/system-header-simulator-objc.h?p2=cfe/trunk/test/Analysis/Inputs/system-header-simulator-objc.h&p1=cfe/trunk/test/Analysis/system-header-simulator-objc.h&r1=163673&r2=163674&rev=163674&view=diff
==============================================================================
    (empty)

Copied: cfe/trunk/test/Analysis/Inputs/system-header-simulator.h (from r163673, cfe/trunk/test/Analysis/system-header-simulator.h)
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/Inputs/system-header-simulator.h?p2=cfe/trunk/test/Analysis/Inputs/system-header-simulator.h&p1=cfe/trunk/test/Analysis/system-header-simulator.h&r1=163673&r2=163674&rev=163674&view=diff
==============================================================================
    (empty)

Modified: cfe/trunk/test/Analysis/coverage.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/coverage.c?rev=163674&r1=163673&r2=163674&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/coverage.c (original)
+++ cfe/trunk/test/Analysis/coverage.c Tue Sep 11 20:11:10 2012
@@ -1,5 +1,5 @@
 // RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc -analyzer-store=region -analyzer-max-loop 4 -verify %s
-#include "system-header-simulator.h"
+#include "Inputs/system-header-simulator.h"
 
 typedef __typeof(sizeof(int)) size_t;
 void *malloc(size_t);

Modified: cfe/trunk/test/Analysis/global-region-invalidation.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/global-region-invalidation.c?rev=163674&r1=163673&r2=163674&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/global-region-invalidation.c (original)
+++ cfe/trunk/test/Analysis/global-region-invalidation.c Tue Sep 11 20:11:10 2012
@@ -3,7 +3,7 @@
 void clang_analyzer_eval(int);
 
 // Note, we do need to include headers here, since the analyzer checks if the function declaration is located in a system header.
-#include "system-header-simulator.h"
+#include "Inputs/system-header-simulator.h"
 
 // Test that system header does not invalidate the internal global.
 int size_rdar9373039 = 1;

Modified: cfe/trunk/test/Analysis/inlining/stl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/inlining/stl.cpp?rev=163674&r1=163673&r2=163674&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/inlining/stl.cpp (original)
+++ cfe/trunk/test/Analysis/inlining/stl.cpp Tue Sep 11 20:11:10 2012
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-ipa=dynamic -analyzer-config c++-stdlib-inlining=false -verify %s
 // RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-ipa=dynamic -analyzer-config c++-stdlib-inlining=true -DINLINE=1 -verify %s
 
-#include "../system-header-simulator-cxx.h"
+#include "../Inputs/system-header-simulator-cxx.h"
 
 void clang_analyzer_eval(bool);
 

Modified: cfe/trunk/test/Analysis/malloc-interprocedural.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/malloc-interprocedural.c?rev=163674&r1=163673&r2=163674&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/malloc-interprocedural.c (original)
+++ cfe/trunk/test/Analysis/malloc-interprocedural.c Tue Sep 11 20:11:10 2012
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 -analyze -analyzer-checker=unix.Malloc -analyzer-inline-max-stack-depth=5 -analyzer-inline-max-function-size=6 -verify %s
 
-#include "system-header-simulator.h"
+#include "Inputs/system-header-simulator.h"
 
 typedef __typeof(sizeof(int)) size_t;
 void *malloc(size_t);

Modified: cfe/trunk/test/Analysis/malloc.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/malloc.c?rev=163674&r1=163673&r2=163674&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/malloc.c (original)
+++ cfe/trunk/test/Analysis/malloc.c Tue Sep 11 20:11:10 2012
@@ -1,5 +1,5 @@
 // RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.deadcode.UnreachableCode,alpha.core.CastSize,unix.Malloc,debug.ExprInspection -analyzer-store=region -verify %s
-#include "system-header-simulator.h"
+#include "Inputs/system-header-simulator.h"
 
 void clang_analyzer_eval(int);
 

Modified: cfe/trunk/test/Analysis/malloc.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/malloc.m?rev=163674&r1=163673&r2=163674&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/malloc.m (original)
+++ cfe/trunk/test/Analysis/malloc.m Tue Sep 11 20:11:10 2012
@@ -1,5 +1,5 @@
 // RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc -analyzer-store=region -verify -Wno-objc-root-class -fblocks %s
-#include "system-header-simulator-objc.h"
+#include "Inputs/system-header-simulator-objc.h"
 
 @class NSString;
 typedef __typeof(sizeof(int)) size_t;

Modified: cfe/trunk/test/Analysis/malloc.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/malloc.mm?rev=163674&r1=163673&r2=163674&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/malloc.mm (original)
+++ cfe/trunk/test/Analysis/malloc.mm Tue Sep 11 20:11:10 2012
@@ -1,5 +1,5 @@
 // RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc -analyzer-store=region -verify -fblocks %s
-#include "system-header-simulator-objc.h"
+#include "Inputs/system-header-simulator-objc.h"
 
 typedef __typeof(sizeof(int)) size_t;
 void *malloc(size_t);
@@ -221,4 +221,4 @@
 void noCrashOnVariableArgumentSelector() {
   NSMutableString *myString = [NSMutableString stringWithString:@"some text"];
   [myString appendFormat:@"some text = %d", 3];
-}
\ No newline at end of file
+}

Removed: cfe/trunk/test/Analysis/system-header-simulator-cxx.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/system-header-simulator-cxx.h?rev=163673&view=auto
==============================================================================
--- cfe/trunk/test/Analysis/system-header-simulator-cxx.h (original)
+++ cfe/trunk/test/Analysis/system-header-simulator-cxx.h (removed)
@@ -1,57 +0,0 @@
-#pragma clang system_header
-
-namespace std {
-  template <class T1, class T2>
-  struct pair {
-    T1 first;
-    T2 second;
-    
-    pair() : first(), second() {}
-    pair(const T1 &a, const T2 &b) : first(a), second(b) {}
-    
-    template<class U1, class U2>
-    pair(const pair<U1, U2> &other) : first(other.first), second(other.second) {}
-  };
-  
-  typedef __typeof__(sizeof(int)) size_t;
-  
-  template<typename T>
-  class vector {
-    T *_start;
-    T *_finish;
-    T *_end_of_storage;
-  public:
-    vector() : _start(0), _finish(0), _end_of_storage(0) {}
-    ~vector();
-    
-    size_t size() const {
-      return size_t(_finish - _start);
-    }
-    
-    void push_back();
-    T pop_back();
-
-    T &operator[](size_t n) {
-      return _start[n];
-    }
-    
-    const T &operator[](size_t n) const {
-      return _start[n];
-    }
-    
-    T *begin() { return _start; }
-    const T *begin() const { return _start; }
-
-    T *end() { return _finish; }
-    const T *end() const { return _finish; }
-  };
-  
-  class exception {
-  public:
-    exception() throw();
-    virtual ~exception() throw();
-    virtual const char *what() const throw() {
-      return 0;
-    }
-  };
-}

Removed: cfe/trunk/test/Analysis/system-header-simulator-objc.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/system-header-simulator-objc.h?rev=163673&view=auto
==============================================================================
--- cfe/trunk/test/Analysis/system-header-simulator-objc.h (original)
+++ cfe/trunk/test/Analysis/system-header-simulator-objc.h (removed)
@@ -1,130 +0,0 @@
-#pragma clang system_header
-
-typedef unsigned int UInt32;
-typedef unsigned short UInt16;
-
-typedef signed long CFIndex;
-typedef signed char BOOL;
-typedef unsigned long NSUInteger;
-typedef unsigned short unichar;
-typedef UInt16 UniChar;
-
-enum {
-    NSASCIIStringEncoding = 1,
-    NSNEXTSTEPStringEncoding = 2,
-    NSJapaneseEUCStringEncoding = 3,
-    NSUTF8StringEncoding = 4,
-    NSISOLatin1StringEncoding = 5,
-    NSSymbolStringEncoding = 6,
-    NSNonLossyASCIIStringEncoding = 7,
-};
-typedef const struct __CFString * CFStringRef;
-typedef struct __CFString * CFMutableStringRef;
-typedef NSUInteger NSStringEncoding;
-typedef UInt32 CFStringEncoding;
-
-typedef const void * CFTypeRef;
-
-typedef const struct __CFAllocator * CFAllocatorRef;
-extern const CFAllocatorRef kCFAllocatorDefault;
-extern const CFAllocatorRef kCFAllocatorSystemDefault;
-extern const CFAllocatorRef kCFAllocatorMalloc;
-extern const CFAllocatorRef kCFAllocatorMallocZone;
-extern const CFAllocatorRef kCFAllocatorNull;
-
- at class NSString, Protocol;
-extern void NSLog(NSString *format, ...) __attribute__((format(__NSString__, 1, 2)));
-typedef struct _NSZone NSZone;
- at class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
- at protocol NSObject
-- (BOOL)isEqual:(id)object;
-- (id)retain;
-- (id)copy;
-- (oneway void)release;
-- (id)autorelease;
-- (id)init;
- at end  @protocol NSCopying  - (id)copyWithZone:(NSZone *)zone;
- at end  @protocol NSMutableCopying  - (id)mutableCopyWithZone:(NSZone *)zone;
- at end  @protocol NSCoding  - (void)encodeWithCoder:(NSCoder *)aCoder;
- at end
- at interface NSObject <NSObject> {}
-+ (id)allocWithZone:(NSZone *)zone;
-+ (id)alloc;
-- (void)dealloc;
- at end
- at interface NSObject (NSCoderMethods)
-- (id)awakeAfterUsingCoder:(NSCoder *)aDecoder;
- at end
-extern id NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone);
-typedef struct {
-}
-NSFastEnumerationState;
- at protocol NSFastEnumeration  - (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len;
- at end           @class NSString, NSDictionary;
- at interface NSValue : NSObject <NSCopying, NSCoding>  - (void)getValue:(void *)value;
- at end  @interface NSNumber : NSValue  - (char)charValue;
-- (id)initWithInt:(int)value;
- at end   @class NSString;
- at interface NSArray : NSObject <NSCopying, NSMutableCopying, NSCoding, NSFastEnumeration>  - (NSUInteger)count;
- at end  @interface NSArray (NSArrayCreation)  + (id)array;
- at end       @interface NSAutoreleasePool : NSObject {
-}
-- (void)drain;
- at end extern NSString * const NSBundleDidLoadNotification;
-typedef double NSTimeInterval;
- at interface NSDate : NSObject <NSCopying, NSCoding>  - (NSTimeInterval)timeIntervalSinceReferenceDate;
- at end
-
- at interface NSString : NSObject <NSCopying, NSMutableCopying, NSCoding>
-- (NSUInteger)length;
-- (NSString *)stringByAppendingString:(NSString *)aString;
-- ( const char *)UTF8String;
-- (id)initWithUTF8String:(const char *)nullTerminatedCString;
-- (id)initWithCharactersNoCopy:(unichar *)characters length:(NSUInteger)length freeWhenDone:(BOOL)freeBuffer;
-- (id)initWithCharacters:(const unichar *)characters length:(NSUInteger)length;
-- (id)initWithBytes:(const void *)bytes length:(NSUInteger)len encoding:(NSStringEncoding)encoding;
-- (id)initWithBytesNoCopy:(void *)bytes length:(NSUInteger)len encoding:(NSStringEncoding)encoding freeWhenDone:(BOOL)freeBuffer;
-+ (id)stringWithUTF8String:(const char *)nullTerminatedCString;
-+ (id)stringWithString:(NSString *)string;
- at end        @class NSString, NSURL, NSError;
-
- at interface NSMutableString : NSString
-- (void)appendFormat:(NSString *)format, ... __attribute__((format(__NSString__, 1, 2)));
- at end
-
- at interface NSData : NSObject <NSCopying, NSMutableCopying, NSCoding>  - (NSUInteger)length;
-+ (id)dataWithBytesNoCopy:(void *)bytes length:(NSUInteger)length;
-+ (id)dataWithBytesNoCopy:(void *)bytes length:(NSUInteger)length freeWhenDone:(BOOL)b;
-- (id)initWithBytesNoCopy:(void *)bytes length:(NSUInteger)length;
-- (id)initWithBytesNoCopy:(void *)bytes length:(NSUInteger)length freeWhenDone:(BOOL)b;
- at end
-
-typedef struct {
-}
-CFDictionaryKeyCallBacks;
-extern const CFDictionaryKeyCallBacks kCFTypeDictionaryKeyCallBacks;
-typedef struct {
-}
-CFDictionaryValueCallBacks;
-extern const CFDictionaryValueCallBacks kCFTypeDictionaryValueCallBacks;
-typedef const struct __CFDictionary * CFDictionaryRef;
-typedef struct __CFDictionary * CFMutableDictionaryRef;
-extern CFMutableDictionaryRef CFDictionaryCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFDictionaryKeyCallBacks *keyCallBacks, const CFDictionaryValueCallBacks *valueCallBacks);
-void CFDictionarySetValue(CFMutableDictionaryRef, const void *, const void *);
-
-
-extern void CFRelease(CFTypeRef cf);
-
-extern CFMutableStringRef CFStringCreateMutableWithExternalCharactersNoCopy(CFAllocatorRef alloc, UniChar *chars, CFIndex numChars, CFIndex capacity, CFAllocatorRef externalCharactersAllocator);
-extern CFStringRef CFStringCreateWithCStringNoCopy(CFAllocatorRef alloc, const char *cStr, CFStringEncoding encoding, CFAllocatorRef contentsDeallocator);
-extern void CFStringAppend(CFMutableStringRef theString, CFStringRef appendedString);
-
-void SystemHeaderFunctionWithBlockParam(void *, void (^block)(void *), unsigned);
-
- at interface NSPointerArray : NSObject <NSFastEnumeration, NSCopying, NSCoding>
-- (void)addPointer:(void *)pointer;
-- (void)insertPointer:(void *)item atIndex:(NSUInteger)index;
-- (void)replacePointerAtIndex:(NSUInteger)index withPointer:(void *)item;
-- (void *)pointerAtIndex:(NSUInteger)index;
- at end
-

Removed: cfe/trunk/test/Analysis/system-header-simulator.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/system-header-simulator.h?rev=163673&view=auto
==============================================================================
--- cfe/trunk/test/Analysis/system-header-simulator.h (original)
+++ cfe/trunk/test/Analysis/system-header-simulator.h (removed)
@@ -1,62 +0,0 @@
-#pragma clang system_header
-
-typedef struct _FILE FILE;
-extern FILE *stdin;
-extern FILE *stdout;
-extern FILE *stderr;
-// Include a variant of standard streams that occur in the pre-processed file.
-extern FILE *__stdinp;
-extern FILE *__stdoutp;
-extern FILE *__stderrp;
-
-
-int fscanf(FILE *restrict, const char *restrict, ...);
-
-// Note, on some platforms errno macro gets replaced with a function call.
-extern int errno;
-
-unsigned long strlen(const char *);
-
-char *strcpy(char *restrict, const char *restrict);
-
-typedef unsigned long __darwin_pthread_key_t;
-typedef __darwin_pthread_key_t pthread_key_t;
-int pthread_setspecific(pthread_key_t, const void *);
-
-typedef long long __int64_t;
-typedef __int64_t __darwin_off_t;
-typedef __darwin_off_t fpos_t;
-
-void setbuf(FILE * restrict, char * restrict);
-int setvbuf(FILE * restrict, char * restrict, int, size_t);
-
-FILE *funopen(const void *,
-                 int (*)(void *, char *, int),
-                 int (*)(void *, const char *, int),
-                 fpos_t (*)(void *, fpos_t, int),
-                 int (*)(void *));
-
-int sqlite3_bind_text_my(int, const char*, int n, void(*)(void*));
-
-typedef void (*freeCallback) (void*);
-typedef struct {
-  int i;
-  freeCallback fc;
-} StWithCallback;
-
-int dealocateMemWhenDoneByVal(void*, StWithCallback);
-int dealocateMemWhenDoneByRef(StWithCallback*, const void*);
-
-typedef struct CGContext *CGContextRef;
-CGContextRef CGBitmapContextCreate(void *data/*, size_t width, size_t height,
-                                   size_t bitsPerComponent, size_t bytesPerRow,
-                                   CGColorSpaceRef space,
-                                   CGBitmapInfo bitmapInfo*/);
-void *CGBitmapContextGetData(CGContextRef context);
-
-// Include xpc.
-typedef struct _xpc_connection_s * xpc_connection_t;
-typedef void (*xpc_finalizer_t)(void *value);
-void xpc_connection_set_context(xpc_connection_t connection, void *context);
-void xpc_connection_set_finalizer_f(xpc_connection_t connection, xpc_finalizer_t finalizer);
-void xpc_connection_resume(xpc_connection_t connection);





More information about the cfe-commits mailing list