diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-05-04 16:12:48 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-05-04 16:12:48 +0000 |
commit | 8aaf5818a64e9f7687798852af5945b053c68a54 (patch) | |
tree | d6a70c3518b8dea8be7062438d7e8676820ed17f /test/Driver | |
parent | 71438373cd57f0d5d8c93bb5cf690844a0fbc9d0 (diff) | |
download | FreeBSD-src-8aaf5818a64e9f7687798852af5945b053c68a54.zip FreeBSD-src-8aaf5818a64e9f7687798852af5945b053c68a54.tar.gz |
Update clang to r103004.
Diffstat (limited to 'test/Driver')
-rw-r--r-- | test/Driver/darwin-ld.c | 2 | ||||
-rw-r--r-- | test/Driver/darwin-objc-defaults.m | 88 | ||||
-rw-r--r-- | test/Driver/darwin-objc-gc.m | 19 | ||||
-rw-r--r-- | test/Driver/darwin-objc-options.m | 19 |
4 files changed, 127 insertions, 1 deletions
diff --git a/test/Driver/darwin-ld.c b/test/Driver/darwin-ld.c index 9ae81f1..76ddaa8 100644 --- a/test/Driver/darwin-ld.c +++ b/test/Driver/darwin-ld.c @@ -33,7 +33,7 @@ // Note that at conception, this exactly matches gcc. // RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -A ARG0 -F ARG1 -L ARG2 -Mach -T ARG4 -X -Z -all_load -allowable_client ARG8 -bind_at_load -compatibility_version ARG11 -current_version ARG12 -d -dead_strip -dylib_file ARG14 -dylinker -dylinker_install_name ARG16 -dynamic -dynamiclib -e ARG19 -exported_symbols_list ARG20 -fexceptions -flat_namespace -fnested-functions -fopenmp -force_cpusubtype_ALL -fpie -fprofile-arcs -headerpad_max_install_names -image_base ARG29 -init ARG30 -install_name ARG31 -m ARG33 -miphoneos-version-min=2.0 -mmacosx-version-min=10.3.2 -multi_module -multiply_defined ARG37 -multiply_defined_unused ARG38 -no_dead_strip_inits_and_terms -nodefaultlibs -nofixprebinding -nomultidefs -noprebind -noseglinkedit -nostartfiles -nostdlib -pagezero_size ARG54 -pg -prebind -prebind_all_twolevel_modules -preload -r -read_only_relocs ARG55 -s -sectalign ARG57_0 ARG57_1 ARG57_2 -sectcreate ARG58_0 ARG58_1 ARG58_2 -sectobjectsymbols ARG59_0 ARG59_1 -sectorder ARG60_0 ARG60_1 ARG60_2 -seg1addr ARG61 -seg_addr_table ARG62 -seg_addr_table_filename ARG63 -segaddr ARG64_0 ARG64_1 -segcreate ARG65_0 ARG65_1 ARG65_2 -seglinkedit -segprot ARG67_0 ARG67_1 ARG67_2 -segs_read_FOO -segs_read_only_addr ARG69 -segs_read_write_addr ARG70 -shared-libgcc -single_module -static -static-libgcc -sub_library ARG77 -sub_umbrella ARG78 -t -twolevel_namespace -twolevel_namespace_hints -u ARG82 -umbrella ARG83 -undefined ARG84 -unexported_symbols_list ARG85 -w -weak_reference_mismatches ARG87 -whatsloaded -whyload -y -filelist FOO -l FOO 2> %t.log -// RUN: grep '".*ld.*" "-static" "-dylib" "-dylib_compatibility_version" "ARG11" "-dylib_current_version" "ARG12" "-arch" "i386" "-dylib_install_name" "ARG31" "-all_load" "-allowable_client" "ARG8" "-bind_at_load" "-dead_strip" "-no_dead_strip_inits_and_terms" "-dylib_file" "ARG14" "-dynamic" "-exported_symbols_list" "ARG20" "-flat_namespace" "-headerpad_max_install_names" "-image_base" "ARG29" "-init" "ARG30" "-macosx_version_min" "10.3.2" "-iphoneos_version_min" "2.0" "-nomultidefs" "-multi_module" "-single_module" "-multiply_defined" "ARG37" "-multiply_defined_unused" "ARG38" "-pie" "-prebind" "-noprebind" "-nofixprebinding" "-prebind_all_twolevel_modules" "-read_only_relocs" "ARG55" "-sectcreate" "ARG58_0" "ARG58_1" "ARG58_2" "-sectorder" "ARG60_0" "ARG60_1" "ARG60_2" "-seg1addr" "ARG61" "-segprot" "ARG67_0" "ARG67_1" "ARG67_2" "-segaddr" "ARG64_0" "ARG64_1" "-segs_read_only_addr" "ARG69" "-segs_read_write_addr" "ARG70" "-seg_addr_table" "ARG62" "-seg_addr_table_filename" "ARG63" "-sub_library" "ARG77" "-sub_umbrella" "ARG78" "-twolevel_namespace" "-twolevel_namespace_hints" "-umbrella" "ARG83" "-undefined" "ARG84" "-unexported_symbols_list" "ARG85" "-weak_reference_mismatches" "ARG87" "-X" "-y" "-w" "-pagezero_size" "ARG54" "-segs_read_FOO" "-seglinkedit" "-noseglinkedit" "-sectalign" "ARG57_0" "ARG57_1" "ARG57_2" "-sectobjectsymbols" "ARG59_0" "ARG59_1" "-segcreate" "ARG65_0" "ARG65_1" "ARG65_2" "-whyload" "-whatsloaded" "-dylinker_install_name" "ARG16" "-dylinker" "-Mach" "-d" "-s" "-t" "-Z" "-u" "ARG82" "-undefined" "ARG84" "-A" "ARG0" "-e" "ARG19" "-m" "ARG33" "-r" "-o" "a.out" "-L" "ARG2" "-lgomp" "-L/usr/lib/i686-apple-darwin.*/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin.*/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin.*/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin.*/4.2.1/../../../i686-apple-darwin.*/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin.*/4.2.1/../../.." "-filelist" "FOO" "-lFOO" "-lgcov" "-allow_stack_execute" "-T" "ARG4" "-F" "ARG1"' %t.log +// RUN: grep '".*ld.*" "-static" "-dylib" "-dylib_compatibility_version" "ARG11" "-dylib_current_version" "ARG12" "-arch" "i386" "-dylib_install_name" "ARG31" "-all_load" "-allowable_client" "ARG8" "-bind_at_load" "-dead_strip" "-no_dead_strip_inits_and_terms" "-dylib_file" "ARG14" "-dynamic" "-exported_symbols_list" "ARG20" "-flat_namespace" "-headerpad_max_install_names" "-image_base" "ARG29" "-init" "ARG30" "-macosx_version_min" "10.3.2" "-iphoneos_version_min" "2.0" "-nomultidefs" "-multi_module" "-single_module" "-multiply_defined" "ARG37" "-multiply_defined_unused" "ARG38" "-pie" "-prebind" "-noprebind" "-nofixprebinding" "-prebind_all_twolevel_modules" "-read_only_relocs" "ARG55" "-sectcreate" "ARG58_0" "ARG58_1" "ARG58_2" "-sectorder" "ARG60_0" "ARG60_1" "ARG60_2" "-seg1addr" "ARG61" "-segprot" "ARG67_0" "ARG67_1" "ARG67_2" "-segaddr" "ARG64_0" "ARG64_1" "-segs_read_only_addr" "ARG69" "-segs_read_write_addr" "ARG70" "-seg_addr_table" "ARG62" "-seg_addr_table_filename" "ARG63" "-sub_library" "ARG77" "-sub_umbrella" "ARG78" "-twolevel_namespace" "-twolevel_namespace_hints" "-umbrella" "ARG83" "-undefined" "ARG84" "-unexported_symbols_list" "ARG85" "-weak_reference_mismatches" "ARG87" "-X" "-y" "-w" "-pagezero_size" "ARG54" "-segs_read_FOO" "-seglinkedit" "-noseglinkedit" "-sectalign" "ARG57_0" "ARG57_1" "ARG57_2" "-sectobjectsymbols" "ARG59_0" "ARG59_1" "-segcreate" "ARG65_0" "ARG65_1" "ARG65_2" "-whyload" "-whatsloaded" "-dylinker_install_name" "ARG16" "-dylinker" "-Mach" "-d" "-s" "-t" "-Z" "-u" "ARG82" "-undefined" "ARG84" "-A" "ARG0" "-e" "ARG19" "-m" "ARG33" "-r" "-o" "a.out" "-L" "ARG2" "-lgomp".* "-filelist" "FOO" "-lFOO" "-lgcov" "-allow_stack_execute" "-T" "ARG4" "-F" "ARG1"' %t.log // Don't run dsymutil on a fat build of an executable. // RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -arch i386 -arch x86_64 -g %s 2> %t.log diff --git a/test/Driver/darwin-objc-defaults.m b/test/Driver/darwin-objc-defaults.m new file mode 100644 index 0000000..4cf83a1 --- /dev/null +++ b/test/Driver/darwin-objc-defaults.m @@ -0,0 +1,88 @@ +// Check non-fragile ABI and dispatch method defaults. + +// i386 + +// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \ +// RUN: -arch i386 -mmacosx-version-min=10.5 2> %t +// RUN: FileCheck --check-prefix CHECK-I386_OSX10_5 < %t %s + +// CHECK-CHECK-I386_OSX10_5: "-cc1" +// CHECK-CHECK-I386_OSX10_5-NOT: -fobjc-nonfragile-abi +// CHECK-CHECK-I386_OSX10_5-NOT: -fobjc-dispatch-method +// CHECK-CHECK-I386_OSX10_5: darwin-objc-defaults + +// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \ +// RUN: -arch i386 -mmacosx-version-min=10.6 2> %t +// RUN: FileCheck --check-prefix CHECK-I386_OSX10_6 < %t %s + +// CHECK-CHECK-I386_OSX10_6: "-cc1" +// CHECK-CHECK-I386_OSX10_6-NOT: -fobjc-nonfragile-abi +// CHECK-CHECK-I386_OSX10_6-NOT: -fobjc-dispatch-method +// CHECK-CHECK-I386_OSX10_6: darwin-objc-defaults + +// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \ +// RUN: -arch i386 -miphoneos-version-min=3.0 2> %t +// RUN: FileCheck --check-prefix CHECK-I386_IPHONE3_0 < %t %s + +// CHECK-CHECK-I386_IPHONE3_0: "-cc1" +// CHECK-CHECK-I386_IPHONE3_0-NOT: -fobjc-nonfragile-abi +// CHECK-CHECK-I386_IPHONE3_0-NOT: -fobjc-dispatch-method +// CHECK-CHECK-I386_IPHONE3_0: darwin-objc-defaults + +// x86_64 + +// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \ +// RUN: -arch x86_64 -mmacosx-version-min=10.5 2> %t +// RUN: FileCheck --check-prefix CHECK-X86_64_OSX10_5 < %t %s + +// CHECK-CHECK-X86_64_OSX10_5: "-cc1" +// CHECK-CHECK-X86_64_OSX10_5: -fobjc-nonfragile-abi +// CHECK-CHECK-X86_64_OSX10_5: -fobjc-dispatch-method=non-legacy +// CHECK-CHECK-X86_64_OSX10_5: darwin-objc-defaults + +// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \ +// RUN: -arch x86_64 -mmacosx-version-min=10.6 2> %t +// RUN: FileCheck --check-prefix CHECK-X86_64_OSX10_6 < %t %s + +// CHECK-CHECK-X86_64_OSX10_6: "-cc1" +// CHECK-CHECK-X86_64_OSX10_6: -fobjc-nonfragile-abi +// CHECK-CHECK-X86_64_OSX10_6: -fobjc-dispatch-method=mixed +// CHECK-CHECK-X86_64_OSX10_6: darwin-objc-defaults + +// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \ +// RUN: -arch x86_64 -miphoneos-version-min=3.0 2> %t +// RUN: FileCheck --check-prefix CHECK-X86_64_IPHONE3_0 < %t %s + +// CHECK-CHECK-X86_64_IPHONE3_0: "-cc1" +// CHECK-CHECK-X86_64_IPHONE3_0: -fobjc-nonfragile-abi +// CHECK-CHECK-X86_64_IPHONE3_0: -fobjc-dispatch-method=mixed +// CHECK-CHECK-X86_64_IPHONE3_0: darwin-objc-defaults + +// armv7 + +// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \ +// RUN: -arch armv7 -mmacosx-version-min=10.5 2> %t +// RUN: FileCheck --check-prefix CHECK-ARMV7_OSX10_5 < %t %s + +// CHECK-CHECK-ARMV7_OSX10_5: "-cc1" +// CHECK-CHECK-ARMV7_OSX10_5: -fobjc-nonfragile-abi +// CHECK-CHECK-ARMV7_OSX10_5-NOT: -fobjc-dispatch-method +// CHECK-CHECK-ARMV7_OSX10_5: darwin-objc-defaults + +// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \ +// RUN: -arch armv7 -mmacosx-version-min=10.6 2> %t +// RUN: FileCheck --check-prefix CHECK-ARMV7_OSX10_6 < %t %s + +// CHECK-CHECK-ARMV7_OSX10_6: "-cc1" +// CHECK-CHECK-ARMV7_OSX10_6: -fobjc-nonfragile-abi +// CHECK-CHECK-ARMV7_OSX10_6-NOT: -fobjc-dispatch-method +// CHECK-CHECK-ARMV7_OSX10_6: darwin-objc-defaults + +// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \ +// RUN: -arch armv7 -miphoneos-version-min=3.0 2> %t +// RUN: FileCheck --check-prefix CHECK-ARMV7_IPHONE3_0 < %t %s + +// CHECK-CHECK-ARMV7_IPHONE3_0: "-cc1" +// CHECK-CHECK-ARMV7_IPHONE3_0: -fobjc-nonfragile-abi +// CHECK-CHECK-ARMV7_IPHONE3_0-NOT: -fobjc-dispatch-method +// CHECK-CHECK-ARMV7_IPHONE3_0: darwin-objc-defaults diff --git a/test/Driver/darwin-objc-gc.m b/test/Driver/darwin-objc-gc.m new file mode 100644 index 0000000..aecb9a6 --- /dev/null +++ b/test/Driver/darwin-objc-gc.m @@ -0,0 +1,19 @@ +// Check that we warn, but accept, -fobjc-gc for iPhone OS. + +// RUN: %clang -ccc-host-triple i386-apple-darwin9 -miphoneos-version-min=3.0 -fobjc-gc -flto -S -o %t %s 2> %t.err +// RUN: FileCheck --check-prefix=IPHONE_OBJC_GC_LL %s < %t +// RUN: FileCheck --check-prefix=IPHONE_OBJC_GC_STDERR %s < %t.err + +// IPHONE_OBJC_GC_LL: define void @f0 +// IPHONE_OBJC_GC_LL-NOT: objc_assign_ivar +// IPHONE_OBJC_GC_LL: } + +// IPHONE_OBJC_GC_STDERR: warning: Objective-C garbage collection is not supported on this platform, ignoring '-fobjc-gc' + +@interface A { +@public + id x; +} +@end + +void f0(A *a, id x) { a->x = x; } diff --git a/test/Driver/darwin-objc-options.m b/test/Driver/darwin-objc-options.m new file mode 100644 index 0000000..bc0b12c --- /dev/null +++ b/test/Driver/darwin-objc-options.m @@ -0,0 +1,19 @@ +// Check miscellaneous Objective-C options. + +// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \ +// RUN: -arch x86_64 -fobjc-abi-version=1 2> %t +// RUN: FileCheck --check-prefix CHECK-X86_64_ABI1 < %t %s + +// CHECK-CHECK-X86_64_ABI1: "-cc1" +// CHECK-CHECK-X86_64_ABI1-NOT: -fobjc-nonfragile-abi +// CHECK-CHECK-X86_64_ABI1-NOT: -fobjc-dispatch-method +// CHECK-CHECK-X86_64_ABI1: darwin-objc-options + +// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \ +// RUN: -arch i386 -fobjc-abi-version=2 2> %t +// RUN: FileCheck --check-prefix CHECK-I386_ABI2 < %t %s + +// CHECK-CHECK-I386_ABI2: "-cc1" +// CHECK-CHECK-I386_ABI2: -fobjc-nonfragile-abi +// CHECK-CHECK-I386_ABI2-NOT: -fobjc-dispatch-method +// CHECK-CHECK-I386_ABI2: darwin-objc-options |