diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2011-05-02 19:39:53 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2011-05-02 19:39:53 +0000 |
| commit | 01af97d3b23bded2b2b21af19bbc6e4cce49e5b3 (patch) | |
| tree | 64a10f4c4154739d4a8191d7e1b52ce497f4ebd6 /test/Driver | |
| parent | c3b054d250cdca485c71845089c316e10610ebad (diff) | |
Notes
Diffstat (limited to 'test/Driver')
| -rw-r--r-- | test/Driver/apple-kext-i386.cpp | 9 | ||||
| -rw-r--r-- | test/Driver/apple-kext-mkernel.c | 24 | ||||
| -rw-r--r-- | test/Driver/ast.c | 2 | ||||
| -rw-r--r-- | test/Driver/cc-log-diagnostics.c | 29 | ||||
| -rw-r--r-- | test/Driver/cc-print-options.c | 2 | ||||
| -rw-r--r-- | test/Driver/clang-exception-flags.cpp | 23 | ||||
| -rw-r--r-- | test/Driver/clang-translation.c | 2 | ||||
| -rw-r--r-- | test/Driver/clang_f_opts.c | 17 | ||||
| -rw-r--r-- | test/Driver/clang_wrapv_opts.c | 11 | ||||
| -rw-r--r-- | test/Driver/darwin-cc.c | 7 | ||||
| -rw-r--r-- | test/Driver/darwin-dsymutil.c | 7 | ||||
| -rw-r--r-- | test/Driver/darwin-ld.c | 4 | ||||
| -rw-r--r-- | test/Driver/darwin-version.c | 8 | ||||
| -rw-r--r-- | test/Driver/darwin-xarch.c | 4 | ||||
| -rw-r--r-- | test/Driver/exceptions.m | 19 | ||||
| -rw-r--r-- | test/Driver/hello.c | 6 | ||||
| -rw-r--r-- | test/Driver/sysroot-flags.c | 14 |
17 files changed, 162 insertions, 26 deletions
diff --git a/test/Driver/apple-kext-i386.cpp b/test/Driver/apple-kext-i386.cpp new file mode 100644 index 0000000000000..dc4e6a641f0dc --- /dev/null +++ b/test/Driver/apple-kext-i386.cpp @@ -0,0 +1,9 @@ +// Check that we transparently fallback to llvm-gcc for i386 kexts, we don't +// support the ABI they use (yet). + +// RUN: %clang -ccc-host-triple i386-apple-darwin10 \ +// RUN: -fapple-kext -### -fsyntax-only %s 2> %t +// RUN: FileCheck --check-prefix=CHECK < %t %s + +// CHECK: cc1plus" +// CHECK: "-fapple-kext" diff --git a/test/Driver/apple-kext-mkernel.c b/test/Driver/apple-kext-mkernel.c index 712dfc8d0eba8..82a6896415c27 100644 --- a/test/Driver/apple-kext-mkernel.c +++ b/test/Driver/apple-kext-mkernel.c @@ -1,6 +1,18 @@ -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -mkernel -### -fsyntax-only %s 2> %t -// RUN grep "-disable-red-zone" %t -// RUN grep "-fapple-kext" %t -// RUN grep "-fno-builtin" %t -// RUN grep "-fno-rtti" %t -// RUN grep "-fno-common" %t +// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 \ +// RUN: -mkernel -### -fsyntax-only %s 2> %t +// RUN: FileCheck --check-prefix=CHECK-X86 < %t %s + +// CHECK-X86: "-disable-red-zone" +// CHECK-X86: "-fno-builtin" +// CHECK-X86: "-fno-rtti" +// CHECK-X86: "-fno-common" + +// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 \ +// RUN: -arch armv7 -mkernel -### -fsyntax-only %s 2> %t +// RUN: FileCheck --check-prefix=CHECK-ARM < %t %s + +// CHECK-ARM: "-backend-option" "-arm-long-calls" +// CHECK-ARM: "-backend-option" "-arm-strict-align" +// CHECK-ARM: "-fno-builtin" +// CHECK-ARM: "-fno-rtti" +// CHECK-ARM: "-fno-common" diff --git a/test/Driver/ast.c b/test/Driver/ast.c index 6e5857fba5e32..e9fbb068d969e 100644 --- a/test/Driver/ast.c +++ b/test/Driver/ast.c @@ -22,5 +22,5 @@ // COMPILE-AST-PHASES: END // FIXME: There is a problem with compiling AST's in that the input language is -// not availabe for use by other tools (for example, to automatically add +// not available for use by other tools (for example, to automatically add // -lstdc++). We may need -x [objective-]c++-ast and all that goodness. :( diff --git a/test/Driver/cc-log-diagnostics.c b/test/Driver/cc-log-diagnostics.c new file mode 100644 index 0000000000000..a70686ad615a3 --- /dev/null +++ b/test/Driver/cc-log-diagnostics.c @@ -0,0 +1,29 @@ +// RUN: env RC_DEBUG_OPTIONS=1 \ +// RUN: CC_LOG_DIAGNOSTICS=1 \ +// RUN: CC_LOG_DIAGNOSTICS_FILE=%t.log \ +// RUN: %clang -no-canonical-prefixes -ccc-host-triple x86_64-apple-darwin10 -fsyntax-only %s +// RUN: FileCheck %s < %t.log + +int f0() {} + +// CHECK: <dict> +// CHECK: <key>main-file</key> +// CHECK: <string>{{.*}}cc-log-diagnostics.c</string> +// CHECK: <key>dwarf-debug-flags</key> +// CHECK: <string>{{.*}}clang{{.*}}-fsyntax-only{{.*}}</string> +// CHECK: <key>diagnostics</key> +// CHECK: <array> +// CHECK: <dict> +// CHECK: <key>level</key> +// CHECK: <string>warning</string> +// CHECK: <key>filename</key> +// CHECK: <string>{{.*}}cc-log-diagnostics.c</string> +// CHECK: <key>line</key> +// CHECK: <integer>7</integer> +// CHECK: <key>column</key> +// CHECK: <integer>11</integer> +// CHECK: <key>message</key> +// CHECK: <string>control reaches end of non-void function</string> +// CHECK: </dict> +// CHECK: </array> +// CHECK: </dict> diff --git a/test/Driver/cc-print-options.c b/test/Driver/cc-print-options.c index 7b798cb08a85d..77dd0fef5f983 100644 --- a/test/Driver/cc-print-options.c +++ b/test/Driver/cc-print-options.c @@ -1,6 +1,6 @@ // RUN: env CC_PRINT_OPTIONS=1 \ // RUN: CC_PRINT_OPTIONS_FILE=%t.log \ -// RUN: %clang -S -o %t.s %s +// RUN: %clang -no-canonical-prefixes -S -o %t.s %s // RUN: FileCheck %s < %t.log // CHECK: [Logging clang options]{{.*}}clang{{.*}}"-S" diff --git a/test/Driver/clang-exception-flags.cpp b/test/Driver/clang-exception-flags.cpp new file mode 100644 index 0000000000000..90a9ebf5e44e6 --- /dev/null +++ b/test/Driver/clang-exception-flags.cpp @@ -0,0 +1,23 @@ +// RUN: %clang -### %s 2>&1 | FileCheck %s -check-prefix=DEFAULT +// DEFAULT: "-cc1" {{.*}} "-fcxx-exceptions" "-fexceptions" +// +// RUN: %clang -### -fexceptions %s 2>&1 | FileCheck %s -check-prefix=ON1 +// ON1: "-cc1" {{.*}} "-fcxx-exceptions" "-fexceptions" +// +// RUN: %clang -### -fno-exceptions -fcxx-exceptions %s 2>&1 | FileCheck %s -check-prefix=ON2 +// ON2: "-cc1" {{.*}} "-fcxx-exceptions" "-fexceptions" +// +// RUN: %clang -### -fno-cxx-exceptions -fexceptions %s 2>&1 | FileCheck %s -check-prefix=ON3 +// ON3: "-cc1" {{.*}} "-fcxx-exceptions" "-fexceptions" +// +// RUN: %clang -### -fno-exceptions %s 2>&1 | FileCheck %s -check-prefix=OFF1 +// OFF1-NOT: "-cc1" {{.*}} "-fcxx-exceptions" +// +// RUN: %clang -### -fno-cxx-exceptions %s 2>&1 | FileCheck %s -check-prefix=OFF2 +// OFF2-NOT: "-cc1" {{.*}} "-fcxx-exceptions" +// +// RUN: %clang -### -fcxx-exceptions -fno-exceptions %s 2>&1 | FileCheck %s -check-prefix=OFF3 +// OFF3-NOT: "-cc1" {{.*}} "-fcxx-exceptions" +// +// RUN: %clang -### -fexceptions -fno-cxx-exceptions %s 2>&1 | FileCheck %s -check-prefix=OFF4 +// OFF4-NOT: "-cc1" {{.*}} "-fcxx-exceptions" diff --git a/test/Driver/clang-translation.c b/test/Driver/clang-translation.c index 2464f03b7a1e0..b2b358f0ebb88 100644 --- a/test/Driver/clang-translation.c +++ b/test/Driver/clang-translation.c @@ -31,6 +31,8 @@ // ARMV7_SOFTFLOAT: "-cc1" // ARMV7_SOFTFLOAT: "-msoft-float" // ARMV7_SOFTFLOAT: "-mfloat-abi" "soft" +// ARMV7_SOFTFLOAT: "-target-feature" +// ARMV7_SOFTFLOAT: "-neon" // ARMV7_SOFTFLOAT: "-x" "c" // RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### -S %s 2> %t.log \ diff --git a/test/Driver/clang_f_opts.c b/test/Driver/clang_f_opts.c index 8e6b0fe850deb..4eed4aa06f3f3 100644 --- a/test/Driver/clang_f_opts.c +++ b/test/Driver/clang_f_opts.c @@ -12,3 +12,20 @@ // CHECK-OPTIONS2: -fshort-wchar // CHECK-OPTIONS2: -fno-common // CHECK-OPTIONS2: -fno-show-source-location + +// RUN: %clang -### -S -Wwrite-strings %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS1 %s +// WRITE-STRINGS1: -fconst-strings +// RUN: %clang -### -S -Wwrite-strings -Wno-write-strings %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS2 %s +// WRITE-STRINGS2-NOT: -fconst-strings +// RUN: %clang -### -S -Wwrite-strings -w %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS3 %s +// WRITE-STRINGS3: -fconst-strings + +// RUN: %clang -### -x c++ -c %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s +// RUN: %clang -### -x c++ -c -Wdeprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s +// RUN: %clang -### -x c++ -c -Wno-deprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-OFF-CHECK %s +// RUN: %clang -### -x c++ -c -Wno-deprecated -Wdeprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s +// RUN: %clang -### -x c++ -c -w %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s +// RUN: %clang -### -c %s 2>&1 | FileCheck -check-prefix=DEPRECATED-OFF-CHECK %s +// RUN: %clang -### -c -Wdeprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-OFF-CHECK %s +// DEPRECATED-ON-CHECK: -fdeprecated-macro +// DEPRECATED-OFF-CHECK-NOT: -fdeprecated-macro diff --git a/test/Driver/clang_wrapv_opts.c b/test/Driver/clang_wrapv_opts.c new file mode 100644 index 0000000000000..826468e0678d0 --- /dev/null +++ b/test/Driver/clang_wrapv_opts.c @@ -0,0 +1,11 @@ +// RUN: %clang -### -S -fwrapv -fno-wrapv -fwrapv %s 2>&1 | FileCheck -check-prefix=CHECK1 %s +// CHECK1: -fwrapv +// +// RUN: %clang -### -S -fstrict-overflow -fno-strict-overflow %s 2>&1 | FileCheck -check-prefix=CHECK2 %s +// CHECK2: -fwrapv +// +// RUN: %clang -### -S -fwrapv -fstrict-overflow %s 2>&1 | FileCheck -check-prefix=CHECK3 %s +// CHECK3: -fwrapv +// +// RUN: %clang -### -S -fno-wrapv -fno-strict-overflow %s 2>&1 | FileCheck -check-prefix=CHECK4 %s +// CHECK4-NOT: -fwrapv diff --git a/test/Driver/darwin-cc.c b/test/Driver/darwin-cc.c index b068bb4e3fd49..247b02bebea22 100644 --- a/test/Driver/darwin-cc.c +++ b/test/Driver/darwin-cc.c @@ -1,5 +1,4 @@ // RUN: %clang -ccc-no-clang -ccc-host-triple i386-apple-darwin10 -m32 -### -MD -g -fast -Q -dA -mkernel -ansi -aFOO -S -o /tmp/OUTPUTNAME -g0 -gfull -O2 -Werror -pedantic -Wmost -w -std=c99 -trigraphs -v -pg -fFOO -undef -Qn --param a=b -fmudflap -coverage -save-temps -nostdinc -I ARG0 -F ARG1 -I ARG2 -P -MF ARG3 -MG -MP -remap -g3 -H -D ARG4 -U ARG5 -A ARG6 -D ARG7 -U ARG8 -A ARG9 -include ARG10 -pthread %s 2> %t.log -// RUN: grep ' ".*cc1" "-E" "-nostdinc" "-v" "-I" "ARG0" "-FARG1" "-I" "ARG2" "-P" "-MD" "/tmp/OUTPUTNAME.d" "-MF" "ARG3" "-MG" "-MP" "-MQ" "/tmp/OUTPUTNAME" "-remap" "-dD" "-H" "-D__STATIC__" "-D_REENTRANT" "-D" "ARG4" "-U" "ARG5" "-A" "ARG6" "-D" "ARG7" "-U" "ARG8" "-A" "ARG9" "-include" "ARG10" ".*darwin-cc.c" "-D_MUDFLAP" "-include" "mf-runtime.h" "-m32" "-mkernel" "-mtune=core2" "-mmacosx-version-min=10.6.0" "-ansi" "-std=c99" "-trigraphs" "-Werror" "-pedantic" "-Wmost" "-w" "-fast" "-fno-eliminate-unused-debug-symbols" "-fFOO" "-fmudflap" "-O2" "-undef" "-fpch-preprocess" "-o" ".*darwin-cc.i"' %t.log -// RUN: grep ' ".*cc1" "-fpreprocessed" ".*darwin-cc.i" "-O3" "-dumpbase" ".*darwin-cc.c" "-dA" "-m32" "-mkernel" "-mtune=core2" "-mmacosx-version-min=10.6.0" "-ansi" "-aFOO" "-auxbase-strip" "/tmp/OUTPUTNAME" "-g" "-g0" "-g" "-g3" "-O2" "-Werror" "-pedantic" "-Wmost" "-w" "-ansi" "-std=c99" "-trigraphs" "-version" "-p" "-fast" "-fno-eliminate-unused-debug-symbols" "-fFOO" "-fmudflap" "-undef" "-fno-ident" "-o" "/tmp/OUTPUTNAME" "--param" "a=b" "-fno-builtin" "-fno-merge-constants" "-fprofile-arcs" "-ftest-coverage"' %t.log - - +// RUN: FileCheck %s < %t.log +// CHECK: {{ ".*cc1.*" "-E" "-nostdinc" "-v" "-I" "ARG0" "-FARG1" "-I" "ARG2" "-P" "-MD" "[^"]*/OUTPUTNAME.d" "-MF" "ARG3" "-MG" "-MP" "-MQ" "[^"]*/OUTPUTNAME" "-remap" "-dD" "-H" "-D__STATIC__" "-D_REENTRANT" "-D" "ARG4" "-U" "ARG5" "-A" "ARG6" "-D" "ARG7" "-U" "ARG8" "-A" "ARG9" "-include" "ARG10" ".*darwin-cc.c" "-D_MUDFLAP" "-include" "mf-runtime.h" "-m32" "-mkernel" "-mtune=core2" "-mmacosx-version-min=10.6.0" "-ansi" "-std=c99" "-trigraphs" "-Werror" "-pedantic" "-Wmost" "-w" "-fast" "-fno-eliminate-unused-debug-symbols" "-fFOO" "-fmudflap" "-O2" "-undef" "-fpch-preprocess" "-o" ".*darwin-cc.i"}} +// CHECK: {{ ".*cc1.*" "-fpreprocessed" ".*darwin-cc.i" "-O3" "-dumpbase" ".*darwin-cc.c" "-dA" "-m32" "-mkernel" "-mtune=core2" "-mmacosx-version-min=10.6.0" "-ansi" "-aFOO" "-auxbase-strip" "[^"]*/OUTPUTNAME" "-g" "-g0" "-g" "-g3" "-O2" "-Werror" "-pedantic" "-Wmost" "-w" "-ansi" "-std=c99" "-trigraphs" "-version" "-p" "-fast" "-fno-eliminate-unused-debug-symbols" "-fFOO" "-fmudflap" "-undef" "-fno-ident" "-o" "[^"]*/OUTPUTNAME" "--param" "a=b" "-fno-builtin" "-fno-merge-constants" "-fprofile-arcs" "-ftest-coverage"}} diff --git a/test/Driver/darwin-dsymutil.c b/test/Driver/darwin-dsymutil.c index f1ffcdc589d40..afb41a9db28b1 100644 --- a/test/Driver/darwin-dsymutil.c +++ b/test/Driver/darwin-dsymutil.c @@ -36,3 +36,10 @@ // RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -ccc-print-bindings \ // RUN: -o foo %t.o -g 2> %t // RUN: grep "Dsymutil" %t | count 0 + +// Check that we put the .dSYM in the right place. +// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -ccc-print-bindings \ +// RUN: -o bar/foo %s -g 2> %t +// RUN: FileCheck -check-prefix=CHECK-LOCATION < %t %s + +// CHECK-LOCATION: "x86_64-apple-darwin10" - "darwin::Dsymutil", inputs: ["bar/foo"], output: "bar/foo.dSYM" diff --git a/test/Driver/darwin-ld.c b/test/Driver/darwin-ld.c index 206e665a2cf38..3f2b69185a584 100644 --- a/test/Driver/darwin-ld.c +++ b/test/Driver/darwin-ld.c @@ -18,8 +18,8 @@ // // 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" "-LARG2" "-lgomp".* "-filelist" "FOO" "-lFOO" "-lgcov" "-allow_stack_execute" "-T" "ARG4" "-FARG1"' %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 -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: 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" "-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" "-lgcov" "-allow_stack_execute" "-T" "ARG4" "-FARG1"' %t.log // Check linker changes that came with new linkedit format. // RUN: touch %t.o diff --git a/test/Driver/darwin-version.c b/test/Driver/darwin-version.c index 84533a6252465..d9c5c5ed3f7bb 100644 --- a/test/Driver/darwin-version.c +++ b/test/Driver/darwin-version.c @@ -21,3 +21,11 @@ #error Invalid version #endif #endif + +// RUN: env MACOSX_DEPLOYMENT_TARGET=10.4.10 \ +// RUN: %clang -ccc-host-triple i386-apple-darwin9 -DTEST3 -E %s +#ifdef TEST3 +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1049 +#error Invalid version +#endif +#endif diff --git a/test/Driver/darwin-xarch.c b/test/Driver/darwin-xarch.c index d2fb43e68caf1..d16d5318f7f8d 100644 --- a/test/Driver/darwin-xarch.c +++ b/test/Driver/darwin-xarch.c @@ -4,8 +4,8 @@ // RUN: -c %s 2> %t // RUN: FileCheck --check-prefix=CHECK-COMPILE < %t %s // -// CHECK-COMPILE: clang{{.*}}" "-cc1" "-triple" "i386-apple-darwin8.0.0" -// CHECK-COMPILE: clang{{.*}}" "-cc1" "-triple" "x86_64-apple-darwin9.0.0" +// CHECK-COMPILE: clang{{.*}}" "-cc1" "-triple" "i386-apple-macosx10.4.0" +// CHECK-COMPILE: clang{{.*}}" "-cc1" "-triple" "x86_64-apple-macosx10.5.0" // RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### \ // RUN: -arch i386 -Xarch_i386 -Wl,-some-linker-arg -filelist X 2> %t diff --git a/test/Driver/exceptions.m b/test/Driver/exceptions.m new file mode 100644 index 0000000000000..7d85fe30aefaa --- /dev/null +++ b/test/Driver/exceptions.m @@ -0,0 +1,19 @@ +// RUN: %clang -ccc-host-triple x86_64-apple-darwin9 \ +// RUN: -fsyntax-only -fno-exceptions %s + +void f1() { + @throw @"A"; +} + +void f0() { + @try { + f1(); + } @catch (id x) { + ; + } +} + +int main() { + f0(); + return 0; +} diff --git a/test/Driver/hello.c b/test/Driver/hello.c index da628724d6d94..c2260e53eb382 100644 --- a/test/Driver/hello.c +++ b/test/Driver/hello.c @@ -1,9 +1,9 @@ -// RUN: %clang -ccc-echo -o %t %s 2> %t.log +// RUN: %clang -ccc-echo -o %t.exe %s 2> %t.log // Make sure we used clang. -// RUN: grep 'clang" -cc1 .*hello.c' %t.log +// RUN: grep 'clang\(-[0-9.]\+\)\?\(\.[Ee][Xx][Ee]\)\?" -cc1 .*hello.c' %t.log -// RUN: %t > %t.out +// RUN: %t.exe > %t.out // RUN: grep "I'm a little driver, short and stout." %t.out // FIXME: We don't have a usable assembler on Windows, so we can't build real diff --git a/test/Driver/sysroot-flags.c b/test/Driver/sysroot-flags.c index 461c451e12937..044a86f6331bf 100644 --- a/test/Driver/sysroot-flags.c +++ b/test/Driver/sysroot-flags.c @@ -2,27 +2,27 @@ // RUN: %clang -### -fsyntax-only -isysroot /foo/bar %s 2>&1 | \ // RUN: FileCheck %s -check-prefix=ISYSROOT -// ISYSROOT: "-isysroot" "/foo/bar" +// ISYSROOT: "-isysroot" "{{[^"]*}}/foo/bar" // Check that we get both isysroot for headers, and pass --sysroot on to GCC to // produce the final binary. // RUN: %clang -### -ccc-host-triple x86_64-unknown-linux-gnu \ // RUN: --sysroot=/foo/bar -o /dev/null %s 2>&1 | \ // RUN: FileCheck %s -check-prefix=SYSROOT_EQ -// SYSROOT_EQ: "-isysroot" "/foo/bar" -// SYSROOT_EQ: "--sysroot{{" "|=}}/foo/bar" +// SYSROOT_EQ: "-isysroot" "{{[^"]*}}/foo/bar" +// SYSROOT_EQ: "--sysroot{{" "|=}}{{[^"]*}}/foo/bar" // Check for overriding the header sysroot by providing both --sysroot and // -isysroot. // RUN: %clang -### -ccc-host-triple x86_64-unknown-linux-gnu -isysroot /baz \ // RUN: --sysroot=/foo/bar -o /dev/null %s 2>&1 | FileCheck %s \ // RUN: -check-prefix=ISYSROOT_AND_SYSROOT -// ISYSROOT_AND_SYSROOT: "-isysroot" "/baz" -// ISYSROOT_AND_SYSROOT: "--sysroot{{" "|=}}/foo/bar" +// ISYSROOT_AND_SYSROOT: "-isysroot" "{{[^"]*}}/baz" +// ISYSROOT_AND_SYSROOT: "--sysroot{{" "|=}}{{[^"]*}}/foo/bar" // Check that omitting the equals works as well. // RUN: %clang -### -ccc-host-triple x86_64-unknown-linux-gnu \ // RUN: --sysroot /foo/bar -o /dev/null %s 2>&1 | \ // RUN: FileCheck %s -check-prefix=SYSROOT_SEPARATE -// SYSROOT_SEPARATE: "-isysroot" "/foo/bar" -// SYSROOT_SEPARATE: "--sysroot{{" "|=}}/foo/bar" +// SYSROOT_SEPARATE: "-isysroot" "{{[^"]*}}/foo/bar" +// SYSROOT_SEPARATE: "--sysroot{{" "|=}}{{[^"]*}}/foo/bar" |
