2 // The LLVM Compiler Infrastructure
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
11 // Created by Blaine Garst on 9/24/08.
14 #import <Cocoa/Cocoa.h>
18 four source types: C, ObjC, C++, ObjC++,
19 and for ObjC or ObjC++ we have
20 RR and GC capabilities
21 we assume C++ friendly includes for C/ObjC even if C++ isn't used
24 four compilers: C, ObjC, C++, ObjC++
25 and for ObjC or ObjC++ we can compile
27 although to test RR+GC we need to build a shell "main" in both modes
28 and/or run with GC disabled if possible.
30 To maximize coverage we mark files with capabilities and then ask them to be
31 compiled with each variation of compiler and option.
32 If the file doesn't have the capability it politely refuses.
41 DoRRGC
= (1 << 6), // -fobjc-gc but main w/o so it runs in RR mode
42 DoGCRR
= (1 << 7), // -fobjc-gc & run GC mode
49 DoC99
= (1 << 12), // -std=c99
53 @
class TestFileExeGenerator
;
55 // this class will actually compile and/or run a target binary
56 // XXX we don't track which dynamic libraries requested/used nor set them up
57 @interface TestFileExe
: NSObject
{
58 NSPointerArray
*compileLine
;
61 TestFileExeGenerator
*generator
;
62 __strong
char *binaryName
;
63 __strong
char *sourceName
;
64 __strong
char *libraryPath
;
65 __strong
char *frameworkPath
;
67 @property
int options
;
68 @
property(assign
) NSPointerArray
*compileLine
;
69 @
property(assign
) TestFileExeGenerator
*generator
;
70 @property
bool shouldFail
;
71 @property __strong
char *binaryName
;
72 @property __strong
char *sourceName
;
73 @property __strong
char *libraryPath
;
74 @property __strong
char *frameworkPath
;
75 - (bool) compileUnlessExists
:(bool)skip
;
77 @
property(readonly
) __strong
char *radar
;
80 // this class generates an appropriate set of configurations to compile
81 // we don't track which gcc we use but we should XXX
82 @interface TestFileExeGenerator
: NSObject
{
90 bool supposedToNotCompile
;
91 bool open
; // this problem is still open - e.g. unresolved
92 __strong
char *radar
; // for things already known to go wrong
93 __strong
char *filename
;
94 __strong
char *compilerPath
;
95 __strong
char *errorString
;
96 __strong
char *warningString
;
97 NSPointerArray
*extraLibraries
;
99 @property
bool hasObjC
, hasRR
, hasGC
, hasCPlusPlus
, wantsC99
, supposedToNotCompile
, open
, wants32
, wants64
;
100 @
property(assign
) __strong
char *radar
;
101 @property __strong
char *filename
;
102 @property __strong
char *compilerPath
;
103 @property __strong
char *errorString
;
104 @property __strong
char *warningString
;
105 - (TestFileExe
*)lineForOptions
:(int)options
; // nil if no can do
106 + (NSArray
*)generatorsFromFILE
:(FILE *)fd
;
107 + (NSArray
*)generatorsFromPath
:(NSString
*)path
;