diff options
Diffstat (limited to 'test/Driver')
-rw-r--r-- | test/Driver/arc-exceptions.m | 5 | ||||
-rw-r--r-- | test/Driver/arc.c | 14 | ||||
-rw-r--r-- | test/Driver/darwin-ld.c | 20 | ||||
-rw-r--r-- | test/Driver/darwin-objc-options.m | 2 | ||||
-rw-r--r-- | test/Driver/darwin-xarch.c | 6 | ||||
-rw-r--r-- | test/Driver/gnu-runtime.m | 5 | ||||
-rw-r--r-- | test/Driver/ios-simulator-arcruntime.c | 6 | ||||
-rw-r--r-- | test/Driver/mg.c | 5 | ||||
-rw-r--r-- | test/Driver/no-objc-arr.m | 8 | ||||
-rw-r--r-- | test/Driver/noexecstack.c | 1 | ||||
-rw-r--r-- | test/Driver/rewrite-objc.m | 2 | ||||
-rw-r--r-- | test/Driver/sysroot.c | 6 | ||||
-rw-r--r-- | test/Driver/x86_features.c | 4 |
13 files changed, 76 insertions, 8 deletions
diff --git a/test/Driver/arc-exceptions.m b/test/Driver/arc-exceptions.m new file mode 100644 index 0000000..4501ccd --- /dev/null +++ b/test/Driver/arc-exceptions.m @@ -0,0 +1,5 @@ +// RUN: %clang -### -x objective-c -arch x86_64 -fobjc-arc -fsyntax-only %s 2> %t.log +// RUN: grep objective-c %t.log +// RUN: not grep "fobjc-arc-exceptions" %t.log +// RUN: %clang -### -x objective-c++ -arch x86_64 -fobjc-arc -fsyntax-only %s 2> %t.log +// RUN: grep "fobjc-arc-exceptions" %t.log diff --git a/test/Driver/arc.c b/test/Driver/arc.c new file mode 100644 index 0000000..a4d4ed1 --- /dev/null +++ b/test/Driver/arc.c @@ -0,0 +1,14 @@ +// RUN: %clang -ObjC -ccc-host-triple i386-apple-darwin9 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s +// RUN: %clang -x objective-c -ccc-host-triple i386-apple-darwin9 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s +// RUN: %clang -x objective-c++ -ccc-host-triple i386-apple-darwin9 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s +// RUN: %clang -x c -ccc-host-triple i386-apple-darwin9 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck -check-prefix NOTOBJC %s +// RUN: %clang -x c++ -ccc-host-triple i386-apple-darwin9 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck -check-prefix NOTOBJC %s + +// Just to test clang is working. +# foo + +// CHECK: error: -fobjc-arc is not supported with fragile abi +// CHECK-NOT: invalid preprocessing directive + +// NOTOBJC-NOT: error: -fobjc-arc is not supported with fragile abi +// NOTOBJC: invalid preprocessing directive diff --git a/test/Driver/darwin-ld.c b/test/Driver/darwin-ld.c index 91d47ea..33b4858 100644 --- a/test/Driver/darwin-ld.c +++ b/test/Driver/darwin-ld.c @@ -18,9 +18,9 @@ // // 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 -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: %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 -force_load ARG28 -fpie -fprofile-arcs -headerpad_max_install_names -image_base ARG29 -init ARG30 -install_name ARG31 -m ARG33 -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: FileCheck -check-prefix=SPLATTER %s < %t.log -// SPLATTER: {{".*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" "-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" "-LARG2" "-lgomp".* "-filelist" "FOO" "-lFOO" "-allow_stack_execute" ".*/libprofile_rt.a" "-T" "ARG4" "-FARG1"}} +// SPLATTER: {{".*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" "-force_load" "ARG28" "-headerpad_max_install_names" "-image_base" "ARG29" "-init" "ARG30" "-macosx_version_min" "10.3.2" "-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" "-LARG2" "-lgomp".* "-filelist" "FOO" "-lFOO" "-allow_stack_execute" ".*/libprofile_rt.*" "-T" "ARG4" "-FARG1"}} // Check linker changes that came with new linkedit format. // RUN: touch %t.o @@ -92,3 +92,19 @@ // LINK_OLDER_NODEMANGLE: {{ld(.exe)?"}} // LINK_OLDER_NODEMANGLE-NOT: "-demangle" // LINK_OLDER_NODEMANGLE: "-lSystem" + +// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### %t.o \ +// RUN: -mlinker-version=117 -flto 2> %t.log +// RUN: cat %t.log +// RUN: FileCheck -check-prefix=LINK_OBJECT_LTO_PATH %s < %t.log +// +// LINK_OBJECT_LTO_PATH: {{ld(.exe)?"}} +// LINK_OBJECT_LTO_PATH: "-object_path_lto" + +// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### %t.o \ +// RUN: -force_load a -force_load b 2> %t.log +// RUN: cat %t.log +// RUN: FileCheck -check-prefix=FORCE_LOAD %s < %t.log +// +// FORCE_LOAD: {{ld(.exe)?"}} +// FORCE_LOAD: "-force_load" "a" "-force_load" "b" diff --git a/test/Driver/darwin-objc-options.m b/test/Driver/darwin-objc-options.m index bc0b12c..50daa72 100644 --- a/test/Driver/darwin-objc-options.m +++ b/test/Driver/darwin-objc-options.m @@ -15,5 +15,7 @@ // CHECK-CHECK-I386_ABI2: "-cc1" // CHECK-CHECK-I386_ABI2: -fobjc-nonfragile-abi +// CHECK-CHECK-I386_ABI2: -fobjc-exceptions +// CHECK-CHECK-I386_ABI2: -fexceptions // CHECK-CHECK-I386_ABI2-NOT: -fobjc-dispatch-method // CHECK-CHECK-I386_ABI2: darwin-objc-options diff --git a/test/Driver/darwin-xarch.c b/test/Driver/darwin-xarch.c index d16d531..4c6689c 100644 --- a/test/Driver/darwin-xarch.c +++ b/test/Driver/darwin-xarch.c @@ -12,3 +12,9 @@ // RUN: FileCheck --check-prefix=CHECK-LINK < %t %s // // CHECK-LINK: ld{{.*}} "-arch" "i386"{{.*}} "-some-linker-arg" + +// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### \ +// RUN: -arch armv7 -Xarch_armv7 -Wl,-some-linker-arg -filelist X 2> %t +// RUN: FileCheck --check-prefix=CHECK-ARMV7-LINK < %t %s +// +// CHECK-ARMV7-LINK: ld{{.*}} "-arch" "armv7"{{.*}} "-some-linker-arg" diff --git a/test/Driver/gnu-runtime.m b/test/Driver/gnu-runtime.m new file mode 100644 index 0000000..5a3654c --- /dev/null +++ b/test/Driver/gnu-runtime.m @@ -0,0 +1,5 @@ +// RUN: %clang -ccc-host-triple i386-apple-darwin10 -### -fsyntax-only -fgnu-runtime %s 2>&1 | FileCheck %s +// RUN: %clang -ccc-host-triple i386-apple-darwin10 -### -x objective-c++ -fsyntax-only -fgnu-runtime %s 2>&1 | FileCheck %s +// CHECK: -fgnu-runtime +// CHECK: -fobjc-runtime-has-arc +// CHECK: -fobjc-runtime-has-weak diff --git a/test/Driver/ios-simulator-arcruntime.c b/test/Driver/ios-simulator-arcruntime.c new file mode 100644 index 0000000..bec9f7b --- /dev/null +++ b/test/Driver/ios-simulator-arcruntime.c @@ -0,0 +1,6 @@ +// RUN: %clang -### -x objective-c -ccc-host-triple i386-apple-darwin10 -arch i386 -mmacosx-version-min=10.6 -D__IPHONE_OS_VERSION_MIN_REQUIRED=40201 -fobjc-arc -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS1 %s +// RUN: %clang -### -x objective-c -ccc-host-triple i386-apple-darwin10 -arch i386 -mmacosx-version-min=10.6 -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -fobjc-arc -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS2 %s +// + +// CHECK-OPTIONS1-NOT: -fobjc-runtime-has-weak +// CHECK-OPTIONS2: -fobjc-runtime-has-weak diff --git a/test/Driver/mg.c b/test/Driver/mg.c new file mode 100644 index 0000000..4f43814 --- /dev/null +++ b/test/Driver/mg.c @@ -0,0 +1,5 @@ +// RUN: %clang -M -MG -include nonexistent-preinclude.h %s > %t +// RUN: fgrep nonexistent-preinclude.h %t +// RUN: fgrep nonexistent-ppinclude.h %t + +#include "nonexistent-ppinclude.h" diff --git a/test/Driver/no-objc-arr.m b/test/Driver/no-objc-arr.m new file mode 100644 index 0000000..15fbdc2 --- /dev/null +++ b/test/Driver/no-objc-arr.m @@ -0,0 +1,8 @@ +// RUN: %clang -Werror -fobjc-arc -fsyntax-only -fno-objc-arc -verify %s +// rdar://8949617 + +void * FOO() { + id string = @"Hello World.\n"; + void *pointer = string; // No error must be issued + return pointer; +} diff --git a/test/Driver/noexecstack.c b/test/Driver/noexecstack.c new file mode 100644 index 0000000..1f47728 --- /dev/null +++ b/test/Driver/noexecstack.c @@ -0,0 +1 @@ +// RUN: %clang -### %s -c -o tmp.o -triple i686-pc-linux-gnu -integrated-as -Wa,--noexecstack 2>&1 | grep "mnoexecstack" diff --git a/test/Driver/rewrite-objc.m b/test/Driver/rewrite-objc.m index 2fe2cce..c47b523 100644 --- a/test/Driver/rewrite-objc.m +++ b/test/Driver/rewrite-objc.m @@ -3,7 +3,7 @@ // TEST0: clang{{.*}}" "-cc1" // TEST0: "-rewrite-objc" // FIXME: CHECK-NOT is broken somehow, it doesn't work here. Check adjacency instead. -// TEST0: "-fmessage-length" "0" "-fobjc-infer-related-result-type" "-fobjc-exceptions" "-fdiagnostics-show-option" +// TEST0: "-fmessage-length" "0" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fdiagnostics-show-option" // TEST0: rewrite-objc.m" // RUN: not %clang -ccc-no-clang -ccc-host-triple unknown -rewrite-objc %s -o - -### 2>&1 | \ diff --git a/test/Driver/sysroot.c b/test/Driver/sysroot.c index 34f3100..79db900 100644 --- a/test/Driver/sysroot.c +++ b/test/Driver/sysroot.c @@ -1,18 +1,18 @@ // Check that --sysroot= also applies to header search paths. // RUN: %clang -ccc-host-triple i386-unk-unk --sysroot=/FOO -### -E %s 2> %t1 // RUN: FileCheck --check-prefix=CHECK-SYSROOTEQ < %t1 %s -// CHECK-SYSROOTEQ: "-cc1"{{.*}} "-isysroot" "/FOO" +// CHECK-SYSROOTEQ: "-cc1"{{.*}} "-isysroot" "{{[^"]*}}/FOO" // Apple Darwin uses -isysroot as the syslib root, too. // RUN: touch %t2.o // RUN: %clang -ccc-host-triple i386-apple-darwin10 \ // RUN: -isysroot /FOO -### %t2.o 2> %t2 // RUN: FileCheck --check-prefix=CHECK-APPLE-ISYSROOT < %t2 %s -// CHECK-APPLE-ISYSROOT: "-arch" "i386"{{.*}} "-syslibroot" "/FOO" +// CHECK-APPLE-ISYSROOT: "-arch" "i386"{{.*}} "-syslibroot" "{{[^"]*}}/FOO" // Check that honor --sysroot= over -isysroot, for Apple Darwin. // RUN: touch %t3.o // RUN: %clang -ccc-host-triple i386-apple-darwin10 \ // RUN: -isysroot /FOO --sysroot=/BAR -### %t3.o 2> %t3 // RUN: FileCheck --check-prefix=CHECK-APPLE-SYSROOT < %t3 %s -// CHECK-APPLE-SYSROOT: "-arch" "i386"{{.*}} "-syslibroot" "/BAR" +// CHECK-APPLE-SYSROOT: "-arch" "i386"{{.*}} "-syslibroot" "{{[^"]*}}/BAR" diff --git a/test/Driver/x86_features.c b/test/Driver/x86_features.c index 9dbdd0a..0db372e 100644 --- a/test/Driver/x86_features.c +++ b/test/Driver/x86_features.c @@ -1,3 +1,3 @@ // RUN: %clang -ccc-host-triple i386-unknown-unknown -### -S %s -msse -msse4 -mno-sse -mno-mmx -msse 2> %t -// RUN: grep '"-target-feature" "+sse" "-target-feature" "+sse4" "-target-feature" "-sse" "-target-feature" "-mmx" "-target-feature" "+sse"' %t - +// RUN: grep '"pentium4" "-target-feature" "+sse4" "-target-feature" "-mmx" "-target-feature" "+sse"' %t +// Note that we filter out all but the last -m(no)sse. |