1 // Check miscellaneous Objective-C options.
3 // RUN: %clang -target x86_64-apple-darwin10 -S -### %s \
4 // RUN: -arch x86_64 -fobjc-abi-version=1 2> %t
5 // RUN: FileCheck --check-prefix CHECK-CHECK-X86_64_ABI1 < %t %s
7 // CHECK-CHECK-X86_64_ABI1: "-cc1"
8 // CHECK-CHECK-X86_64_ABI1: -fobjc-runtime=macosx-fragile-10.6.0
9 // CHECK-CHECK-X86_64_ABI1-NOT: -fobjc-dispatch-method
10 // CHECK-CHECK-X86_64_ABI1: darwin-objc-options
12 // RUN: %clang -target x86_64-apple-darwin10 -S -### %s \
13 // RUN: -arch i386 -fobjc-abi-version=2 2> %t
14 // RUN: FileCheck --check-prefix CHECK-CHECK-I386_ABI2 < %t %s
16 // CHECK-CHECK-I386_ABI2: "-cc1"
17 // CHECK-CHECK-I386_ABI2: -fobjc-runtime=macosx-10.6.0
18 // CHECK-CHECK-I386_ABI2: -fobjc-exceptions
19 // CHECK-CHECK-I386_ABI2: -fexceptions
20 // CHECK-CHECK-I386_ABI2-NOT: -fobjc-dispatch-method
21 // CHECK-CHECK-I386_ABI2: darwin-objc-options
23 // RUN: %clang -target x86_64-apple-darwin10 -S -### %s \
24 // RUN: -arch i386 -fobjc-runtime=ios-5.0 2> %t
25 // RUN: FileCheck --check-prefix CHECK-CHECK-I386_IOS < %t %s
27 // CHECK-CHECK-I386_IOS: "-cc1"
28 // CHECK-CHECK-I386_IOS: -fobjc-runtime=ios-5.0
29 // CHECK-CHECK-I386_IOS: -fobjc-exceptions
30 // CHECK-CHECK-I386_IOS: -fexceptions
31 // CHECK-CHECK-I386_IOS-NOT: -fobjc-dispatch-method
32 // CHECK-CHECK-I386_IOS: darwin-objc-options
34 /// Don't add -fobjc-runtime for non-ObjC input.
36 // RUN: %clang -target x86_64-apple-darwin -x objective-c -S -### %t.c 2>&1 | FileCheck --check-prefix=F %s
37 // RUN: %clang -target x86_64-apple-darwin -S -### %t.c 2>&1 | FileCheck --check-prefix=NO_F %s
39 // NO_F-NOT: -fobjc-runtime=
41 // Don't crash with an unexpected target triple.
42 // RUN: %clang -target i386-apple-ios7 -S -### %s
44 // Add -fcompatibility-qualified-id-block-type-checking only on Darwin.
45 // RUN: %clang -target x86_64-apple-darwin10 -### %s 2>&1 | FileCheck --check-prefix=DARWIN_COMPATIBILITY %s
46 // RUN: %clang -target x86_64-linux-gnu -### %s 2>&1 | FileCheck --check-prefix=OTHER_COMPATIBILITY %s
47 // DARWIN_COMPATIBILITY: -fcompatibility-qualified-id-block-type-checking
48 // OTHER_COMPATIBILITY-NOT: -fcompatibility-qualified-id-block-type-checking
50 // Add -fvisibility-inlines-hidden-static-local-var on Darwin.
51 // RUN: %clang -target x86_64-apple-darwin10 -### %s 2>&1 | FileCheck --check-prefix=DARWIN_INLINES_HIDDEN %s
52 // RUN: %clang -target x86_64-apple-darwin10 -fno-visibility-inlines-hidden-static-local-var -### %s 2>&1 | FileCheck --check-prefix=DARWIN_INLINES_HIDDEN_EXPLICIT_NO %s
53 // RUN: %clang -target x86_64-linux-gnu -### %s 2>&1 | FileCheck --check-prefix=NO_DARWIN_INLINES_HIDDEN %s
54 // DARWIN_INLINES_HIDDEN: -fvisibility-inlines-hidden-static-local-var
55 // DARWIN_INLINES_HIDDEN_EXPLICIT_NO-NOT: -fvisibility-inlines-hidden-static-local-var
56 // DARWIN_INLINES_HIDDEN_EXPLICIT_NO: -fno-visibility-inlines-hidden-static-local-var
57 // NO_DARWIN_INLINES_HIDDEN-NOT: -fvisibility-inlines-hidden-static-local-var