summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorrdivacky <rdivacky@FreeBSD.org>2009-11-18 14:59:57 +0000
committerrdivacky <rdivacky@FreeBSD.org>2009-11-18 14:59:57 +0000
commit741c13ecc20fb35b836ad690aeecd402f002d654 (patch)
tree60a1694bec5a44d15456acc880cb2f91619f66aa /test
parentb3a51061b1b9c4add078237850649f7c9efb13ab (diff)
downloadFreeBSD-src-741c13ecc20fb35b836ad690aeecd402f002d654.zip
FreeBSD-src-741c13ecc20fb35b836ad690aeecd402f002d654.tar.gz
Update clang to r89205.
Diffstat (limited to 'test')
-rw-r--r--test/Analysis/CFDateGC.m10
-rw-r--r--test/Analysis/CFNumber.c8
-rw-r--r--test/Analysis/CFRetainRelease_NSAssertionHandler.m8
-rw-r--r--test/Analysis/CGColorSpace.c8
-rw-r--r--test/Analysis/CheckNSError.m8
-rw-r--r--test/Analysis/MissingDealloc.m2
-rw-r--r--test/Analysis/NSPanel.m8
-rw-r--r--test/Analysis/NSString.m19
-rw-r--r--test/Analysis/NSWindow.m8
-rw-r--r--test/Analysis/NoReturn.m8
-rw-r--r--test/Analysis/ObjCProperties.m8
-rw-r--r--test/Analysis/ObjCRetSigs.m4
-rw-r--r--test/Analysis/PR2599.m8
-rw-r--r--test/Analysis/PR2978.m2
-rw-r--r--test/Analysis/PR3991.m19
-rw-r--r--test/Analysis/array-struct.c12
-rw-r--r--test/Analysis/casts.c2
-rw-r--r--test/Analysis/casts.m4
-rw-r--r--test/Analysis/cfref_PR2519.c8
-rw-r--r--test/Analysis/cfref_rdar6080742.c8
-rw-r--r--test/Analysis/complex.c8
-rw-r--r--test/Analysis/concrete-address.c4
-rw-r--r--test/Analysis/conditional-op-missing-lhs.c2
-rw-r--r--test/Analysis/dead-stores.c10
-rw-r--r--test/Analysis/dead-stores.cpp10
-rw-r--r--test/Analysis/dead-stores.m2
-rw-r--r--test/Analysis/delegates.m4
-rw-r--r--test/Analysis/elementtype.c2
-rw-r--r--test/Analysis/exercise-ps.c4
-rw-r--r--test/Analysis/fields.c4
-rw-r--r--test/Analysis/func.c4
-rw-r--r--test/Analysis/malloc.c37
-rw-r--r--test/Analysis/misc-ps-64.m8
-rw-r--r--test/Analysis/misc-ps-basic-store.m2
-rw-r--r--test/Analysis/misc-ps-eager-assume.m2
-rw-r--r--test/Analysis/misc-ps-ranges.m6
-rw-r--r--test/Analysis/misc-ps-region-store-i386.m2
-rw-r--r--test/Analysis/misc-ps-region-store-x86_64.m2
-rw-r--r--test/Analysis/misc-ps-region-store.m45
-rw-r--r--test/Analysis/misc-ps.m38
-rw-r--r--test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m4
-rw-r--r--test/Analysis/no-exit-cfg.c4
-rw-r--r--test/Analysis/no-outofbounds.c5
-rw-r--r--test/Analysis/null-deref-ps-region.c2
-rw-r--r--test/Analysis/null-deref-ps.c8
-rw-r--r--test/Analysis/outofbound.c5
-rw-r--r--test/Analysis/override-werror.c4
-rw-r--r--test/Analysis/plist-output.m122
-rw-r--r--test/Analysis/pr4209.m14
-rw-r--r--test/Analysis/pr_2542_rdar_6793404.m4
-rw-r--r--test/Analysis/pr_4164.c4
-rw-r--r--test/Analysis/ptr-arith.c33
-rw-r--r--test/Analysis/rdar-6442306-1.m4
-rw-r--r--test/Analysis/rdar-6540084.m2
-rw-r--r--test/Analysis/rdar-6541136-region.c17
-rw-r--r--test/Analysis/rdar-6541136.c2
-rw-r--r--test/Analysis/rdar-6562655.m4
-rw-r--r--test/Analysis/rdar-6582778-basic-store.c2
-rw-r--r--test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m4
-rw-r--r--test/Analysis/rdar-7168531.m4
-rw-r--r--test/Analysis/refcnt_naming.m4
-rw-r--r--test/Analysis/region-1.m5
-rw-r--r--test/Analysis/retain-release-gc-only.m4
-rw-r--r--test/Analysis/retain-release.m2
-rw-r--r--test/Analysis/security-syntax-checks.m7
-rw-r--r--test/Analysis/sizeofpointer.c8
-rw-r--r--test/Analysis/stack-addr-ps.c4
-rw-r--r--test/Analysis/uninit-msg-expr.m2
-rw-r--r--test/Analysis/uninit-ps-rdar6145427.m2
-rw-r--r--test/Analysis/uninit-vals-ps.c2
-rw-r--r--test/Analysis/uninit-vals.m2
-rw-r--r--test/Analysis/unused-ivars.m2
-rw-r--r--test/CMakeLists.txt44
-rw-r--r--test/CXX/basic/basic.lookup/basic.lookup.udir/p1.cpp35
-rw-r--r--test/CXX/dcl.dcl/basic.namespace/namespace.def/namespace.unnamed/p1.cpp24
-rw-r--r--test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p1.cpp67
-rw-r--r--test/CXX/dcl.dcl/basic.namespace/namespace.udir/p1.cpp141
-rw-r--r--test/CXX/dcl.decl/dcl.meaning/dcl.array/p1.cpp44
-rw-r--r--test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p4.cpp2
-rw-r--r--test/CXX/dcl.decl/dcl.meaning/dcl.fct/p3.cpp2
-rw-r--r--test/CXX/dcl.decl/dcl.meaning/dcl.mptr/p3.cpp4
-rw-r--r--test/CXX/expr/expr.unary/expr.delete/p5.cpp34
-rw-r--r--test/CXX/special/class.free/p1.cpp11
-rw-r--r--test/CXX/special/class.free/p6.cpp11
-rw-r--r--test/CXX/temp/temp.param/p1.cpp2
-rw-r--r--test/CXX/temp/temp.param/p12.cpp4
-rw-r--r--test/CXX/temp/temp.spec/temp.expl.spec/p3.cpp2
-rw-r--r--test/CXX/temp/temp.spec/temp.expl.spec/p4.cpp5
-rw-r--r--test/CodeCompletion/call.cpp5
-rw-r--r--test/CodeCompletion/enum-switch-case-qualified.cpp3
-rw-r--r--test/CodeCompletion/enum-switch-case.c3
-rw-r--r--test/CodeCompletion/enum-switch-case.cpp3
-rw-r--r--test/CodeCompletion/function-templates.cpp3
-rw-r--r--test/CodeCompletion/functions.cpp3
-rw-r--r--test/CodeCompletion/macros.c5
-rw-r--r--test/CodeCompletion/member-access.c3
-rw-r--r--test/CodeCompletion/member-access.cpp3
-rw-r--r--test/CodeCompletion/namespace-alias.cpp3
-rw-r--r--test/CodeCompletion/namespace.cpp3
-rw-r--r--test/CodeCompletion/nested-name-specifier.cpp3
-rw-r--r--test/CodeCompletion/objc-message.m35
-rw-r--r--test/CodeCompletion/operator.cpp3
-rw-r--r--test/CodeCompletion/ordinary-name.c3
-rw-r--r--test/CodeCompletion/property.m2
-rw-r--r--test/CodeCompletion/tag.c3
-rw-r--r--test/CodeCompletion/tag.cpp3
-rw-r--r--test/CodeCompletion/templates.cpp3
-rw-r--r--test/CodeCompletion/truncation.c5
-rw-r--r--test/CodeCompletion/using-namespace.cpp3
-rw-r--r--test/CodeCompletion/using.cpp3
-rw-r--r--test/CodeGen/2008-07-17-no-emit-on-error.c4
-rw-r--r--test/CodeGen/2008-07-22-bitfield-init-after-zero-len-array.c2
-rw-r--r--test/CodeGen/2008-07-29-override-alias-decl.c18
-rw-r--r--test/CodeGen/2008-07-30-implicit-initialization.c4
-rw-r--r--test/CodeGen/2008-07-31-asm-labels.c14
-rw-r--r--test/CodeGen/2009-10-20-GlobalDebug.c2
-rw-r--r--test/CodeGen/PR2001-bitfield-reload.c4
-rw-r--r--test/CodeGen/PR3589-freestanding-libcalls.c6
-rw-r--r--test/CodeGen/PR3613-static-decl.c2
-rw-r--r--test/CodeGen/PR4611-bitfield-layout.c2
-rw-r--r--test/CodeGen/address-space-field1.c33
-rw-r--r--test/CodeGen/address-space.c8
-rw-r--r--test/CodeGen/alias.c12
-rw-r--r--test/CodeGen/alignof.c2
-rw-r--r--test/CodeGen/always_inline.c8
-rw-r--r--test/CodeGen/arm-arguments.c2
-rw-r--r--test/CodeGen/asm-2.c2
-rw-r--r--test/CodeGen/asm-inout.c2
-rw-r--r--test/CodeGen/asm.c6
-rw-r--r--test/CodeGen/atomic.c22
-rw-r--r--test/CodeGen/attr-nodebug.c2
-rw-r--r--test/CodeGen/attr-noinline.c2
-rw-r--r--test/CodeGen/attr-used.c6
-rw-r--r--test/CodeGen/attributes.c5
-rw-r--r--test/CodeGen/bitfield-assign.c10
-rw-r--r--test/CodeGen/bitfield-promote.c7
-rw-r--r--test/CodeGen/bitfield.c4
-rw-r--r--test/CodeGen/blocks-1.c16
-rw-r--r--test/CodeGen/blocks-2.c6
-rw-r--r--test/CodeGen/blocks-aligned-byref-variable.c2
-rw-r--r--test/CodeGen/blocks-seq.c12
-rw-r--r--test/CodeGen/blocks.c5
-rw-r--r--test/CodeGen/builtin-count-zeros.c2
-rw-r--r--test/CodeGen/builtin-memfns.c8
-rw-r--r--test/CodeGen/builtin-nanf.c2
-rw-r--r--test/CodeGen/builtin-stackaddress.c2
-rw-r--r--test/CodeGen/builtins-ffs_parity_popcount.c2
-rw-r--r--test/CodeGen/builtins-powi.c2
-rw-r--r--test/CodeGen/builtins-x86.c2
-rw-r--r--test/CodeGen/builtins.c4
-rw-r--r--test/CodeGen/c-strings.c8
-rw-r--r--test/CodeGen/cleanup-stack.c2
-rw-r--r--test/CodeGen/compound-type.c4
-rw-r--r--test/CodeGen/conditional.c8
-rw-r--r--test/CodeGen/const-init.c12
-rw-r--r--test/CodeGen/constant-comparison.c2
-rw-r--r--test/CodeGen/constructor-attribute.c10
-rw-r--r--test/CodeGen/darwin-string-literals.c2
-rw-r--r--test/CodeGen/debug-info.c2
-rw-r--r--test/CodeGen/designated-initializers.c4
-rw-r--r--test/CodeGen/dllimport-dllexport.c4
-rw-r--r--test/CodeGen/emit-all-decls.c6
-rw-r--r--test/CodeGen/ext-vector-shuffle.c4
-rw-r--r--test/CodeGen/flexible-array-init.c6
-rw-r--r--test/CodeGen/functions.c8
-rw-r--r--test/CodeGen/global-decls.c13
-rw-r--r--test/CodeGen/init.c4
-rw-r--r--test/CodeGen/inline.c74
-rw-r--r--test/CodeGen/inline2.c2
-rw-r--r--test/CodeGen/libcalls.c10
-rw-r--r--test/CodeGen/lineno-dbginfo.c6
-rw-r--r--test/CodeGen/mandel.c2
-rw-r--r--test/CodeGen/no-common.c6
-rw-r--r--test/CodeGen/object-size.c24
-rw-r--r--test/CodeGen/packed-union.c4
-rw-r--r--test/CodeGen/parameter-passing.c13
-rw-r--r--test/CodeGen/pragma-pack-2.c2
-rw-r--r--test/CodeGen/pragma-pack-3.c2
-rw-r--r--test/CodeGen/predefined-expr.c2
-rw-r--r--test/CodeGen/private-extern.c4
-rw-r--r--test/CodeGen/rdr-6098585-default-after-caserange.c4
-rw-r--r--test/CodeGen/rdr-6098585-default-fallthrough-to-caserange.c2
-rw-r--r--test/CodeGen/rdr-6098585-empty-case-range.c4
-rw-r--r--test/CodeGen/rdr-6098585-fallthrough-to-empty-range.c2
-rw-r--r--test/CodeGen/rdr-6098585-unsigned-caserange.c4
-rw-r--r--test/CodeGen/stack-protector.c19
-rw-r--r--test/CodeGen/staticinit.c4
-rw-r--r--test/CodeGen/stdcall-fastcall.c2
-rw-r--r--test/CodeGen/string-init.c6
-rw-r--r--test/CodeGen/struct-passing.c15
-rw-r--r--test/CodeGen/struct-x86-darwin.c18
-rw-r--r--test/CodeGen/target-data.c13
-rw-r--r--test/CodeGen/tentative-decls.c15
-rw-r--r--test/CodeGen/trapv.c2
-rw-r--r--test/CodeGen/unreachable.c2
-rw-r--r--test/CodeGen/unwind-attr.c2
-rw-r--r--test/CodeGen/visibility.c49
-rw-r--r--test/CodeGen/volatile-1.c6
-rw-r--r--test/CodeGen/volatile.c4
-rw-r--r--test/CodeGen/x86.c16
-rw-r--r--test/CodeGen/x86_32-arguments.c111
-rw-r--r--test/CodeGen/x86_64-arguments.c51
-rw-r--r--test/CodeGenCXX/PR5050-constructor-conversion.cpp9
-rw-r--r--test/CodeGenCXX/array-construction.cpp9
-rw-r--r--test/CodeGenCXX/array-operator-delete-call.cpp63
-rw-r--r--test/CodeGenCXX/array-value-initialize.cpp28
-rw-r--r--test/CodeGenCXX/assign-operator.cpp9
-rw-r--r--test/CodeGenCXX/attr.cpp2
-rw-r--r--test/CodeGenCXX/call-arg-zero-temp.cpp9
-rw-r--r--test/CodeGenCXX/cast-conversion.cpp9
-rw-r--r--test/CodeGenCXX/class-layout.cpp2
-rw-r--r--test/CodeGenCXX/constructor-conversion.cpp9
-rw-r--r--test/CodeGenCXX/constructor-default-arg.cpp9
-rw-r--r--test/CodeGenCXX/constructor-for-array-members.cpp9
-rw-r--r--test/CodeGenCXX/constructor-template.cpp9
-rw-r--r--test/CodeGenCXX/conversion-function.cpp9
-rw-r--r--test/CodeGenCXX/convert-to-fptr.cpp9
-rw-r--r--test/CodeGenCXX/copy-assign-synthesis-1.cpp9
-rw-r--r--test/CodeGenCXX/copy-assign-synthesis.cpp2
-rw-r--r--test/CodeGenCXX/copy-constructor-elim.cpp7
-rw-r--r--test/CodeGenCXX/copy-constructor-synthesis.cpp11
-rw-r--r--test/CodeGenCXX/debug-info.cpp13
-rw-r--r--test/CodeGenCXX/decl-ref-init.cpp9
-rw-r--r--test/CodeGenCXX/default-arg-temps.cpp6
-rw-r--r--test/CodeGenCXX/default-arguments.cpp13
-rw-r--r--test/CodeGenCXX/default-constructor-default-argument.cpp8
-rw-r--r--test/CodeGenCXX/default-constructor-for-members.cpp9
-rw-r--r--test/CodeGenCXX/default-destructor-synthesis.cpp9
-rw-r--r--test/CodeGenCXX/delete-two-arg.cpp6
-rw-r--r--test/CodeGenCXX/delete.cpp2
-rw-r--r--test/CodeGenCXX/derived-to-base-conv.cpp9
-rw-r--r--test/CodeGenCXX/destructors.cpp14
-rw-r--r--test/CodeGenCXX/dyncast.cpp414
-rw-r--r--test/CodeGenCXX/empty-union.cpp10
-rw-r--r--test/CodeGenCXX/explicit-instantiation.cpp2
-rw-r--r--test/CodeGenCXX/extern-c.cpp6
-rw-r--r--test/CodeGenCXX/global-array-destruction.cpp33
-rw-r--r--test/CodeGenCXX/implicit-instantiation-1.cpp11
-rw-r--r--test/CodeGenCXX/init-incomplete-type.cpp12
-rw-r--r--test/CodeGenCXX/instantiate-init-list.cpp13
-rw-r--r--test/CodeGenCXX/mangle-subst.cpp8
-rw-r--r--test/CodeGenCXX/mangle-system-header.cpp7
-rw-r--r--test/CodeGenCXX/mangle.cpp6
-rw-r--r--test/CodeGenCXX/member-expressions.cpp19
-rw-r--r--test/CodeGenCXX/member-function-pointers.cpp6
-rw-r--r--test/CodeGenCXX/member-functions.cpp20
-rw-r--r--test/CodeGenCXX/member-init-struct.cpp18
-rw-r--r--test/CodeGenCXX/member-init-union.cpp10
-rw-r--r--test/CodeGenCXX/member-pointers-zero-init.cpp16
-rw-r--r--test/CodeGenCXX/new-operator-phi.cpp11
-rw-r--r--test/CodeGenCXX/new.cpp3
-rw-r--r--test/CodeGenCXX/ptr-to-member-function.cpp9
-rw-r--r--test/CodeGenCXX/reinterpret-cast.cpp5
-rw-r--r--test/CodeGenCXX/rtti.cpp207
-rw-r--r--test/CodeGenCXX/static-init-1.cpp23
-rw-r--r--test/CodeGenCXX/static-init-2.cpp6
-rw-r--r--test/CodeGenCXX/static-init.cpp4
-rw-r--r--test/CodeGenCXX/temporaries.cpp87
-rw-r--r--test/CodeGenCXX/trivial-constructor-init.cpp5
-rw-r--r--test/CodeGenCXX/typeinfo16
-rw-r--r--test/CodeGenCXX/vararg-conversion-ctor.cpp23
-rw-r--r--test/CodeGenCXX/virt-dtor-gen.cpp10
-rw-r--r--test/CodeGenCXX/virt.cpp675
-rw-r--r--test/CodeGenCXX/virtual-operator-call.cpp10
-rw-r--r--test/CodeGenCXX/virtual-pseudo-destructor-call.cpp10
-rw-r--r--test/CodeGenCXX/x86_64-arguments.cpp7
-rw-r--r--test/CodeGenObjC/bitfield-1.m4
-rw-r--r--test/CodeGenObjC/bitfield-ivar-metadata.m2
-rw-r--r--test/CodeGenObjC/bitfield-ivar-offsets.m19
-rw-r--r--test/CodeGenObjC/blocks-1.m18
-rw-r--r--test/CodeGenObjC/blocks-2.m5
-rw-r--r--test/CodeGenObjC/blocks-3.m4
-rw-r--r--test/CodeGenObjC/blocks.m5
-rw-r--r--test/CodeGenObjC/category-super-class-meth.m2
-rw-r--r--test/CodeGenObjC/class-getter-dotsyntax.m2
-rw-r--r--test/CodeGenObjC/class-type.m4
-rw-r--r--test/CodeGenObjC/constant-strings.m4
-rw-r--r--test/CodeGenObjC/continuation-class.m2
-rw-r--r--test/CodeGenObjC/deadcode_strip_used_var.m6
-rw-r--r--test/CodeGenObjC/debug-info-linkagename.m2
-rw-r--r--test/CodeGenObjC/dot-syntax-1.m4
-rw-r--r--test/CodeGenObjC/dot-syntax.m4
-rw-r--r--test/CodeGenObjC/encode-test-1.m4
-rw-r--r--test/CodeGenObjC/encode-test-2.m10
-rw-r--r--test/CodeGenObjC/encode-test-3.m4
-rw-r--r--test/CodeGenObjC/encode-test-5.m10
-rw-r--r--test/CodeGenObjC/encode-test.m12
-rw-r--r--test/CodeGenObjC/forward-class-impl-metadata.m2
-rw-r--r--test/CodeGenObjC/hidden-visibility.m25
-rw-r--r--test/CodeGenObjC/hidden.m2
-rw-r--r--test/CodeGenObjC/image-info.m2
-rw-r--r--test/CodeGenObjC/implicit-objc_msgSend.m2
-rw-r--r--test/CodeGenObjC/interface-layout-64.m45
-rw-r--r--test/CodeGenObjC/interface.m2
-rw-r--r--test/CodeGenObjC/ivar-layout-64.m11
-rw-r--r--test/CodeGenObjC/ivar-layout-no-optimize.m5
-rw-r--r--test/CodeGenObjC/ivars.m2
-rw-r--r--test/CodeGenObjC/link-errors.m10
-rw-r--r--test/CodeGenObjC/message-arrays.m2
-rw-r--r--test/CodeGenObjC/messages-2.m4
-rw-r--r--test/CodeGenObjC/messages.m13
-rw-r--r--test/CodeGenObjC/metadata-symbols-32.m51
-rw-r--r--test/CodeGenObjC/metadata-symbols-64.m69
-rw-r--r--test/CodeGenObjC/metadata_symbols.m45
-rw-r--r--test/CodeGenObjC/missing-atend-metadata.m24
-rw-r--r--test/CodeGenObjC/newproperty-nested-synthesis-1.m2
-rw-r--r--test/CodeGenObjC/non-lazy-classes.m7
-rw-r--r--test/CodeGenObjC/objc-align.m21
-rw-r--r--test/CodeGenObjC/objc-assign-ivar.m5
-rw-r--r--test/CodeGenObjC/objc-gc-aggr-assign.m2
-rw-r--r--test/CodeGenObjC/objc-read-weak-byref.m9
-rw-r--r--test/CodeGenObjC/objc2-assign-global.m5
-rw-r--r--test/CodeGenObjC/objc2-ivar-assign.m5
-rw-r--r--test/CodeGenObjC/objc2-new-gc-api-strongcast.m5
-rw-r--r--test/CodeGenObjC/objc2-no-write-barrier.m2
-rw-r--r--test/CodeGenObjC/objc2-property-encode.m2
-rw-r--r--test/CodeGenObjC/objc2-protocol-enc.m8
-rw-r--r--test/CodeGenObjC/objc2-strong-cast.m2
-rw-r--r--test/CodeGenObjC/objc2-weak-assign.m2
-rw-r--r--test/CodeGenObjC/objc2-weak-compare.m2
-rw-r--r--test/CodeGenObjC/objc2-weak-import-attribute.m34
-rw-r--r--test/CodeGenObjC/objc2-weak-ivar-debug.m2
-rw-r--r--test/CodeGenObjC/objc2-write-barrier-2.m9
-rw-r--r--test/CodeGenObjC/objc2-write-barrier-3.m7
-rw-r--r--test/CodeGenObjC/objc2-write-barrier-4.m7
-rw-r--r--test/CodeGenObjC/objc2-write-barrier-5.m7
-rw-r--r--test/CodeGenObjC/objc2-write-barrier.m7
-rw-r--r--test/CodeGenObjC/object-incr-decr-1.m2
-rw-r--r--test/CodeGenObjC/overloadable.m4
-rw-r--r--test/CodeGenObjC/property-aggr-type.m2
-rw-r--r--test/CodeGenObjC/property-agrr-getter.m2
-rw-r--r--test/CodeGenObjC/property-complex.m2
-rw-r--r--test/CodeGenObjC/property-getter-dot-syntax.m2
-rw-r--r--test/CodeGenObjC/property-incr-decr-1.m2
-rw-r--r--test/CodeGenObjC/property-setter-attr.m2
-rw-r--r--test/CodeGenObjC/property.m4
-rw-r--r--test/CodeGenObjC/protocol-in-extended-class.m9
-rw-r--r--test/CodeGenObjC/protocol-property-synth.m2
-rw-r--r--test/CodeGenObjC/protocols-lazy.m27
-rw-r--r--test/CodeGenObjC/protocols.m2
-rw-r--r--test/CodeGenObjC/runtime-fns.m6
-rw-r--r--test/CodeGenObjC/super-classmethod-category.m2
-rw-r--r--test/CodeGenObjC/super-message-fragileabi.m32
-rw-r--r--test/CodeGenObjC/synchronized.m4
-rw-r--r--test/CodeGenObjC/synthesize_ivar-cont-class.m2
-rw-r--r--test/CodeGenObjC/synthesize_ivar.m2
-rw-r--r--test/CodeGenObjC/try.m2
-rw-r--r--test/CodeGenObjC/unname-bf-metadata.m2
-rw-r--r--test/CodeGenObjC/variadic-sends.m4
-rw-r--r--test/Coverage/ast-printing.c6
-rw-r--r--test/Coverage/ast-printing.cpp4
-rw-r--r--test/Coverage/ast-printing.m4
-rw-r--r--test/Coverage/codegen-next.m4
-rw-r--r--test/Coverage/codegen.c8
-rw-r--r--test/Coverage/html-diagnostics.c4
-rw-r--r--test/Coverage/parse-callbacks.c2
-rw-r--r--test/Coverage/parse-callbacks.m2
-rw-r--r--test/Coverage/targets.c39
-rw-r--r--test/Driver/Xarch.c17
-rw-r--r--test/Driver/analyze.c2
-rw-r--r--test/Driver/arm-darwin-builtin.c4
-rw-r--r--test/Driver/ast.c12
-rw-r--r--test/Driver/bindings.c97
-rw-r--r--test/Driver/clang-translation.c31
-rw-r--r--test/Driver/clang_cpp.c2
-rw-r--r--test/Driver/clang_f_opts.c21
-rw-r--r--test/Driver/cxx-pth.cpp8
-rw-r--r--test/Driver/darwin-as.c6
-rw-r--r--test/Driver/darwin-cc.c7
-rw-r--r--test/Driver/darwin-ld.c49
-rw-r--r--test/Driver/default-toolchain.c10
-rw-r--r--test/Driver/dragonfly.c2
-rw-r--r--test/Driver/emit-llvm.c2
-rw-r--r--test/Driver/flags.c10
-rw-r--r--test/Driver/freebsd.c4
-rw-r--r--test/Driver/hello.c6
-rw-r--r--test/Driver/immediate-options.c9
-rw-r--r--test/Driver/lto.c31
-rw-r--r--test/Driver/openbsd.c2
-rw-r--r--test/Driver/parsing.c35
-rw-r--r--test/Driver/phases.c25
-rw-r--r--test/Driver/preprocessor.c2
-rw-r--r--test/Driver/pth.c8
-rw-r--r--test/Driver/redzone.c6
-rw-r--r--test/Driver/std.c4
-rw-r--r--test/Driver/unknown-gcc-arch.c14
-rw-r--r--test/Driver/x86_features.c2
-rw-r--r--test/FixIt/fixit-at.c2
-rw-r--r--test/FixIt/fixit-c90.c2
-rw-r--r--test/FixIt/fixit-errors-1.c2
-rw-r--r--test/FixIt/fixit-errors.c12
-rw-r--r--test/FixIt/fixit-objc.m32
-rw-r--r--test/FixIt/fixit-pmem.cpp2
-rw-r--r--test/FixIt/fixit.c14
-rw-r--r--test/FixIt/fixit.cpp11
-rw-r--r--test/Frontend/ast-codegen.c2
-rw-r--r--test/Frontend/ast-main.c6
-rw-r--r--test/Frontend/cpp-output.c13
-rw-r--r--test/Frontend/darwin-version.c45
-rw-r--r--test/Frontend/dependency-gen.c10
-rw-r--r--test/Frontend/rewrite-macros.c11
-rw-r--r--test/Frontend/stdin.c2
-rw-r--r--test/Index/Inputs/c-index-pch.h7
-rw-r--r--test/Index/Inputs/foo.h8
-rw-r--r--test/Index/Inputs/lit.local.cfg1
-rw-r--r--test/Index/Inputs/objc.h11
-rw-r--r--test/Index/Inputs/t1.c28
-rw-r--r--test/Index/Inputs/t1.m20
-rw-r--r--test/Index/Inputs/t2.c11
-rw-r--r--test/Index/Inputs/t2.m13
-rw-r--r--test/Index/TestClassDecl.m52
-rw-r--r--test/Index/TestClassForwardDecl.m46
-rw-r--r--test/Index/c-index-api-loadTU-test.m224
-rw-r--r--test/Index/c-index-api-test.m2
-rw-r--r--test/Index/c-index-getCursor-test.m160
-rw-r--r--test/Index/c-index-pch.c8
-rw-r--r--test/Index/code-completion.cpp53
-rw-r--r--test/Index/comments.c18
-rw-r--r--test/Index/complete-member-access.m30
-rw-r--r--test/Index/complete-objc-message.m107
-rw-r--r--test/Index/complete-protocols.m25
-rw-r--r--test/Index/find-decls.c34
-rw-r--r--test/Index/find-defs.c26
-rw-r--r--test/Index/find-refs.c80
-rw-r--r--test/Index/multiple-redecls.c4
-rw-r--r--test/Index/objc-decls.m24
-rw-r--r--test/Index/objc-message.m60
-rw-r--r--test/Index/resolve-loc.c32
-rw-r--r--test/Lexer/block_cmt_end.c8
-rw-r--r--test/Lexer/counter.c8
-rw-r--r--test/Lexer/digraph.c2
-rw-r--r--test/Lexer/dollar-idents.c6
-rw-r--r--test/Lexer/escape_newline.c4
-rw-r--r--test/Lexer/rdr-6096838.c2
-rw-r--r--test/Lexer/token-concat.c2
-rw-r--r--test/Misc/caret-diags-macros.c14
-rw-r--r--test/Misc/diag-mapping.c16
-rw-r--r--test/Misc/diag-mapping2.c12
-rw-r--r--test/Misc/message-length.c2
-rw-r--r--test/PCH/asm.c4
-rw-r--r--test/PCH/attrs.c4
-rw-r--r--test/PCH/blocks.c4
-rw-r--r--test/PCH/builtins.c4
-rw-r--r--test/PCH/enum.c4
-rw-r--r--test/PCH/exprs.c4
-rw-r--r--test/PCH/ext_vector.c4
-rw-r--r--test/PCH/external-defs.c14
-rw-r--r--test/PCH/functions.c4
-rw-r--r--test/PCH/fuzzy-pch.c6
-rw-r--r--test/PCH/line-directive.c4
-rw-r--r--test/PCH/method_pool.m4
-rw-r--r--test/PCH/multiple_decls.c4
-rw-r--r--test/PCH/nonvisible-external-defs.c4
-rw-r--r--test/PCH/objc_exprs.m4
-rw-r--r--test/PCH/objc_import.m4
-rw-r--r--test/PCH/objc_methods.m4
-rw-r--r--test/PCH/objc_property.m4
-rw-r--r--test/PCH/pr4489.c4
-rw-r--r--test/PCH/preprocess.c11
-rw-r--r--test/PCH/reloc.c4
-rw-r--r--test/PCH/stmts.c4
-rw-r--r--test/PCH/struct.c4
-rw-r--r--test/PCH/tentative-defs.c6
-rw-r--r--test/PCH/types.c4
-rw-r--r--test/PCH/va_arg.c4
-rw-r--r--test/PCH/variables.c4
-rwxr-xr-xtest/Parser/2008-10-31-parse-noop-failure.c2
-rw-r--r--test/Parser/block-block-storageclass.c2
-rw-r--r--test/Parser/control-scope.c2
-rw-r--r--test/Parser/cxx-using-declaration.cpp4
-rw-r--r--test/Parser/objc-init.m18
-rw-r--r--test/Parser/objc-try-catch-1.m2
-rw-r--r--test/Preprocessor/_Pragma-dependency.c2
-rw-r--r--test/Preprocessor/_Pragma-physloc.c2
-rw-r--r--test/Preprocessor/assembler-with-cpp.c5
-rw-r--r--test/Preprocessor/builtin_line.c2
-rw-r--r--test/Preprocessor/comment_save_macro.c4
-rw-r--r--test/Preprocessor/cxx_and.cpp6
-rw-r--r--test/Preprocessor/cxx_bitand.cpp4
-rw-r--r--test/Preprocessor/cxx_bitor.cpp8
-rw-r--r--test/Preprocessor/cxx_compl.cpp4
-rw-r--r--test/Preprocessor/cxx_not.cpp2
-rw-r--r--test/Preprocessor/cxx_not_eq.cpp4
-rw-r--r--test/Preprocessor/cxx_oper_keyword.cpp2
-rw-r--r--test/Preprocessor/cxx_or.cpp6
-rw-r--r--test/Preprocessor/cxx_true.cpp4
-rw-r--r--test/Preprocessor/cxx_xor.cpp8
-rw-r--r--test/Preprocessor/dependencies-and-pp.c8
-rw-r--r--test/Preprocessor/dump-options.c2
-rw-r--r--test/Preprocessor/dump_macros.c16
-rw-r--r--test/Preprocessor/expr_comma.c2
-rw-r--r--test/Preprocessor/expr_invalid_tok.c4
-rw-r--r--test/Preprocessor/expr_liveness.c2
-rw-r--r--test/Preprocessor/feature_tests.c2
-rw-r--r--test/Preprocessor/hash_line.c4
-rw-r--r--test/Preprocessor/header_lookup1.c2
-rw-r--r--test/Preprocessor/if_warning.c2
-rw-r--r--test/Preprocessor/include-pth.c2
-rw-r--r--test/Preprocessor/init.c83
-rw-r--r--test/Preprocessor/line-directive.c4
-rw-r--r--test/Preprocessor/macro-multiline.c6
-rw-r--r--test/Preprocessor/macro_disable.c2
-rw-r--r--test/Preprocessor/macro_expand.c4
-rw-r--r--test/Preprocessor/macro_fn_comma_swallow.c6
-rw-r--r--test/Preprocessor/macro_fn_disable_expand.c2
-rw-r--r--test/Preprocessor/macro_fn_lparen_scan.c6
-rw-r--r--test/Preprocessor/macro_fn_preexpand.c2
-rw-r--r--test/Preprocessor/macro_fn_varargs_iso.c4
-rw-r--r--test/Preprocessor/macro_fn_varargs_named.c4
-rw-r--r--test/Preprocessor/macro_paste_c_block_comment.c4
-rw-r--r--test/Preprocessor/macro_paste_commaext.c8
-rw-r--r--test/Preprocessor/macro_paste_empty.c4
-rw-r--r--test/Preprocessor/macro_paste_hard.c4
-rw-r--r--test/Preprocessor/macro_rescan.c2
-rw-r--r--test/Preprocessor/macro_rescan2.c2
-rw-r--r--test/Preprocessor/objc-pp.m2
-rw-r--r--test/Preprocessor/optimize.c4
-rw-r--r--test/Preprocessor/pic.c19
-rw-r--r--test/Preprocessor/pragma_unknown.c2
-rw-r--r--test/Preprocessor/print_line_track.c8
-rw-r--r--test/Preprocessor/stdint.c593
-rw-r--r--test/Preprocessor/x86_target_features.c55
-rw-r--r--test/Rewriter/objc-ivar-receiver-1.m2
-rw-r--r--test/Sema/128bitint.c5
-rw-r--r--test/Sema/PR2727.c2
-rw-r--r--test/Sema/PR2728.c2
-rw-r--r--test/Sema/attr-format_arg.c2
-rw-r--r--test/Sema/attr-malloc.c6
-rw-r--r--test/Sema/block-byref-args.c2
-rw-r--r--test/Sema/block-storageclass.c2
-rw-r--r--test/Sema/builtin-object-size.c2
-rw-r--r--test/Sema/callingconv.c4
-rw-r--r--test/Sema/check-increment.c2
-rw-r--r--test/Sema/compare.c207
-rw-r--r--test/Sema/conditional-expr.c2
-rw-r--r--test/Sema/const-eval.c7
-rw-r--r--test/Sema/conversion-64-32.c5
-rw-r--r--test/Sema/conversion.c237
-rw-r--r--test/Sema/expr-comma-c89.c1
-rw-r--r--test/Sema/expr-comma.c1
-rw-r--r--test/Sema/format-attr-pr4470.c2
-rw-r--r--test/Sema/format-strings.c19
-rw-r--r--test/Sema/i-c-e.c2
-rw-r--r--test/Sema/implicit-builtin-redecl.c2
-rw-r--r--test/Sema/implicit-def.c2
-rw-r--r--test/Sema/parentheses.c2
-rw-r--r--test/Sema/pointer-conversion.c10
-rw-r--r--test/Sema/pragma-pack-4.c2
-rw-r--r--test/Sema/return.c2
-rw-r--r--test/Sema/shift.c2
-rw-r--r--test/Sema/ucn-cstring.c2
-rw-r--r--test/Sema/varargs.c2
-rw-r--r--test/Sema/wchar.c20
-rw-r--r--test/Sema/x86-intrinsics-headers.c4
-rw-r--r--test/SemaCXX/__null.cpp2
-rw-r--r--test/SemaCXX/arrow-operator.cpp7
-rw-r--r--test/SemaCXX/builtins.cpp7
-rw-r--r--test/SemaCXX/cast-conversion.cpp25
-rw-r--r--test/SemaCXX/compare.cpp204
-rw-r--r--test/SemaCXX/composite-pointer-type.cpp12
-rw-r--r--test/SemaCXX/conditional-expr.cpp2
-rw-r--r--test/SemaCXX/constructor-initializer.cpp26
-rw-r--r--test/SemaCXX/conversion-function.cpp30
-rw-r--r--test/SemaCXX/decltype-this.cpp3
-rw-r--r--test/SemaCXX/default-constructor-initializers.cpp16
-rw-r--r--test/SemaCXX/dependent-types.cpp2
-rw-r--r--test/SemaCXX/format-attribute.cpp8
-rw-r--r--test/SemaCXX/friend-class-nodecl.cpp2
-rw-r--r--test/SemaCXX/linkage-spec.cpp9
-rw-r--r--test/SemaCXX/member-expr.cpp3
-rw-r--r--test/SemaCXX/member-pointer-size.cpp2
-rw-r--r--test/SemaCXX/new-delete.cpp57
-rw-r--r--test/SemaCXX/overload-call.cpp13
-rw-r--r--test/SemaCXX/overloaded-builtin-operators.cpp13
-rw-r--r--test/SemaCXX/overloaded-operator.cpp9
-rw-r--r--test/SemaCXX/pseudo-destructors.cpp2
-rw-r--r--test/SemaCXX/static-cast.cpp42
-rw-r--r--test/SemaCXX/using-decl-1.cpp21
-rw-r--r--test/SemaCXX/using-decl-templates.cpp4
-rw-r--r--test/SemaCXX/value-initialization.cpp4
-rw-r--r--test/SemaCXX/vararg-default-arg.cpp10
-rw-r--r--test/SemaCXX/vararg-non-pod.cpp2
-rw-r--r--test/SemaCXX/warn-for-var-in-else.cpp14
-rw-r--r--test/SemaCXX/warn-unused-variables.cpp28
-rw-r--r--test/SemaObjC/atomoic-property-synnthesis-rules.m369
-rw-r--r--test/SemaObjC/call-super-2.m10
-rw-r--r--test/SemaObjC/class-method-lookup.m2
-rw-r--r--test/SemaObjC/compare-qualified-id.m5
-rw-r--r--test/SemaObjC/continuation-class-err.m2
-rw-r--r--test/SemaObjC/deref-interface.m2
-rw-r--r--test/SemaObjC/idiomatic-parentheses.m35
-rw-r--r--test/SemaObjC/ivar-sem-check-2.m2
-rw-r--r--test/SemaObjC/method-arg-decay.m5
-rw-r--r--test/SemaObjC/objc-string-constant.m2
-rw-r--r--test/SemaObjC/property-category-1.m1
-rw-r--r--test/SemaObjC/property-nonfragile-abi.m2
-rw-r--r--test/SemaObjC/sizeof-interface.m2
-rw-r--r--test/SemaObjC/static-ivar-ref-1.m2
-rw-r--r--test/SemaObjC/string.m2
-rw-r--r--test/SemaObjC/synthesized-ivar.m2
-rw-r--r--test/SemaObjC/unused.m5
-rw-r--r--test/SemaObjC/warn-selector-selection.m2
-rw-r--r--test/SemaTemplate/class-template-decl.cpp8
-rw-r--r--test/SemaTemplate/class-template-spec.cpp7
-rw-r--r--test/SemaTemplate/constructor-template.cpp32
-rw-r--r--test/SemaTemplate/deduction.cpp83
-rw-r--r--test/SemaTemplate/default-arguments.cpp81
-rw-r--r--test/SemaTemplate/default-expr-arguments.cpp40
-rw-r--r--test/SemaTemplate/enum-argument.cpp16
-rw-r--r--test/SemaTemplate/example-dynarray.cpp2
-rw-r--r--test/SemaTemplate/instantiate-attr.cpp7
-rw-r--r--test/SemaTemplate/instantiate-decl-init.cpp22
-rw-r--r--test/SemaTemplate/instantiate-member-pointers.cpp30
-rw-r--r--test/SemaTemplate/instantiate-member-template.cpp13
-rw-r--r--test/SemaTemplate/instantiate-overloaded-arrow.cpp20
-rw-r--r--test/SemaTemplate/instantiate-template-template-parm.cpp27
-rw-r--r--test/SemaTemplate/instantiate-using-decl.cpp3
-rw-r--r--test/SemaTemplate/instantiation-default-2.cpp2
-rw-r--r--test/SemaTemplate/member-function-template.cpp24
-rw-r--r--test/SemaTemplate/nested-name-spec-template.cpp17
-rw-r--r--test/SemaTemplate/nested-template.cpp18
-rw-r--r--test/SemaTemplate/operator-template.cpp2
-rw-r--r--test/SemaTemplate/temp_arg_nontype.cpp3
-rw-r--r--test/SemaTemplate/temp_arg_template.cpp7
-rw-r--r--test/SemaTemplate/value-dependent-null-pointer-constant.cpp2
-rw-r--r--test/lit.cfg8
-rw-r--r--test/lit.site.cfg.in9
627 files changed, 6999 insertions, 2802 deletions
diff --git a/test/Analysis/CFDateGC.m b/test/Analysis/CFDateGC.m
index 557e7e8..b23998c 100644
--- a/test/Analysis/CFDateGC.m
+++ b/test/Analysis/CFDateGC.m
@@ -1,8 +1,8 @@
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify -fobjc-gc -analyzer-constraints=basic %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify -fobjc-gc -analyzer-constraints=range %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify -fobjc-gc -disable-free %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify -fobjc-gc %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify -fobjc-gc %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -verify -fobjc-gc -analyzer-constraints=basic %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -verify -fobjc-gc -analyzer-constraints=range %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -verify -fobjc-gc -disable-free %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify -fobjc-gc %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify -fobjc-gc %s
//===----------------------------------------------------------------------===//
// The following code is reduced using delta-debugging from
diff --git a/test/Analysis/CFNumber.c b/test/Analysis/CFNumber.c
index f62d2ab..f3d371c 100644
--- a/test/Analysis/CFNumber.c
+++ b/test/Analysis/CFNumber.c
@@ -1,7 +1,7 @@
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify -triple x86_64-apple-darwin9 %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify -triple x86_64-apple-darwin9 %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify -triple x86_64-apple-darwin9 %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify -triple x86_64-apple-darwin9 %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s
typedef signed long CFIndex;
typedef const struct __CFAllocator * CFAllocatorRef;
diff --git a/test/Analysis/CFRetainRelease_NSAssertionHandler.m b/test/Analysis/CFRetainRelease_NSAssertionHandler.m
index 1ff9507..04e9add 100644
--- a/test/Analysis/CFRetainRelease_NSAssertionHandler.m
+++ b/test/Analysis/CFRetainRelease_NSAssertionHandler.m
@@ -1,7 +1,7 @@
-// RUN: clang-cc -analyze -checker-cfref -verify %s -analyzer-constraints=basic -analyzer-store=basic &&
-// RUN: clang-cc -analyze -checker-cfref -verify %s -analyzer-constraints=range -analyzer-store=basic &&
-// RUN: clang-cc -analyze -checker-cfref -verify %s -analyzer-constraints=basic -analyzer-store=region &&
-// RUN: clang-cc -analyze -checker-cfref -verify %s -analyzer-constraints=range -analyzer-store=region
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -verify %s -analyzer-constraints=basic -analyzer-store=basic
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -verify %s -analyzer-constraints=range -analyzer-store=basic
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -verify %s -analyzer-constraints=basic -analyzer-store=region
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -verify %s -analyzer-constraints=range -analyzer-store=region
typedef struct objc_selector *SEL;
typedef signed char BOOL;
diff --git a/test/Analysis/CGColorSpace.c b/test/Analysis/CGColorSpace.c
index 2887d47..ae62898 100644
--- a/test/Analysis/CGColorSpace.c
+++ b/test/Analysis/CGColorSpace.c
@@ -1,7 +1,7 @@
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
typedef struct CGColorSpace *CGColorSpaceRef;
extern CGColorSpaceRef CGColorSpaceCreateDeviceRGB(void);
diff --git a/test/Analysis/CheckNSError.m b/test/Analysis/CheckNSError.m
index 5f92594..219354b 100644
--- a/test/Analysis/CheckNSError.m
+++ b/test/Analysis/CheckNSError.m
@@ -1,7 +1,7 @@
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
typedef signed char BOOL;
diff --git a/test/Analysis/MissingDealloc.m b/test/Analysis/MissingDealloc.m
index 41498e5..3942391 100644
--- a/test/Analysis/MissingDealloc.m
+++ b/test/Analysis/MissingDealloc.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -analyze -warn-objc-missing-dealloc '-DIBOutlet=__attribute__((iboutlet))' %s --verify
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -warn-objc-missing-dealloc '-DIBOutlet=__attribute__((iboutlet))' %s --verify
typedef signed char BOOL;
@protocol NSObject
- (BOOL)isEqual:(id)object;
diff --git a/test/Analysis/NSPanel.m b/test/Analysis/NSPanel.m
index 801620a..20e3eff 100644
--- a/test/Analysis/NSPanel.m
+++ b/test/Analysis/NSPanel.m
@@ -1,7 +1,7 @@
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
// BEGIN delta-debugging reduced header stuff
diff --git a/test/Analysis/NSString.m b/test/Analysis/NSString.m
index a360075..481a940 100644
--- a/test/Analysis/NSString.m
+++ b/test/Analysis/NSString.m
@@ -1,13 +1,13 @@
-// RUN: clang-cc -triple i386-apple-darwin10 -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s &&
-// RUN: clang-cc -triple i386-apple-darwin10 -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s &&
-// RUN: clang-cc -DTEST_64 -triple x86_64-apple-darwin10 -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s &&
-// RUN: clang-cc -DTEST_64 -triple x86_64-apple-darwin10 -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
+// RUN: clang-cc -triple i386-apple-darwin10 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s
+// RUN: clang-cc -triple i386-apple-darwin10 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
+// RUN: clang-cc -DTEST_64 -triple x86_64-apple-darwin10 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s
+// RUN: clang-cc -DTEST_64 -triple x86_64-apple-darwin10 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
// ==-- FIXME: -analyzer-store=basic fails on this file (false negatives). --==
-// NOTWORK: clang-cc -triple i386-apple-darwin10 -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s &&
-// NOTWORK: clang-cc -triple i386-apple-darwin10 -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s &&
-// NOTWORK: clang-cc -DTEST_64 -triple x86_64-apple-darwin10 -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s &&
-// NOTWORK: clang-cc -DTEST_64 -triple x86_64-apple-darwin10 -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s
+// NOTWORK: clang-cc -triple i386-apple-darwin10 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s &&
+// NOTWORK: clang-cc -triple i386-apple-darwin10 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s &&
+// NOTWORK: clang-cc -DTEST_64 -triple x86_64-apple-darwin10 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s &&
+// NOTWORK: clang-cc -DTEST_64 -triple x86_64-apple-darwin10 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s
//===----------------------------------------------------------------------===//
// The following code is reduced using delta-debugging from
@@ -371,5 +371,4 @@ void test_synchronized(id x) {
NSString *string = [[NSString stringWithFormat:@"%ld", (long) 100] retain]; // expected-warning {{leak}}
}
}
-
-
+@end
diff --git a/test/Analysis/NSWindow.m b/test/Analysis/NSWindow.m
index 9609c52..5eb6cf1 100644
--- a/test/Analysis/NSWindow.m
+++ b/test/Analysis/NSWindow.m
@@ -1,7 +1,7 @@
-// RUN: clang-cc -analyze -checker-cfref -warn-dead-stores -analyzer-store=basic -analyzer-constraints=basic -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -warn-dead-stores -analyzer-store=basic -analyzer-constraints=range -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -warn-dead-stores -analyzer-store=region -analyzer-constraints=basic -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -warn-dead-stores -analyzer-store=region -analyzer-constraints=range -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -warn-dead-stores -analyzer-store=basic -analyzer-constraints=basic -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -warn-dead-stores -analyzer-store=basic -analyzer-constraints=range -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -warn-dead-stores -analyzer-store=region -analyzer-constraints=basic -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -warn-dead-stores -analyzer-store=region -analyzer-constraints=range -verify %s
// These declarations were reduced using Delta-Debugging from Foundation.h
// on Mac OS X. The test cases are below.
diff --git a/test/Analysis/NoReturn.m b/test/Analysis/NoReturn.m
index 5f5ce28..cf708b4 100644
--- a/test/Analysis/NoReturn.m
+++ b/test/Analysis/NoReturn.m
@@ -1,7 +1,7 @@
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
#include <stdarg.h>
diff --git a/test/Analysis/ObjCProperties.m b/test/Analysis/ObjCProperties.m
index 3ad2569..6c367f4 100644
--- a/test/Analysis/ObjCProperties.m
+++ b/test/Analysis/ObjCProperties.m
@@ -1,7 +1,7 @@
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic %s -verify &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range %s -verify &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic %s -verify &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range %s -verify
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=basic %s -verify
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=range %s -verify
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=basic %s -verify
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range %s -verify
// The point of this test cases is to exercise properties in the static
// analyzer
diff --git a/test/Analysis/ObjCRetSigs.m b/test/Analysis/ObjCRetSigs.m
index 0d69916..60a85fd 100644
--- a/test/Analysis/ObjCRetSigs.m
+++ b/test/Analysis/ObjCRetSigs.m
@@ -1,6 +1,6 @@
-// RUN: clang-cc -analyze -warn-objc-methodsigs -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -warn-objc-methodsigs -verify %s
-#include <stdio.h>
+int printf(const char *, ...);
@interface MyBase
-(long long)length;
diff --git a/test/Analysis/PR2599.m b/test/Analysis/PR2599.m
index 098bfe8..fd5ae95 100644
--- a/test/Analysis/PR2599.m
+++ b/test/Analysis/PR2599.m
@@ -1,7 +1,7 @@
-// RUN: clang-cc -analyze -analyzer-constraints=basic -analyzer-store=basic -checker-cfref -fobjc-gc -verify %s &&
-// RUN: clang-cc -analyze -analyzer-constraints=range -analyzer-store=basic -checker-cfref -fobjc-gc -verify %s &&
-// RUN: clang-cc -analyze -analyzer-constraints=basic -analyzer-store=basic -checker-cfref -fobjc-gc -verify %s &&
-// RUN: clang-cc -analyze -analyzer-constraints=range -analyzer-store=region -checker-cfref -fobjc-gc -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -analyzer-constraints=basic -analyzer-store=basic -checker-cfref -fobjc-gc -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -analyzer-constraints=range -analyzer-store=basic -checker-cfref -fobjc-gc -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -analyzer-constraints=basic -analyzer-store=basic -checker-cfref -fobjc-gc -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -analyzer-constraints=range -analyzer-store=region -checker-cfref -fobjc-gc -verify %s
typedef const void * CFTypeRef;
typedef const struct __CFString * CFStringRef;
diff --git a/test/Analysis/PR2978.m b/test/Analysis/PR2978.m
index 0cb3dea..8a94fe8 100644
--- a/test/Analysis/PR2978.m
+++ b/test/Analysis/PR2978.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -analyze -warn-objc-missing-dealloc %s -verify
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -warn-objc-missing-dealloc %s -verify
// Tests for the checker which checks missing/extra ivar 'release' calls
// in dealloc.
diff --git a/test/Analysis/PR3991.m b/test/Analysis/PR3991.m
index bbc1377..53a6b52 100644
--- a/test/Analysis/PR3991.m
+++ b/test/Analysis/PR3991.m
@@ -1,7 +1,7 @@
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify -triple x86_64-apple-darwin9 %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify -triple x86_64-apple-darwin9 %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify -triple x86_64-apple-darwin9 %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify -triple x86_64-apple-darwin9 %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s
//===----------------------------------------------------------------------===//
// Delta-debugging produced forward declarations.
@@ -42,7 +42,15 @@ typedef struct _NSZone NSZone;
- (unsigned int)currentPathComponentIndex;
- (void)setCurrentPathComponentIndex:(unsigned int)aCurrentPathComponentIndex;
- (NSURL *)folderFeedURL;
-@end @implementation IHGoogleDocsAdapter - (id)initWithUsername:(NSString *)inUsername password:(NSString *)inPassword owner:(NSObject <IHGoogleDocsAdapterDelegate> *)owner {
+@end
+
+@implementation IHGoogleDocsAdapter - (id)initWithUsername:(NSString *)inUsername password:(NSString *)inPassword owner:(NSObject <IHGoogleDocsAdapterDelegate> *)owner { // expected-warning {{incomplete implementation}} \
+// expected-warning {{method definition for 'entries' not found}} \
+// expected-warning {{method definition for 'feedDocList' not found}} \
+// expected-warning {{method definition for 'directoryPathComponents' not found}} \
+// expected-warning {{method definition for 'currentPathComponentIndex' not found}} \
+// expected-warning {{method definition for 'setCurrentPathComponentIndex:' not found}} \
+// expected-warning {{method definition for 'folderFeedURL' not found}}
return 0;
}
@@ -66,3 +74,4 @@ typedef struct _NSZone NSZone;
}
}
}
+@end
diff --git a/test/Analysis/array-struct.c b/test/Analysis/array-struct.c
index d6b6076..c3822cd 100644
--- a/test/Analysis/array-struct.c
+++ b/test/Analysis/array-struct.c
@@ -1,7 +1,7 @@
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
struct s {
int data;
@@ -120,7 +120,7 @@ struct s1 {
// building: a->e, e->d. Only then 'a' could be added to live region roots.
void f13(double timeout) {
struct s1 a;
- a.e.d = (long) timeout;
+ a.e.d = (int) timeout;
if (a.e.d == 10)
a.e.d = 4;
}
@@ -153,7 +153,7 @@ struct s3 p[1];
// an ElementRegion of type 'char'. Then load a nonloc::SymbolVal from it and
// assigns to 'a'.
void f16(struct s3 *p) {
- struct s3 a = *((struct s3*) ((char*) &p[0]));
+ struct s3 a = *((struct s3*) ((char*) &p[0])); // expected-warning{{Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption.}}
}
void inv(struct s1 *);
diff --git a/test/Analysis/casts.c b/test/Analysis/casts.c
index ae51ffb..fc9e27b 100644
--- a/test/Analysis/casts.c
+++ b/test/Analysis/casts.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -checker-cfref -analyzer-store=region --verify %s
+// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region --verify %s
// Test if the 'storage' region gets properly initialized after it is cast to
// 'struct sockaddr *'.
diff --git a/test/Analysis/casts.m b/test/Analysis/casts.m
index 82c29fa..4e201bf 100644
--- a/test/Analysis/casts.m
+++ b/test/Analysis/casts.m
@@ -1,5 +1,5 @@
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic --verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region --verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic --verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region --verify %s
// Test function pointer casts. Currently we track function addresses using
// loc::FunctionVal. Because casts can be arbitrary, do we need to model
diff --git a/test/Analysis/cfref_PR2519.c b/test/Analysis/cfref_PR2519.c
index 695123b..ee1da1f 100644
--- a/test/Analysis/cfref_PR2519.c
+++ b/test/Analysis/cfref_PR2519.c
@@ -1,7 +1,7 @@
-// RUN: clang-cc -analyze -checker-cfref --analyzer-store=basic -analyzer-constraints=basic -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref --analyzer-store=basic -analyzer-constraints=range -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref --analyzer-store=region -analyzer-constraints=basic -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref --analyzer-store=region -analyzer-constraints=range -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=basic -analyzer-constraints=basic -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=basic -analyzer-constraints=range -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=region -analyzer-constraints=basic -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=region -analyzer-constraints=range -verify %s
typedef unsigned char Boolean;
typedef signed long CFIndex;
diff --git a/test/Analysis/cfref_rdar6080742.c b/test/Analysis/cfref_rdar6080742.c
index 9bbaf9b..a2b7477 100644
--- a/test/Analysis/cfref_rdar6080742.c
+++ b/test/Analysis/cfref_rdar6080742.c
@@ -1,7 +1,7 @@
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
// This test case was reported in <rdar:problem/6080742>.
// It tests path-sensitivity with respect to '!(cfstring != 0)' (negation of inequality).
diff --git a/test/Analysis/complex.c b/test/Analysis/complex.c
index 3633b21..6b71a93 100644
--- a/test/Analysis/complex.c
+++ b/test/Analysis/complex.c
@@ -1,7 +1,7 @@
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
#include <stdint.h>
diff --git a/test/Analysis/concrete-address.c b/test/Analysis/concrete-address.c
index 84ebb21..31802d0 100644
--- a/test/Analysis/concrete-address.c
+++ b/test/Analysis/concrete-address.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic --verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region --verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic --verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region --verify %s
void foo() {
int *p = (int*) 0x10000; // Should not crash here.
diff --git a/test/Analysis/conditional-op-missing-lhs.c b/test/Analysis/conditional-op-missing-lhs.c
index bebf155..ed81d7b 100644
--- a/test/Analysis/conditional-op-missing-lhs.c
+++ b/test/Analysis/conditional-op-missing-lhs.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -analyze -warn-dead-stores -warn-uninit-values -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -warn-dead-stores -warn-uninit-values -verify %s
void f1()
{
diff --git a/test/Analysis/dead-stores.c b/test/Analysis/dead-stores.c
index c4ff7fa..811ac81 100644
--- a/test/Analysis/dead-stores.c
+++ b/test/Analysis/dead-stores.c
@@ -1,8 +1,8 @@
-// RUN: clang-cc -analyze -warn-dead-stores -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -warn-dead-stores -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -warn-dead-stores -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -warn-dead-stores -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -warn-dead-stores -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -warn-dead-stores -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -warn-dead-stores -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=range -warn-dead-stores -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=basic -warn-dead-stores -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -warn-dead-stores -verify %s
void f1() {
int k, y;
diff --git a/test/Analysis/dead-stores.cpp b/test/Analysis/dead-stores.cpp
index 9ddb797..0bf3256 100644
--- a/test/Analysis/dead-stores.cpp
+++ b/test/Analysis/dead-stores.cpp
@@ -1,8 +1,8 @@
-// RUN: clang-cc -analyze -warn-dead-stores -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -warn-dead-stores -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -warn-dead-stores -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -warn-dead-stores -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -warn-dead-stores -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -warn-dead-stores -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -warn-dead-stores -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=range -warn-dead-stores -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=basic -warn-dead-stores -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -warn-dead-stores -verify %s
int j;
void f1() {
diff --git a/test/Analysis/dead-stores.m b/test/Analysis/dead-stores.m
index 218cb44..0a5c0f8 100644
--- a/test/Analysis/dead-stores.m
+++ b/test/Analysis/dead-stores.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -analyze -warn-dead-stores -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -warn-dead-stores -verify %s
typedef signed char BOOL;
typedef unsigned int NSUInteger;
diff --git a/test/Analysis/delegates.m b/test/Analysis/delegates.m
index 440f311..b854da6 100644
--- a/test/Analysis/delegates.m
+++ b/test/Analysis/delegates.m
@@ -1,5 +1,5 @@
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify %s
//===----------------------------------------------------------------------===//
diff --git a/test/Analysis/elementtype.c b/test/Analysis/elementtype.c
index 2bdaad4..b6873ad 100644
--- a/test/Analysis/elementtype.c
+++ b/test/Analysis/elementtype.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region %s
typedef struct added_obj_st {
int type;
diff --git a/test/Analysis/exercise-ps.c b/test/Analysis/exercise-ps.c
index 1e31b18..098ec48 100644
--- a/test/Analysis/exercise-ps.c
+++ b/test/Analysis/exercise-ps.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify %s
//
// Just exercise the analyzer on code that has at one point caused issues
// (i.e., no assertions or crashes).
diff --git a/test/Analysis/fields.c b/test/Analysis/fields.c
index 900a6d6..d6bc845 100644
--- a/test/Analysis/fields.c
+++ b/test/Analysis/fields.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -analyze -checker-cfref %s --analyzer-store=basic -verify &&
-// RUN: clang-cc -analyze -checker-cfref %s --analyzer-store=region -verify
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref %s --analyzer-store=basic -verify
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref %s --analyzer-store=region -verify
unsigned foo();
typedef struct bf { unsigned x:2; } bf;
diff --git a/test/Analysis/func.c b/test/Analysis/func.c
index 2b4e7b0..390a279 100644
--- a/test/Analysis/func.c
+++ b/test/Analysis/func.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify %s
void f(void) {
void (*p)(void);
diff --git a/test/Analysis/malloc.c b/test/Analysis/malloc.c
new file mode 100644
index 0000000..6a17cba
--- /dev/null
+++ b/test/Analysis/malloc.c
@@ -0,0 +1,37 @@
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-experimental-checks -analyzer-store=region -verify %s
+typedef __typeof(sizeof(int)) size_t;
+void *malloc(size_t);
+void free(void *);
+
+void f1() {
+ int *p = malloc(10);
+ return; // expected-warning{{Allocated memory never released. Potential memory leak.}}
+}
+
+void f1_b() {
+ int *p = malloc(10); // expected-warning{{Allocated memory never released. Potential memory leak.}}
+}
+
+void f2() {
+ int *p = malloc(10);
+ free(p);
+ free(p); // expected-warning{{Try to free a memory block that has been released}}
+}
+
+// This case tests that storing malloc'ed memory to a static variable which is
+// then returned is not leaked. In the absence of known contracts for functions
+// or inter-procedural analysis, this is a conservative answer.
+int *f3() {
+ static int *p = 0;
+ p = malloc(10);
+ return p; // no-warning
+}
+
+// This case tests that storing malloc'ed memory to a static global variable
+// which is then returned is not leaked. In the absence of known contracts for
+// functions or inter-procedural analysis, this is a conservative answer.
+static int *p_f4 = 0;
+int *f4() {
+ p_f4 = malloc(10);
+ return p_f4; // no-warning
+}
diff --git a/test/Analysis/misc-ps-64.m b/test/Analysis/misc-ps-64.m
index 163da4b..506dc8b 100644
--- a/test/Analysis/misc-ps-64.m
+++ b/test/Analysis/misc-ps-64.m
@@ -1,7 +1,7 @@
-// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -checker-cfref --analyzer-store=basic -analyzer-constraints=basic --verify -fblocks %s &&
-// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -checker-cfref --analyzer-store=basic -analyzer-constraints=range --verify -fblocks %s &&
-// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -checker-cfref --analyzer-store=region -analyzer-constraints=basic --verify -fblocks %s &&
-// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -checker-cfref --analyzer-store=region -analyzer-constraints=range --verify -fblocks %s
+// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=basic -analyzer-constraints=basic --verify -fblocks %s
+// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=basic -analyzer-constraints=range --verify -fblocks %s
+// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=region -analyzer-constraints=basic --verify -fblocks %s
+// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=region -analyzer-constraints=range --verify -fblocks %s
// <rdar://problem/6440393> - A bunch of misc. failures involving evaluating
// these expressions and building CFGs. These tests are here to prevent
diff --git a/test/Analysis/misc-ps-basic-store.m b/test/Analysis/misc-ps-basic-store.m
index c6ae20c..2b99134 100644
--- a/test/Analysis/misc-ps-basic-store.m
+++ b/test/Analysis/misc-ps-basic-store.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -analyze -checker-cfref --analyzer-store=basic --verify -fblocks %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=basic --verify -fblocks %s
//---------------------------------------------------------------------------
// Test case 'checkaccess_union' differs for region store and basic store.
diff --git a/test/Analysis/misc-ps-eager-assume.m b/test/Analysis/misc-ps-eager-assume.m
index db1a80b..66eb125 100644
--- a/test/Analysis/misc-ps-eager-assume.m
+++ b/test/Analysis/misc-ps-eager-assume.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -analyze -checker-cfref --analyzer-store=region -analyzer-constraints=range --verify -fblocks %s -analyzer-eagerly-assume
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=region -analyzer-constraints=range --verify -fblocks %s -analyzer-eagerly-assume
// Delta-reduced header stuff (needed for test cases).
typedef signed char BOOL;
diff --git a/test/Analysis/misc-ps-ranges.m b/test/Analysis/misc-ps-ranges.m
index a191bec..49cc593 100644
--- a/test/Analysis/misc-ps-ranges.m
+++ b/test/Analysis/misc-ps-ranges.m
@@ -1,5 +1,5 @@
-// RUN: clang-cc -analyze -checker-cfref --analyzer-store=basic -analyzer-constraints=range --verify -fblocks %s &&
-// RUN: clang-cc -analyze -checker-cfref --analyzer-store=region -analyzer-constraints=range --verify -fblocks %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=basic -analyzer-constraints=range --verify -fblocks %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=region -analyzer-constraints=range --verify -fblocks %s
// <rdar://problem/6776949>
// main's 'argc' argument is always > 0
@@ -20,4 +20,4 @@ int main(int argc, char* argv[]) {
}
return *p; // no-warning
-} \ No newline at end of file
+}
diff --git a/test/Analysis/misc-ps-region-store-i386.m b/test/Analysis/misc-ps-region-store-i386.m
index c2c4d5b..a833a65 100644
--- a/test/Analysis/misc-ps-region-store-i386.m
+++ b/test/Analysis/misc-ps-region-store-i386.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-apple-darwin9 -analyze -checker-cfref --analyzer-store=region --verify -fblocks %s
+// RUN: clang-cc -triple i386-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=region --verify -fblocks %s
// Here is a case where a pointer is treated as integer, invalidated as an
// integer, and then used again as a pointer. This test just makes sure
diff --git a/test/Analysis/misc-ps-region-store-x86_64.m b/test/Analysis/misc-ps-region-store-x86_64.m
index 154ffaf..7e614fd 100644
--- a/test/Analysis/misc-ps-region-store-x86_64.m
+++ b/test/Analysis/misc-ps-region-store-x86_64.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -checker-cfref --analyzer-store=region --verify -fblocks %s
+// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=region --verify -fblocks %s
// Here is a case where a pointer is treated as integer, invalidated as an
// integer, and then used again as a pointer. This test just makes sure
diff --git a/test/Analysis/misc-ps-region-store.m b/test/Analysis/misc-ps-region-store.m
index 4cde772..7ebc4a9 100644
--- a/test/Analysis/misc-ps-region-store.m
+++ b/test/Analysis/misc-ps-region-store.m
@@ -1,5 +1,5 @@
-// RUN: clang-cc -triple i386-apple-darwin9 -analyze -checker-cfref --analyzer-store=region --verify -fblocks %s &&
-// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -checker-cfref --analyzer-store=region --verify -fblocks %s
+// RUN: clang-cc -triple i386-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=region --verify -fblocks %s
+// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=region --verify -fblocks %s
typedef struct objc_selector *SEL;
typedef signed char BOOL;
@@ -286,7 +286,7 @@ struct WrappedStruct { unsigned z; };
int test_handle_array_wrapper() {
struct ArrayWrapper x;
test_handle_array_wrapper(&x);
- struct WrappedStruct *p = (struct WrappedStruct*) x.y;
+ struct WrappedStruct *p = (struct WrappedStruct*) x.y; // expected-warning{{Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption.}}
return p->z; // no-warning
}
@@ -431,3 +431,42 @@ pr5316_REFRESH_ELEMENT;
static void pr5316(pr5316_REFRESH_ELEMENT *dst, const pr5316_REFRESH_ELEMENT *src) {
while ((*dst++ = *src++).chr != L'\0') ;
}
+
+//===----------------------------------------------------------------------===//
+// Exercise creating ElementRegion with symbolic super region.
+//===----------------------------------------------------------------------===//
+void element_region_with_symbolic_superregion(int* p) {
+ int *x;
+ int a;
+ if (p[0] == 1)
+ x = &a;
+ if (p[0] == 1)
+ (void)*x; // no-warning
+}
+
+//===----------------------------------------------------------------------===//
+// Test returning an out-of-bounds pointer (CWE-466)
+//===----------------------------------------------------------------------===//
+
+static int test_cwe466_return_outofbounds_pointer_a[10];
+int *test_cwe466_return_outofbounds_pointer() {
+ int *p = test_cwe466_return_outofbounds_pointer_a+10;
+ return p; // expected-warning{{Returned pointer value points outside the original object}}
+}
+
+//===----------------------------------------------------------------------===//
+// PR 3135 - Test case that shows that a variable may get invalidated when its
+// address is included in a structure that is passed-by-value to an unknown function.
+//===----------------------------------------------------------------------===//
+
+typedef struct { int *a; } pr3135_structure;
+int pr3135_bar(pr3135_structure *x);
+int pr3135() {
+ int x;
+ pr3135_structure y = { &x };
+ // the call to pr3135_bar may initialize x
+ if (pr3135_bar(&y) && x) // no-warning
+ return 1;
+ return 0;
+}
+
diff --git a/test/Analysis/misc-ps.m b/test/Analysis/misc-ps.m
index 80e20c1..d2eef0d 100644
--- a/test/Analysis/misc-ps.m
+++ b/test/Analysis/misc-ps.m
@@ -1,8 +1,8 @@
// NOTE: Use '-fobjc-gc' to test the analysis being run twice, and multiple reports are not issued.
-// RUN: clang-cc -analyze -checker-cfref --analyzer-store=basic -fobjc-gc -analyzer-constraints=basic --verify -fblocks %s &&
-// RUN: clang-cc -analyze -checker-cfref --analyzer-store=basic -analyzer-constraints=range --verify -fblocks %s &&
-// RUN: clang-cc -analyze -checker-cfref --analyzer-store=region -analyzer-constraints=basic --verify -fblocks %s &&
-// RUN: clang-cc -analyze -checker-cfref --analyzer-store=region -analyzer-constraints=range --verify -fblocks %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=basic -fobjc-gc -analyzer-constraints=basic --verify -fblocks %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=basic -analyzer-constraints=range --verify -fblocks %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=region -analyzer-constraints=basic --verify -fblocks %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=region -analyzer-constraints=range --verify -fblocks %s
typedef struct objc_ivar *Ivar;
typedef struct objc_selector *SEL;
@@ -692,7 +692,6 @@ void *rdar7152418_bar();
// conversions of the symbol as necessary.
//===----------------------------------------------------------------------===//
-
// Previously this would crash once we started eagerly evaluating symbols whose
// values were constrained to a single value.
void test_symbol_fold_1(signed char x) {
@@ -722,5 +721,32 @@ unsigned test_symbol_fold_3(void) {
if (x == 54)
return (x << 8) | 0x5;
return 0;
-}
+}
+
+//===----------------------------------------------------------------------===//
+// Tests for the warning of casting a non-struct type to a struct type
+//===----------------------------------------------------------------------===//
+
+typedef struct {unsigned int v;} NSSwappedFloat;
+NSSwappedFloat test_cast_nonstruct_to_struct(float x) {
+ struct hodor {
+ float number;
+ NSSwappedFloat sf;
+ };
+ return ((struct hodor *)&x)->sf; // expected-warning{{Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption}}
+}
+
+NSSwappedFloat test_cast_nonstruct_to_union(float x) {
+ union bran {
+ float number;
+ NSSwappedFloat sf;
+ };
+ return ((union bran *)&x)->sf; // no-warning
+}
+
+void test_undefined_array_subscript() {
+ int i, a[10];
+ int *p = &a[i]; // expected-warning{{Array subscript is undefined}}
+}
+@end
diff --git a/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m b/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m
index 87faab6..536c4a1 100644
--- a/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m
+++ b/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m
@@ -1,5 +1,5 @@
-// RUN: clang-cc -triple i386-apple-darwin9 -analyze -checker-cfref -analyzer-constraints=basic -analyzer-store=basic %s -verify &&
-// RUN: clang-cc -triple i386-apple-darwin9 -analyze -checker-cfref -analyzer-constraints=basic -analyzer-store=region %s -verify
+// RUN: clang-cc -triple i386-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-constraints=basic -analyzer-store=basic %s -verify
+// RUN: clang-cc -triple i386-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-constraints=basic -analyzer-store=region %s -verify
@interface MyClass {}
- (void *)voidPtrM;
diff --git a/test/Analysis/no-exit-cfg.c b/test/Analysis/no-exit-cfg.c
index cad2127..af8db13 100644
--- a/test/Analysis/no-exit-cfg.c
+++ b/test/Analysis/no-exit-cfg.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify %s
// This is a test case for the issue reported in PR 2819:
// http://llvm.org/bugs/show_bug.cgi?id=2819
diff --git a/test/Analysis/no-outofbounds.c b/test/Analysis/no-outofbounds.c
index 9405280..475a211 100644
--- a/test/Analysis/no-outofbounds.c
+++ b/test/Analysis/no-outofbounds.c
@@ -1,5 +1,6 @@
-// RUN: clang-cc -checker-cfref -analyze -analyzer-store=basic -verify %s &&
-// RUN: clang-cc -checker-cfref -analyze -analyzer-store=region -verify %s
+// RUN: clang-cc -checker-cfref -analyze -analyzer-experimental-internal-checks -analyzer-store=basic -verify %s
+// RUN: clang-cc -checker-cfref -analyze -analyzer-experimental-internal-checks -analyzer-store=region -verify %s
+// XFAIL: *
//===----------------------------------------------------------------------===//
// This file tests cases where we should not flag out-of-bounds warnings.
diff --git a/test/Analysis/null-deref-ps-region.c b/test/Analysis/null-deref-ps-region.c
index 80a5f92..ab11513 100644
--- a/test/Analysis/null-deref-ps-region.c
+++ b/test/Analysis/null-deref-ps-region.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -analyze -std=gnu99 -checker-cfref -analyzer-store=region -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -std=gnu99 -checker-cfref -analyzer-store=region -verify %s
// The store for 'a[1]' should not be removed mistakenly. SymbolicRegions may
diff --git a/test/Analysis/null-deref-ps.c b/test/Analysis/null-deref-ps.c
index f37b441..4604db5 100644
--- a/test/Analysis/null-deref-ps.c
+++ b/test/Analysis/null-deref-ps.c
@@ -1,7 +1,7 @@
-// RUN: clang-cc -triple i386-apple-darwin10 -analyze -std=gnu99 -checker-cfref -verify %s -analyzer-constraints=basic -analyzer-store=basic &&
-// RUN: clang-cc -triple i386-apple-darwin10 -analyze -std=gnu99 -checker-cfref -verify %s -analyzer-constraints=range -analyzer-store=basic &&
-// RUN: clang-cc -triple i386-apple-darwin10 -analyze -std=gnu99 -checker-cfref -analyzer-store=region -analyzer-constraints=range -analyzer-purge-dead=false -verify %s &&
-// RUN: clang-cc -triple i386-apple-darwin10 -analyze -std=gnu99 -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
+// RUN: clang-cc -triple i386-apple-darwin10 -analyze -analyzer-experimental-internal-checks -std=gnu99 -checker-cfref -verify %s -analyzer-constraints=basic -analyzer-store=basic
+// RUN: clang-cc -triple i386-apple-darwin10 -analyze -analyzer-experimental-internal-checks -std=gnu99 -checker-cfref -verify %s -analyzer-constraints=range -analyzer-store=basic
+// RUN: clang-cc -triple i386-apple-darwin10 -analyze -analyzer-experimental-internal-checks -std=gnu99 -checker-cfref -analyzer-store=region -analyzer-constraints=range -analyzer-purge-dead=false -verify %s
+// RUN: clang-cc -triple i386-apple-darwin10 -analyze -analyzer-experimental-internal-checks -std=gnu99 -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
typedef unsigned uintptr_t;
diff --git a/test/Analysis/outofbound.c b/test/Analysis/outofbound.c
index e676ea3..d1a07ab 100644
--- a/test/Analysis/outofbound.c
+++ b/test/Analysis/outofbound.c
@@ -1,8 +1,7 @@
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s
-// XFAIL: *
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify %s
char f1() {
char* s = "abcd";
char c = s[4]; // no-warning
- return s[5] + c; // expected-warning{{Load or store into an out-of-bound memory position.}}
+ return s[5] + c; // expected-warning{{Access out-of-bound array element (buffer overflow)}}
}
diff --git a/test/Analysis/override-werror.c b/test/Analysis/override-werror.c
index f928ee0..e8ce7bd 100644
--- a/test/Analysis/override-werror.c
+++ b/test/Analysis/override-werror.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -analyze -checker-cfref -Werror %s -analyzer-store=basic -verify &&
-// RUN: clang-cc -analyze -checker-cfref -Werror %s -analyzer-store=region -verify
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -Werror %s -analyzer-store=basic -verify
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -Werror %s -analyzer-store=region -verify
// This test case illustrates that using '-analyze' overrides the effect of
// -Werror. This allows basic warnings not to interfere with producing
diff --git a/test/Analysis/plist-output.m b/test/Analysis/plist-output.m
new file mode 100644
index 0000000..8bd616a
--- /dev/null
+++ b/test/Analysis/plist-output.m
@@ -0,0 +1,122 @@
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=region -analyzer-constraints=range -fblocks --analyzer-output=plist -o - %s | FileCheck %s
+
+void test_null_init(void) {
+ int *p = 0;
+ *p = 0xDEADBEEF;
+}
+// CHECK: <?xml version="1.0" encoding="UTF-8"?>
+// CHECK: <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+// CHECK: <plist version="1.0">
+// CHECK: <dict>
+// CHECK: <key>files</key>
+// CHECK: <array>
+// CHECK: </array>
+// CHECK: <key>diagnostics</key>
+// CHECK: <array>
+// CHECK: <dict>
+// CHECK: <key>path</key>
+// CHECK: <array>
+// CHECK: <dict>
+// CHECK: <key>kind</key><string>event</string>
+// CHECK: <key>location</key>
+// CHECK: <dict>
+// CHECK: <key>line</key><integer>4</integer>
+// CHECK: <key>col</key><integer>3</integer>
+// CHECK: <key>file</key><integer>0</integer>
+// CHECK: </dict>
+// CHECK: <key>ranges</key>
+// CHECK: <array>
+// CHECK: <array>
+// CHECK: <dict>
+// CHECK: <key>line</key><integer>4</integer>
+// CHECK: <key>col</key><integer>3</integer>
+// CHECK: <key>file</key><integer>0</integer>
+// CHECK: </dict>
+// CHECK: <dict>
+// CHECK: <key>line</key><integer>4</integer>
+// CHECK: <key>col</key><integer>8</integer>
+// CHECK: <key>file</key><integer>0</integer>
+// CHECK: </dict>
+// CHECK: </array>
+// CHECK: </array>
+// CHECK: <key>extended_message</key>
+// CHECK: <string>Variable &apos;p&apos; initialized to a null pointer value</string>
+// CHECK: <key>message</key>
+// CHECK: <string>Variable &apos;p&apos; initialized to a null pointer value</string>
+// CHECK: </dict>
+// CHECK: <dict>
+// CHECK: <key>kind</key><string>control</string>
+// CHECK: <key>edges</key>
+// CHECK: <array>
+// CHECK: <dict>
+// CHECK: <key>start</key>
+// CHECK: <array>
+// CHECK: <dict>
+// CHECK: <key>line</key><integer>4</integer>
+// CHECK: <key>col</key><integer>3</integer>
+// CHECK: <key>file</key><integer>0</integer>
+// CHECK: </dict>
+// CHECK: <dict>
+// CHECK: <key>line</key><integer>4</integer>
+// CHECK: <key>col</key><integer>8</integer>
+// CHECK: <key>file</key><integer>0</integer>
+// CHECK: </dict>
+// CHECK: </array>
+// CHECK: <key>end</key>
+// CHECK: <array>
+// CHECK: <dict>
+// CHECK: <key>line</key><integer>5</integer>
+// CHECK: <key>col</key><integer>3</integer>
+// CHECK: <key>file</key><integer>0</integer>
+// CHECK: </dict>
+// CHECK: <dict>
+// CHECK: <key>line</key><integer>5</integer>
+// CHECK: <key>col</key><integer>4</integer>
+// CHECK: <key>file</key><integer>0</integer>
+// CHECK: </dict>
+// CHECK: </array>
+// CHECK: </dict>
+// CHECK: </array>
+// CHECK: </dict>
+// CHECK: <dict>
+// CHECK: <key>kind</key><string>event</string>
+// CHECK: <key>location</key>
+// CHECK: <dict>
+// CHECK: <key>line</key><integer>5</integer>
+// CHECK: <key>col</key><integer>3</integer>
+// CHECK: <key>file</key><integer>0</integer>
+// CHECK: </dict>
+// CHECK: <key>ranges</key>
+// CHECK: <array>
+// CHECK: <array>
+// CHECK: <dict>
+// CHECK: <key>line</key><integer>5</integer>
+// CHECK: <key>col</key><integer>3</integer>
+// CHECK: <key>file</key><integer>0</integer>
+// CHECK: </dict>
+// CHECK: <dict>
+// CHECK: <key>line</key><integer>5</integer>
+// CHECK: <key>col</key><integer>4</integer>
+// CHECK: <key>file</key><integer>0</integer>
+// CHECK: </dict>
+// CHECK: </array>
+// CHECK: </array>
+// CHECK: <key>extended_message</key>
+// CHECK: <string>Dereference of null pointer</string>
+// CHECK: <key>message</key>
+// CHECK: <string>Dereference of null pointer</string>
+// CHECK: </dict>
+// CHECK: </array>
+// CHECK: <key>description</key><string>Dereference of null pointer</string>
+// CHECK: <key>category</key><string>Logic error</string>
+// CHECK: <key>type</key><string>Null pointer dereference</string>
+// CHECK: <key>location</key>
+// CHECK: <dict>
+// CHECK: <key>line</key><integer>5</integer>
+// CHECK: <key>col</key><integer>3</integer>
+// CHECK: <key>file</key><integer>0</integer>
+// CHECK: </dict>
+// CHECK: </dict>
+// CHECK: </array>
+// CHECK: </dict>
+// CHECK: </plist>
diff --git a/test/Analysis/pr4209.m b/test/Analysis/pr4209.m
index 991d0d6..60161b1 100644
--- a/test/Analysis/pr4209.m
+++ b/test/Analysis/pr4209.m
@@ -1,5 +1,5 @@
-// RUN: clang-cc -triple i386-apple-darwin9 -analyze -checker-cfref -analyzer-store=basic -verify %s &&
-// RUN: clang-cc -triple i386-apple-darwin9 -analyze -checker-cfref -analyzer-store=region -verify %s
+// RUN: clang-cc -triple i386-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -verify %s
+// RUN: clang-cc -triple i386-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify %s
// This test case was crashing due to how CFRefCount.cpp resolved the
// ObjCInterfaceDecl* and ClassName in EvalObjCMessageExpr.
@@ -49,17 +49,20 @@ CMProfileLocation;
GSEbayCategory *rootCategory;
}
- (NSMutableDictionary*)categoryDictionaryForCategoryID:(int)inID inRootTreeCategories:(NSMutableArray*)inRootTreeCategories;
--(NSString*) categoryID;
+-(NSString*) categoryID;
@end @interface GSEbayCategory : NSObject <NSCoding> {
}
- (int) categoryID;
- (GSEbayCategory *) parent;
- (GSEbayCategory*) subcategoryWithID:(int) inID;
-@end @implementation GBCategoryChooserPanelController + (int) chooseCategoryIDFromCategories:(NSArray*) inCategories searchRequest:(GBSearchRequest*)inRequest parentWindow:(NSWindow*) inParent {
+@end @implementation GBCategoryChooserPanelController + (int) chooseCategoryIDFromCategories:(NSArray*) inCategories searchRequest:(GBSearchRequest*)inRequest parentWindow:(NSWindow*) inParent { // expected-warning {{incomplete implementation}} \
+// expected-warning {{method definition for 'categoryDictionaryForCategoryID:inRootTreeCategories:' not found}} \
+// expected-warning {{method definition for 'categoryID' not found}}
return 0;
}
- (void) addCategory:(EBayCategoryType*)inCategory toRootTreeCategory:(NSMutableArray*)inRootTreeCategories {
- GSEbayCategory *category = [rootCategory subcategoryWithID:[[inCategory categoryID] intValue]];
+ GSEbayCategory *category = [rootCategory subcategoryWithID:[[inCategory categoryID] intValue]];
+
if (rootCategory != category) {
GSEbayCategory *parent = category;
while ((((void*)0) != (parent = [parent parent])) && ([parent categoryID] != 0)) {
@@ -69,3 +72,4 @@ CMProfileLocation;
}
}
}
+@end
diff --git a/test/Analysis/pr_2542_rdar_6793404.m b/test/Analysis/pr_2542_rdar_6793404.m
index 82a028d..ebb6902 100644
--- a/test/Analysis/pr_2542_rdar_6793404.m
+++ b/test/Analysis/pr_2542_rdar_6793404.m
@@ -1,5 +1,5 @@
-// RUN: clang-cc -analyze -checker-cfref -pedantic -analyzer-store=basic -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -pedantic -analyzer-store=region -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -pedantic -analyzer-store=basic -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -pedantic -analyzer-store=region -verify %s
// BEGIN delta-debugging reduced header stuff
diff --git a/test/Analysis/pr_4164.c b/test/Analysis/pr_4164.c
index cc2479c..1768717 100644
--- a/test/Analysis/pr_4164.c
+++ b/test/Analysis/pr_4164.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -checker-cfref -analyzer-store=basic -verify %s &&
-// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -checker-cfref -analyzer-store=region -verify %s
+// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -verify %s
+// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify %s
// PR 4164: http://llvm.org/bugs/show_bug.cgi?id=4164
//
diff --git a/test/Analysis/ptr-arith.c b/test/Analysis/ptr-arith.c
index 4f2c7d9..b585c85 100644
--- a/test/Analysis/ptr-arith.c
+++ b/test/Analysis/ptr-arith.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify -triple x86_64-apple-darwin9 %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify -triple i686-apple-darwin9 %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify -triple x86_64-apple-darwin9 %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify -triple i686-apple-darwin9 %s
void f1() {
int a[10];
@@ -31,3 +31,32 @@ domain_port (const char *domain_b, const char *domain_e,
port = 10 * port + (*p - '0');
return port;
}
+
+void f3() {
+ int x, y;
+ int d = &y - &x; // expected-warning{{Subtraction of two pointers that do not point to the same memory chunk may cause incorrect result.}}
+
+ int a[10];
+ int *p = &a[2];
+ int *q = &a[8];
+ d = q-p; // no-warning
+}
+
+void f4() {
+ int *p;
+ p = (int*) 0x10000; // expected-warning{{Using a fixed address is not portable because that address will probably not be valid in all environments or platforms.}}
+}
+
+void f5() {
+ int x, y;
+ int *p;
+ p = &x + 1; // expected-warning{{Pointer arithmetic done on non-array variables means reliance on memory layout, which is dangerous.}}
+
+ int a[10];
+ p = a + 1; // no-warning
+}
+
+// Allow arithmetic on different symbolic regions.
+void f6(int *p, int *q) {
+ int d = q - p; // no-warning
+}
diff --git a/test/Analysis/rdar-6442306-1.m b/test/Analysis/rdar-6442306-1.m
index bfda115..7b0a1a6 100644
--- a/test/Analysis/rdar-6442306-1.m
+++ b/test/Analysis/rdar-6442306-1.m
@@ -1,5 +1,5 @@
-// RUN: clang-cc -analyze -checker-cfref %s --analyzer-store=basic -verify &&
-// RUN: clang-cc -analyze -checker-cfref %s --analyzer-store=region -verify
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref %s --analyzer-store=basic -verify
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref %s --analyzer-store=region -verify
typedef int bar_return_t;
typedef struct {
diff --git a/test/Analysis/rdar-6540084.m b/test/Analysis/rdar-6540084.m
index cfe5220..4d191d2 100644
--- a/test/Analysis/rdar-6540084.m
+++ b/test/Analysis/rdar-6540084.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -analyze -warn-dead-stores -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -warn-dead-stores -verify %s
//
// This test exercises the live variables analysis (LiveVariables.cpp).
// The case originally identified a non-termination bug.
diff --git a/test/Analysis/rdar-6541136-region.c b/test/Analysis/rdar-6541136-region.c
index e2779e8..5190a03 100644
--- a/test/Analysis/rdar-6541136-region.c
+++ b/test/Analysis/rdar-6541136-region.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -verify -analyze -checker-cfref -analyzer-store=region %s
+// RUN: clang-cc -verify -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region %s
struct tea_cheese { unsigned magic; };
typedef struct tea_cheese kernel_tea_cheese_t;
@@ -6,17 +6,22 @@ extern kernel_tea_cheese_t _wonky_gesticulate_cheese;
// This test case exercises the ElementRegion::getRValueType() logic.
-
-void foo( void )
-{
+void test1( void ) {
kernel_tea_cheese_t *wonky = &_wonky_gesticulate_cheese;
struct load_wine *cmd = (void*) &wonky[1];
cmd = cmd;
char *p = (void*) &wonky[1];
- *p = 1; // no-warning
kernel_tea_cheese_t *q = &wonky[1];
// This test case tests both the RegionStore logic (doesn't crash) and
// the out-of-bounds checking. We don't expect the warning for now since
// out-of-bound checking is temporarily disabled.
- kernel_tea_cheese_t r = *q; // eventually-warning{{out-of-bound memory position}}
+ kernel_tea_cheese_t r = *q; // expected-warning{{Access out-of-bound array element (buffer overflow)}}
+}
+
+void test1_b( void ) {
+ kernel_tea_cheese_t *wonky = &_wonky_gesticulate_cheese;
+ struct load_wine *cmd = (void*) &wonky[1];
+ cmd = cmd;
+ char *p = (void*) &wonky[1];
+ *p = 1; // expected-warning{{Access out-of-bound array element (buffer overflow)}}
}
diff --git a/test/Analysis/rdar-6541136.c b/test/Analysis/rdar-6541136.c
index 6e6a479..d5fc2e0 100644
--- a/test/Analysis/rdar-6541136.c
+++ b/test/Analysis/rdar-6541136.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -verify -analyze -checker-cfref -analyzer-store=basic %s
+// RUN: clang-cc -verify -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic %s
struct tea_cheese { unsigned magic; };
typedef struct tea_cheese kernel_tea_cheese_t;
diff --git a/test/Analysis/rdar-6562655.m b/test/Analysis/rdar-6562655.m
index 3c1c281..0b837c6 100644
--- a/test/Analysis/rdar-6562655.m
+++ b/test/Analysis/rdar-6562655.m
@@ -1,5 +1,5 @@
-// RUN: clang-cc -analyze -checker-cfref -analyzer-constraints=basic -analyzer-store=basic -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-constraints=basic -analyzer-store=region -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-constraints=basic -analyzer-store=basic -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-constraints=basic -analyzer-store=region -verify %s
//
// This test case mainly checks that the retain/release checker doesn't crash
// on this file.
diff --git a/test/Analysis/rdar-6582778-basic-store.c b/test/Analysis/rdar-6582778-basic-store.c
index 9ec38ef..a4850c1 100644
--- a/test/Analysis/rdar-6582778-basic-store.c
+++ b/test/Analysis/rdar-6582778-basic-store.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -verify %s
typedef const void * CFTypeRef;
typedef double CFTimeInterval;
diff --git a/test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m b/test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m
index 49ef7c3..7230f21 100644
--- a/test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m
+++ b/test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m
@@ -1,5 +1,5 @@
-// RUN: clang-cc -analyze -checker-cfref -analyzer-constraints=basic -analyzer-store=basic %s -verify &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-constraints=basic -analyzer-store=region %s -verify
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-constraints=basic -analyzer-store=basic %s -verify
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-constraints=basic -analyzer-store=region %s -verify
typedef struct Foo { int x; } Bar;
diff --git a/test/Analysis/rdar-7168531.m b/test/Analysis/rdar-7168531.m
index bdbd22d..6c34125 100644
--- a/test/Analysis/rdar-7168531.m
+++ b/test/Analysis/rdar-7168531.m
@@ -1,5 +1,5 @@
-// RUN: clang-cc -analyze -checker-cfref -triple i386-apple-darwin10 -analyzer-store=region &&
-// RUN: clang-cc -analyze -checker-cfref -triple i386-apple-darwin10 -analyzer-store=basic
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -triple i386-apple-darwin10 -analyzer-store=region
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -triple i386-apple-darwin10 -analyzer-store=basic
// Note that the target triple is important for this test case. It specifies that we use the
// fragile Objective-C ABI.
diff --git a/test/Analysis/refcnt_naming.m b/test/Analysis/refcnt_naming.m
index 2ce00b2..a4c2904 100644
--- a/test/Analysis/refcnt_naming.m
+++ b/test/Analysis/refcnt_naming.m
@@ -1,5 +1,5 @@
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify %s
typedef const struct __CFString * CFStringRef;
typedef const struct __CFAllocator * CFAllocatorRef;
diff --git a/test/Analysis/region-1.m b/test/Analysis/region-1.m
index 68a375b..6a8ae49 100644
--- a/test/Analysis/region-1.m
+++ b/test/Analysis/region-1.m
@@ -1,5 +1,5 @@
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s &&
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -verify %s
+// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify %s
//
// This test case simply should not crash. It evaluates the logic of not
// using MemRegion::getRValueType in incorrect places.
@@ -89,3 +89,4 @@ Dos_CharacterRangeType = 0, Dos_LineRangeType = 1 }
symbol = [HancodeFett symbolFromClass:(JabaSCClass *) selectedClassifier];
}
}
+@end
diff --git a/test/Analysis/retain-release-gc-only.m b/test/Analysis/retain-release-gc-only.m
index e27cfe7..3eeebc4 100644
--- a/test/Analysis/retain-release-gc-only.m
+++ b/test/Analysis/retain-release-gc-only.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify -fobjc-gc-only %s &&
+// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify -fobjc-gc-only %s
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -fobjc-gc-only -verify %s
//===----------------------------------------------------------------------===//
@@ -372,4 +372,4 @@ CFDateRef returnsRetainedCFDate() {
- (NSDate*) returnsNSRetained {
return (NSDate*) returnsRetainedCFDate(); // expected-warning{{leak}}
}
-@end \ No newline at end of file
+@end
diff --git a/test/Analysis/retain-release.m b/test/Analysis/retain-release.m
index 879e8a0..dfea2e7 100644
--- a/test/Analysis/retain-release.m
+++ b/test/Analysis/retain-release.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple x86_64-apple-darwin10 -analyze -checker-cfref -analyzer-store=basic -verify %s &&
+// RUN: clang-cc -triple x86_64-apple-darwin10 -analyze -checker-cfref -analyzer-store=basic -verify %s
// RUN: clang-cc -triple x86_64-apple-darwin10 -analyze -checker-cfref -analyzer-store=region -verify %s
#if __has_feature(attribute_ns_returns_retained)
diff --git a/test/Analysis/security-syntax-checks.m b/test/Analysis/security-syntax-checks.m
index ebd7d17..bcdc65e 100644
--- a/test/Analysis/security-syntax-checks.m
+++ b/test/Analysis/security-syntax-checks.m
@@ -30,6 +30,13 @@ void test_gets() {
gets(buff); // expected-warning{{Call to function 'gets' is extremely insecure as it can always result in a buffer overflow}}
}
+int getpw(unsigned int uid, char *buf);
+
+void test_getpw() {
+ char buff[1024];
+ getpw(2, buff); // expected-warning{{The getpw() function is dangerous as it may overflow the provided buffer. It is obsoleted by getpwuid().}}
+}
+
// <rdar://problem/6337132> CWE-273: Failure to Check Whether Privileges Were
// Dropped Successfully
typedef unsigned int __uint32_t;
diff --git a/test/Analysis/sizeofpointer.c b/test/Analysis/sizeofpointer.c
new file mode 100644
index 0000000..e40c718
--- /dev/null
+++ b/test/Analysis/sizeofpointer.c
@@ -0,0 +1,8 @@
+// RUN: clang-cc -analyze -warn-sizeof-pointer -verify %s
+
+struct s {
+};
+
+int f(struct s *p) {
+ return sizeof(p); // expected-warning{{The code calls sizeof() on a pointer type. This can produce an unexpected result.}}
+}
diff --git a/test/Analysis/stack-addr-ps.c b/test/Analysis/stack-addr-ps.c
index 0d7a703..f26e2f0 100644
--- a/test/Analysis/stack-addr-ps.c
+++ b/test/Analysis/stack-addr-ps.c
@@ -1,8 +1,6 @@
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s &&
+// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s
-#include <stdlib.h>
-
int* f1() {
int x = 0;
return &x; // expected-warning{{Address of stack memory associated with local variable 'x' returned.}} expected-warning{{address of stack memory associated with local variable 'x' returned}}
diff --git a/test/Analysis/uninit-msg-expr.m b/test/Analysis/uninit-msg-expr.m
index 5ec878e..c2b7366 100644
--- a/test/Analysis/uninit-msg-expr.m
+++ b/test/Analysis/uninit-msg-expr.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s &&
+// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s
//===----------------------------------------------------------------------===//
diff --git a/test/Analysis/uninit-ps-rdar6145427.m b/test/Analysis/uninit-ps-rdar6145427.m
index 49eb269..d9e7318 100644
--- a/test/Analysis/uninit-ps-rdar6145427.m
+++ b/test/Analysis/uninit-ps-rdar6145427.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -analyze -verify -analyzer-store=basic -checker-cfref %s &&
+// RUN: clang-cc -analyze -verify -analyzer-store=basic -checker-cfref %s
// RUN: clang-cc -analyze -verify -analyzer-store=region -checker-cfref %s
// Delta-Debugging reduced preamble.
diff --git a/test/Analysis/uninit-vals-ps.c b/test/Analysis/uninit-vals-ps.c
index 759c7ed..c8632a5 100644
--- a/test/Analysis/uninit-vals-ps.c
+++ b/test/Analysis/uninit-vals-ps.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s &&
+// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s
struct FPRec {
diff --git a/test/Analysis/uninit-vals.m b/test/Analysis/uninit-vals.m
index 7be247e..6d1561e 100644
--- a/test/Analysis/uninit-vals.m
+++ b/test/Analysis/uninit-vals.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s &&
+// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s
typedef unsigned int NSUInteger;
diff --git a/test/Analysis/unused-ivars.m b/test/Analysis/unused-ivars.m
index 9e9360d..754799b 100644
--- a/test/Analysis/unused-ivars.m
+++ b/test/Analysis/unused-ivars.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple x86_64-apple-darwin10 -analyze -warn-objc-unused-ivars %s -verify
+// RUN: clang-cc -fblocks -analyze -warn-objc-unused-ivars %s -verify
//===--- BEGIN: Delta-debugging reduced headers. --------------------------===//
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 8b3c738..cd822f6 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -22,11 +22,19 @@ set(CLANG_TEST_DIRECTORIES
"SemaObjCXX"
"SemaTemplate")
+set(LLVM_SOURCE_DIR "${LLVM_MAIN_SRC_DIR}")
+set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}")
+set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/%(build_config)s")
+set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib/%(build_config)s")
+set(CLANG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..")
+set(CLANG_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/..")
+
+configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
+ ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg)
+
include(FindPythonInterp)
if(PYTHONINTERP_FOUND)
- get_target_triple(TARGET_TRIPLE)
- get_target_property(LLVM_TOOLS_PATH clang RUNTIME_OUTPUT_DIRECTORY)
- get_target_property(LLVM_LIBS_PATH clang LIBRARY_OUTPUT_DIRECTORY)
set(CLANG_TEST_EXTRA_ARGS)
if (MSVC OR XCODE)
set(CLANG_TEST_EXTRA_ARGS "--no-progress-bar")
@@ -34,18 +42,10 @@ if(PYTHONINTERP_FOUND)
foreach(testdir ${CLANG_TEST_DIRECTORIES})
add_custom_target(clang-test-${testdir}
- COMMAND sed -e "s#\@LLVM_SOURCE_DIR\@#${LLVM_MAIN_SRC_DIR}#"
- -e "s#\@LLVM_BINARY_DIR\@#${LLVM_BINARY_DIR}#"
- -e "s#\@LLVM_TOOLS_DIR\@#${LLVM_TOOLS_PATH}/${CMAKE_CFG_INTDIR}#"
- -e "s#\@LLVM_LIBS_DIR\@#${LLVM_LIBS_PATH}/${CMAKE_CFG_INTDIR}#"
- -e "s#\@CLANG_SOURCE_DIR\@#${CMAKE_CURRENT_SOURCE_DIR}/..#"
- -e "s#\@CLANG_BINARY_DIR\@#${CMAKE_CURRENT_BINARY_DIR}/..#"
- -e "s#\@TARGET_TRIPLE\@#${TARGET_TRIPLE}#"
- ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in >
- ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
COMMAND ${PYTHON_EXECUTABLE}
${LLVM_SOURCE_DIR}/utils/lit/lit.py
--param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
+ --param build_config=${CMAKE_CFG_INTDIR}
-sv ${CLANG_TEST_EXTRA_ARGS}
${CMAKE_CURRENT_BINARY_DIR}/${testdir}
DEPENDS clang clang-cc index-test c-index-test
@@ -53,36 +53,20 @@ if(PYTHONINTERP_FOUND)
endforeach()
add_custom_target(clang-test
- COMMAND sed -e "s#\@LLVM_SOURCE_DIR\@#${LLVM_MAIN_SRC_DIR}#"
- -e "s#\@LLVM_BINARY_DIR\@#${LLVM_BINARY_DIR}#"
- -e "s#\@LLVM_TOOLS_DIR\@#${LLVM_TOOLS_PATH}/${CMAKE_CFG_INTDIR}#"
- -e "s#\@LLVM_LIBS_DIR\@#${LLVM_LIBS_PATH}/${CMAKE_CFG_INTDIR}#"
- -e "s#\@CLANG_SOURCE_DIR\@#${CMAKE_CURRENT_SOURCE_DIR}/..#"
- -e "s#\@CLANG_BINARY_DIR\@#${CMAKE_CURRENT_BINARY_DIR}/..#"
- -e "s#\@TARGET_TRIPLE\@#${TARGET_TRIPLE}#"
- ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in >
- ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
COMMAND ${PYTHON_EXECUTABLE}
${LLVM_SOURCE_DIR}/utils/lit/lit.py
--param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
+ --param build_config=${CMAKE_CFG_INTDIR}
-sv ${CLANG_TEST_EXTRA_ARGS}
${CMAKE_CURRENT_BINARY_DIR}
DEPENDS clang clang-cc index-test c-index-test
COMMENT "Running Clang regression tests")
add_custom_target(clang-c++tests
- COMMAND sed -e "s#\@LLVM_SOURCE_DIR\@#${LLVM_MAIN_SRC_DIR}#"
- -e "s#\@LLVM_BINARY_DIR\@#${LLVM_BINARY_DIR}#"
- -e "s#\@LLVM_TOOLS_DIR\@#${LLVM_TOOLS_PATH}/${CMAKE_CFG_INTDIR}#"
- -e "s#\@LLVM_LIBS_DIR\@#${LLVM_LIBS_PATH}/${CMAKE_CFG_INTDIR}#"
- -e "s#\@CLANG_SOURCE_DIR\@#${CMAKE_CURRENT_SOURCE_DIR}/..#"
- -e "s#\@CLANG_BINARY_DIR\@#${CMAKE_CURRENT_BINARY_DIR}/..#"
- -e "s#\@TARGET_TRIPLE\@#${TARGET_TRIPLE}#"
- ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in >
- ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
COMMAND ${PYTHON_EXECUTABLE}
${LLVM_SOURCE_DIR}/utils/lit/lit.py
--param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
+ --param build_config=${CMAKE_CFG_INTDIR}
-sv ${CLANG_TEST_EXTRA_ARGS}
${CMAKE_CURRENT_SOURCE_DIR}/../utils/C++Tests
DEPENDS clang clang-cc index-test c-index-test
diff --git a/test/CXX/basic/basic.lookup/basic.lookup.udir/p1.cpp b/test/CXX/basic/basic.lookup/basic.lookup.udir/p1.cpp
new file mode 100644
index 0000000..04aef1e
--- /dev/null
+++ b/test/CXX/basic/basic.lookup/basic.lookup.udir/p1.cpp
@@ -0,0 +1,35 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+// When looking up a namespace-name in a using-directive or
+// namespace-alias-definition, only namespace names are considered.
+
+struct ns1 {};
+void ns2();
+int ns3 = 0;
+
+namespace ns0 {
+ namespace ns1 {
+ struct test0 {};
+ }
+ namespace ns2 {
+ struct test1 {};
+ }
+ namespace ns3 {
+ struct test2 {};
+ }
+}
+
+using namespace ns0;
+
+namespace test3 = ns1;
+namespace test4 = ns2;
+namespace test5 = ns3;
+
+using namespace ns1;
+using namespace ns2;
+using namespace ns3;
+
+test0 a;
+test1 b;
+test2 c;
+
diff --git a/test/CXX/dcl.dcl/basic.namespace/namespace.def/namespace.unnamed/p1.cpp b/test/CXX/dcl.dcl/basic.namespace/namespace.def/namespace.unnamed/p1.cpp
new file mode 100644
index 0000000..dd30d6a
--- /dev/null
+++ b/test/CXX/dcl.dcl/basic.namespace/namespace.def/namespace.unnamed/p1.cpp
@@ -0,0 +1,24 @@
+// RUN: clang-cc -emit-llvm-only -verify %s
+
+// This lame little test was ripped straight from the standard.
+
+namespace {
+ int i; // expected-note {{candidate}}
+}
+void test0() { i++; }
+
+namespace A {
+ namespace {
+ int i; // expected-note {{candidate}}
+ int j;
+ }
+ void test1() { i++; }
+}
+
+using namespace A;
+
+void test2() {
+ i++; // expected-error {{reference to 'i' is ambiguous}}
+ A::i++;
+ j++;
+}
diff --git a/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p1.cpp b/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p1.cpp
new file mode 100644
index 0000000..35e8c08
--- /dev/null
+++ b/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p1.cpp
@@ -0,0 +1,67 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+// We have to avoid ADL for this test.
+
+template <unsigned N> class test {};
+
+class foo {};
+test<0> foo(foo); // expected-note {{candidate}}
+
+namespace Test0 {
+ class foo { int x; };
+ test<1> foo(class foo);
+
+ namespace A {
+ test<2> foo(class ::foo); // expected-note {{candidate}}
+
+ void test0() {
+ using ::foo;
+
+ class foo a;
+ test<0> _ = (foo)(a);
+ }
+
+ void test1() {
+ using Test0::foo;
+
+ class foo a;
+ test<1> _ = (foo)(a);
+ };
+
+ void test2() {
+ class ::foo a;
+
+ // Argument-dependent lookup is ambiguous between B:: and ::.
+ test<0> _0 = foo(a); // expected-error {{call to 'foo' is ambiguous}}
+
+ // But basic unqualified lookup is not.
+ test<2> _1 = (foo)(a);
+
+ class Test0::foo b;
+ test<2> _2 = (foo)(b); // expected-error {{incompatible type passing}}
+ }
+ }
+}
+
+namespace Test1 {
+ namespace A {
+ class a {};
+ }
+
+ namespace B {
+ typedef class {} b;
+ }
+
+ namespace C {
+ int c(); // expected-note {{target of using declaration}}
+ }
+
+ namespace D {
+ using typename A::a;
+ using typename B::b;
+ using typename C::c; // expected-error {{'typename' keyword used on a non-type}}
+
+ a _1 = A::a();
+ b _2 = B::b();
+ }
+}
diff --git a/test/CXX/dcl.dcl/basic.namespace/namespace.udir/p1.cpp b/test/CXX/dcl.dcl/basic.namespace/namespace.udir/p1.cpp
new file mode 100644
index 0000000..fbd2058
--- /dev/null
+++ b/test/CXX/dcl.dcl/basic.namespace/namespace.udir/p1.cpp
@@ -0,0 +1,141 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+// (this actually occurs before paragraph 1)
+namespace test0 {
+ namespace A {}
+ class B {
+ using namespace A; // expected-error {{'using namespace' is not allowed in classes}}
+ };
+}
+
+
+struct opaque0 {};
+struct opaque1 {};
+
+// Test that names appear as if in deepest common ancestor.
+namespace test1 {
+ namespace A {
+ namespace B {
+ opaque0 foo(); // expected-note {{candidate}}
+ }
+ }
+
+ namespace C {
+ opaque1 foo(); // expected-note {{candidate}}
+
+ opaque1 test() {
+ using namespace A::B;
+ return foo(); // C::foo
+ }
+ }
+
+ opaque1 test() {
+ using namespace A::B;
+ using namespace C;
+ return foo(); // expected-error {{call to 'foo' is ambiguous}}
+ }
+}
+
+// Same thing, but with the directives in namespaces.
+namespace test2 {
+ namespace A {
+ namespace B {
+ opaque0 foo(); // expected-note {{candidate}}
+ }
+ }
+
+ namespace C {
+ opaque1 foo(); // expected-note {{candidate}}
+
+ namespace test {
+ using namespace A::B;
+
+ opaque1 test() {
+ return foo(); // C::foo
+ }
+ }
+ }
+
+ namespace test {
+ using namespace A::B;
+ using namespace C;
+
+ opaque1 test() {
+ return foo(); // expected-error {{call to 'foo' is ambiguous}}
+ }
+ }
+}
+
+// Transitivity.
+namespace test3 {
+ namespace A {
+ namespace B {
+ opaque0 foo();
+ }
+ }
+ namespace C {
+ using namespace A;
+ }
+
+ opaque0 test0() {
+ using namespace C;
+ using namespace B;
+ return foo();
+ }
+
+ namespace D {
+ using namespace C;
+ }
+ namespace A {
+ opaque1 foo();
+ }
+
+ opaque1 test1() {
+ using namespace D;
+ return foo();
+ }
+}
+
+// Transitivity acts like synthetic using directives.
+namespace test4 {
+ namespace A {
+ namespace B {
+ opaque0 foo(); // expected-note {{candidate}}
+ }
+ }
+
+ namespace C {
+ using namespace A::B;
+ }
+
+ opaque1 foo(); // expected-note {{candidate}}
+
+ namespace A {
+ namespace D {
+ using namespace C;
+ }
+
+ opaque0 test() {
+ using namespace D;
+ return foo();
+ }
+ }
+
+ opaque0 test() {
+ using namespace A::D;
+ return foo(); // expected-error {{call to 'foo' is ambiguous}}
+ }
+}
+
+// Bug: using directives should be followed when parsing default
+// arguments in scoped declarations.
+class test5 {
+ int inc(int x);
+};
+namespace Test5 {
+ int default_x = 0;
+}
+using namespace Test5;
+int test5::inc(int x = default_x) {
+ return x+1;
+}
diff --git a/test/CXX/dcl.decl/dcl.meaning/dcl.array/p1.cpp b/test/CXX/dcl.decl/dcl.meaning/dcl.array/p1.cpp
new file mode 100644
index 0000000..a3c147d
--- /dev/null
+++ b/test/CXX/dcl.decl/dcl.meaning/dcl.array/p1.cpp
@@ -0,0 +1,44 @@
+// RUN: clang-cc -fsyntax-only -pedantic -verify %s
+
+// Simple form
+int ar1[10];
+
+// Element type cannot be:
+// - (cv) void
+volatile void ar2[10]; // expected-error {{incomplete element type 'void volatile'}}
+// - a reference
+int& ar3[10]; // expected-error {{array of references}}
+// - a function type
+typedef void Fn();
+Fn ar4[10]; // expected-error {{array of functions}}
+// - an abstract class
+struct Abstract { virtual void fn() = 0; }; // expected-note {{pure virtual}}
+Abstract ar5[10]; // expected-error {{abstract class}}
+
+// If we have a size, it must be greater than zero.
+int ar6[-1]; // expected-error {{array size is negative}}
+int ar7[0u]; // expected-warning {{zero size arrays are an extension}}
+
+// An array with unknown bound is incomplete.
+int ar8[]; // expected-error {{needs an explicit size or an initializer}}
+// So is an array with an incomplete element type.
+struct Incomplete; // expected-note {{forward declaration}}
+Incomplete ar9[10]; // expected-error {{incomplete type}}
+// Neither of which should be a problem in situations where no complete type
+// is required. (PR5048)
+void fun(int p1[], Incomplete p2[10]);
+extern int ear1[];
+extern Incomplete ear2[10];
+
+// cv migrates to element type
+typedef const int cint;
+extern cint car1[10];
+typedef int intar[10];
+// thus this is a valid redeclaration
+extern const intar car1;
+
+// Check that instantiation works properly when the element type is a template.
+template <typename T> struct S {
+ typename T::type x; // expected-error {{has no members}}
+};
+S<int> ar10[10]; // expected-note {{requested here}}
diff --git a/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p4.cpp b/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p4.cpp
index bbfaf90..4b15828 100644
--- a/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p4.cpp
+++ b/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p4.cpp
@@ -52,4 +52,4 @@ namespace N1 {
{
f2(6); // okay
}
-} \ No newline at end of file
+}
diff --git a/test/CXX/dcl.decl/dcl.meaning/dcl.fct/p3.cpp b/test/CXX/dcl.decl/dcl.meaning/dcl.fct/p3.cpp
index 6f71978c..01fa6ac 100644
--- a/test/CXX/dcl.decl/dcl.meaning/dcl.fct/p3.cpp
+++ b/test/CXX/dcl.decl/dcl.meaning/dcl.fct/p3.cpp
@@ -1,3 +1,3 @@
// RUN: clang-cc -fsyntax-only -verify %s
void f(int) { } // expected-note {{previous definition is here}}
-void f(const int) { } // expected-error {{redefinition of 'f'}} \ No newline at end of file
+void f(const int) { } // expected-error {{redefinition of 'f'}}
diff --git a/test/CXX/dcl.decl/dcl.meaning/dcl.mptr/p3.cpp b/test/CXX/dcl.decl/dcl.meaning/dcl.mptr/p3.cpp
index 101d75f..5f9a534 100644
--- a/test/CXX/dcl.decl/dcl.meaning/dcl.mptr/p3.cpp
+++ b/test/CXX/dcl.decl/dcl.meaning/dcl.mptr/p3.cpp
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fsyntax-only -verify %t
+// RUN: clang-cc -fsyntax-only -verify %s
class A {
public:
int& i;
@@ -20,7 +20,7 @@ void f() {
a.*&A::s = 10; // expected-error{{right hand operand to .* has non pointer-to-member type 'int *'}}
a.*&A::i = 10; // expected-error{{cannot form a pointer-to-member to member 'i' of reference type 'int &'}}
- ft(a); // expected-note{{in instantiation of function template specialization 'ft' requested here}}
+ ft(a); // expected-note{{in instantiation of function template specialization 'ft<class A>' requested here}}
void A::*p = 0; // expected-error{{'p' declared as a member pointer to void}}
}
diff --git a/test/CXX/expr/expr.unary/expr.delete/p5.cpp b/test/CXX/expr/expr.unary/expr.delete/p5.cpp
new file mode 100644
index 0000000..91e77bc
--- /dev/null
+++ b/test/CXX/expr/expr.unary/expr.delete/p5.cpp
@@ -0,0 +1,34 @@
+// RUN: clang-cc -verify %s
+
+// If the object being deleted has incomplete class type at the point of
+// deletion and the complete class has a non-trivial destructor or a
+// deallocation function, the behavior is undefined.
+
+// The trivial case.
+class T0; // expected-note {{forward declaration}}
+void f0(T0 *a) { delete a; } // expected-warning {{deleting pointer to incomplete type}}
+class T0 { ~T0(); };
+
+// The trivial case, inside a template instantiation.
+template<typename T>
+class T1_A { T *x; ~T1_A() { delete x; } }; // expected-warning {{deleting pointer to incomplete type}}
+class T1_B; // expected-note {{forward declaration}}
+void f0() { T1_A<T1_B> x; } // expected-note {{in instantiation of member function}}
+
+// This case depends on when we check T2_C::f0.
+class T2_A;
+template<typename T>
+struct T2_B { void f0(T *a) { delete a; } };
+struct T2_C { T2_B<T2_A> x; void f0(T2_A *a) { x.f0(a); } };
+void f0(T2_A *a) { T2_C x; x.f0(a); }
+class T2_A { };
+
+// An alternate version of the same.
+//
+// FIXME: Revisit this case when we have access control.
+class T3_A;
+template<typename T>
+struct T3_B { void f0(T *a) { delete a; } };
+struct T3_C { T3_B<T3_A> x; void f0(T3_A *a) { x.f0(a); } };
+void f0(T3_A *a) { T3_C x; x.f0(a); }
+class T3_A { private: ~T3_A(); };
diff --git a/test/CXX/special/class.free/p1.cpp b/test/CXX/special/class.free/p1.cpp
new file mode 100644
index 0000000..bf99a27
--- /dev/null
+++ b/test/CXX/special/class.free/p1.cpp
@@ -0,0 +1,11 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+#include <stddef.h>
+
+struct A {
+ void *operator new(size_t) {
+ return this; // expected-error {{invalid use of 'this' outside of a nonstatic member function}}
+ }
+ void *operator new[](size_t) {
+ return this; // expected-error {{invalid use of 'this' outside of a nonstatic member function}}
+ }
+};
diff --git a/test/CXX/special/class.free/p6.cpp b/test/CXX/special/class.free/p6.cpp
new file mode 100644
index 0000000..8334817
--- /dev/null
+++ b/test/CXX/special/class.free/p6.cpp
@@ -0,0 +1,11 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+#include <stddef.h>
+
+struct A {
+ void operator delete(size_t) {
+ (void)this; // expected-error {{invalid use of 'this' outside of a nonstatic member function}}
+ }
+ void operator delete[](void*) {
+ (void)this; // expected-error {{invalid use of 'this' outside of a nonstatic member function}}
+ }
+};
diff --git a/test/CXX/temp/temp.param/p1.cpp b/test/CXX/temp/temp.param/p1.cpp
index a6638b4..676bffe 100644
--- a/test/CXX/temp/temp.param/p1.cpp
+++ b/test/CXX/temp/temp.param/p1.cpp
@@ -1,4 +1,4 @@
// Suppress 'no run line' failure.
-// RUN: true
+// RUN: echo ok
// Paragraph 1 is descriptive, and therefore requires no tests.
diff --git a/test/CXX/temp/temp.param/p12.cpp b/test/CXX/temp/temp.param/p12.cpp
index 5511224..3864fbe 100644
--- a/test/CXX/temp/temp.param/p12.cpp
+++ b/test/CXX/temp/temp.param/p12.cpp
@@ -34,4 +34,6 @@ template<int N,
// Check validity of default arguments
template<template<class, int> class // expected-note{{previous template template parameter is here}}
= Y1> // expected-error{{template template argument has different template parameters than its corresponding template template parameter}}
- class C1;
+ class C1 {};
+
+C1<> c1; // expected-note{{while checking a default template argument}}
diff --git a/test/CXX/temp/temp.spec/temp.expl.spec/p3.cpp b/test/CXX/temp/temp.spec/temp.expl.spec/p3.cpp
index 33fb93b..de05a92 100644
--- a/test/CXX/temp/temp.spec/temp.expl.spec/p3.cpp
+++ b/test/CXX/temp/temp.spec/temp.expl.spec/p3.cpp
@@ -10,4 +10,4 @@ namespace N {
template<> class X<char*> { /* ... */ }; // OK: X is a template
-} \ No newline at end of file
+}
diff --git a/test/CXX/temp/temp.spec/temp.expl.spec/p4.cpp b/test/CXX/temp/temp.spec/temp.expl.spec/p4.cpp
index 8d91068..ad0d506 100644
--- a/test/CXX/temp/temp.spec/temp.expl.spec/p4.cpp
+++ b/test/CXX/temp/temp.spec/temp.expl.spec/p4.cpp
@@ -12,7 +12,7 @@ struct X { // expected-note{{here}}
void g() { }
- struct Inner {
+ struct Inner { // expected-error{{implicit default}}
T value; // expected-note {{member is declared here}}
};
@@ -26,8 +26,7 @@ IntHolder &test_X_IntHolderInt(X<IntHolder, int> xih) {
xih.g(); // okay
xih.f(); // expected-note{{instantiation}}
- // FIXME: diagnostic here has incorrect reason (PR5154)
- X<IntHolder, int>::Inner inner; // expected-error{{implicit default}}
+ X<IntHolder, int>::Inner inner; // expected-note {{first required here}}
return X<IntHolder, int>::value; // expected-note{{instantiation}}
}
diff --git a/test/CodeCompletion/call.cpp b/test/CodeCompletion/call.cpp
index 90bf82b..8c7bf83 100644
--- a/test/CodeCompletion/call.cpp
+++ b/test/CodeCompletion/call.cpp
@@ -17,12 +17,11 @@ void f();
void test() {
f(Y(), 0, 0);
- // RUN: clang-cc -fsyntax-only -code-completion-at=%s:19:9 %s -o - | FileCheck -check-prefix=CC1 %s &&
+ // RUN: clang-cc -fsyntax-only -code-completion-at=%s:19:9 %s -o - | FileCheck -check-prefix=CC1 %s
// CHECK-CC1: f(struct N::Y y, <#int ZZ#>)
// CHECK-CC1-NEXT: f(int i, <#int j#>, int k)
// CHECK-CC1-NEXT: f(float x, <#float y#>)
- // RUN: clang-cc -fsyntax-only -code-completion-at=%s:19:13 %s -o - | FileCheck -check-prefix=CC2 %s &&
+ // RUN: clang-cc -fsyntax-only -code-completion-at=%s:19:13 %s -o - | FileCheck -check-prefix=CC2 %s
// CHECK-CC2-NOT: f(struct N::Y y, int ZZ)
// CHECK-CC2: f(int i, int j, <#int k#>)
- // RUN: true
}
diff --git a/test/CodeCompletion/enum-switch-case-qualified.cpp b/test/CodeCompletion/enum-switch-case-qualified.cpp
index 223aca8..3e8d75d 100644
--- a/test/CodeCompletion/enum-switch-case-qualified.cpp
+++ b/test/CodeCompletion/enum-switch-case-qualified.cpp
@@ -21,8 +21,7 @@ namespace M {
void test(enum N::C::Color color) {
switch (color) {
case
- // RUN: clang-cc -fsyntax-only -code-completion-at=%s:23:8 %s -o - | FileCheck -check-prefix=CC1 %s &&
- // RUN: true
+ // RUN: clang-cc -fsyntax-only -code-completion-at=%s:23:8 %s -o - | FileCheck -check-prefix=CC1 %s
// CHECK-CC1: Blue : 0 : N::C::Blue
// CHECK-CC1-NEXT: Green : 0 : N::C::Green
// CHECK-CC1-NEXT: Indigo : 0 : N::C::Indigo
diff --git a/test/CodeCompletion/enum-switch-case.c b/test/CodeCompletion/enum-switch-case.c
index d8bb5e8..b7a3676 100644
--- a/test/CodeCompletion/enum-switch-case.c
+++ b/test/CodeCompletion/enum-switch-case.c
@@ -19,11 +19,10 @@ void test(enum Color color) {
case Green:
break;
- // RUN: clang-cc -fsyntax-only -code-completion-at=%s:19:10 %s -o - | FileCheck -check-prefix=CC1 %s &&
+ // RUN: clang-cc -fsyntax-only -code-completion-at=%s:19:10 %s -o - | FileCheck -check-prefix=CC1 %s
// CHECK-CC1: Blue : 0
// CHECK-CC1-NEXT: Green : 0
// CHECK-CC1-NEXT: Indigo : 0
// CHECK-CC1-NEXT: Orange : 0
// CHECK-CC1-NEXT: Violet : 0
- // RUN: true
diff --git a/test/CodeCompletion/enum-switch-case.cpp b/test/CodeCompletion/enum-switch-case.cpp
index 7a388fc..3a010a8 100644
--- a/test/CodeCompletion/enum-switch-case.cpp
+++ b/test/CodeCompletion/enum-switch-case.cpp
@@ -19,11 +19,10 @@ void test(enum N::Color color) {
break;
case
- // RUN: clang-cc -fsyntax-only -code-completion-at=%s:21:8 %s -o - | FileCheck -check-prefix=CC1 %s &&
+ // RUN: clang-cc -fsyntax-only -code-completion-at=%s:21:8 %s -o - | FileCheck -check-prefix=CC1 %s
// CHECK-CC1: Blue : 0 : N::Blue
// CHECK-CC1-NEXT: Green : 0 : N::Green
// CHECK-CC1-NEXT: Indigo : 0 : N::Indigo
// CHECK-CC1-NEXT: Orange : 0 : N::Orange
// CHECK-CC1-NEXT: Violet : 0 : N::Violet
- // RUN: true
diff --git a/test/CodeCompletion/function-templates.cpp b/test/CodeCompletion/function-templates.cpp
index 52cba71..d291bbe 100644
--- a/test/CodeCompletion/function-templates.cpp
+++ b/test/CodeCompletion/function-templates.cpp
@@ -8,8 +8,7 @@ namespace std {
void f() {
std::
- // RUN: clang-cc -fsyntax-only -code-completion-at=%s:10:8 %s -o - | FileCheck -check-prefix=CC1 %s &&
+ // RUN: clang-cc -fsyntax-only -code-completion-at=%s:10:8 %s -o - | FileCheck -check-prefix=CC1 %s
// CHECK-CC1: dyn_cast<<#class X#>>(<#Y *Val#>)
// CHECK-CC1: sort(<#RandomAccessIterator first#>, <#RandomAccessIterator last#>)
- // RUN: true
diff --git a/test/CodeCompletion/functions.cpp b/test/CodeCompletion/functions.cpp
index 2e1bc6e..85292e4 100644
--- a/test/CodeCompletion/functions.cpp
+++ b/test/CodeCompletion/functions.cpp
@@ -3,7 +3,6 @@ void f(float x, float y...);
void test() {
::
- // RUN: clang-cc -fsyntax-only -code-completion-at=%s:5:5 %s -o - | FileCheck -check-prefix=CC1 %s &&
+ // RUN: clang-cc -fsyntax-only -code-completion-at=%s:5:5 %s -o - | FileCheck -check-prefix=CC1 %s
// CHECK-CC1: f(<#int i#>{#, <#int j#>{#, <#int k#>#}#})
// CHECK-CC1: f(<#float x#>, <#float y#><#, ...#>)
- // RUN: true
diff --git a/test/CodeCompletion/macros.c b/test/CodeCompletion/macros.c
index d5c1f8f..20d26f2 100644
--- a/test/CodeCompletion/macros.c
+++ b/test/CodeCompletion/macros.c
@@ -13,9 +13,9 @@ struct Point {
};
void test(struct Point *p) {
- // RUN: clang-cc -fsyntax-only -code-completion-at=%s:17:14 %s -o - | FileCheck -check-prefix=CC1 %s &&
+ // RUN: clang-cc -fsyntax-only -code-completion-macros -code-completion-at=%s:17:14 %s -o - | FileCheck -check-prefix=CC1 %s
switch (p->IDENTITY(color)) {
- // RUN: clang-cc -fsyntax-only -code-completion-at=%s:19:9 %s -o - | FileCheck -check-prefix=CC2 %s &&
+ // RUN: clang-cc -fsyntax-only -code-completion-macros -code-completion-at=%s:19:9 %s -o - | FileCheck -check-prefix=CC2 %s
case
}
// CC1: color
@@ -33,5 +33,4 @@ void test(struct Point *p) {
// CC2: FOO
// CC2: IDENTITY(<#X#>)
// CC2: WIBBLE
- // RUN: true
}
diff --git a/test/CodeCompletion/member-access.c b/test/CodeCompletion/member-access.c
index 1e8e563..c9ac58f 100644
--- a/test/CodeCompletion/member-access.c
+++ b/test/CodeCompletion/member-access.c
@@ -6,8 +6,7 @@ struct Point {
void test(struct Point *p) {
p->
- // RUN: clang-cc -fsyntax-only -code-completion-at=%s:8:6 %s -o - | FileCheck -check-prefix=CC1 %s &&
+ // RUN: clang-cc -fsyntax-only -code-completion-at=%s:8:6 %s -o - | FileCheck -check-prefix=CC1 %s
// CHECK-CC1: x
// CHECK-CC1: y
// CHECK-CC1: z
- // RUN: true
diff --git a/test/CodeCompletion/member-access.cpp b/test/CodeCompletion/member-access.cpp
index b810366..e445b45 100644
--- a/test/CodeCompletion/member-access.cpp
+++ b/test/CodeCompletion/member-access.cpp
@@ -27,7 +27,7 @@ public:
void test(const Proxy &p) {
p->
- // RUN: clang-cc -fsyntax-only -code-completion-at=%s:29:6 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s &&
+ // RUN: clang-cc -fsyntax-only -code-completion-at=%s:29:6 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: member1 : 0 : [#Base1::#]member1
// CHECK-CC1: member1 : 0 : [#Base2::#]member1
// CHECK-CC1: member2 : 0 : [#Base1::#]member2
@@ -39,5 +39,4 @@ void test(const Proxy &p) {
// CHECK-CC1: memfun3 : 0 : memfun3(<#int#>)
// CHECK-CC1: Base1 : 0 : Base1::
// CHECK-CC1: memfun1 : 0 (Hidden) : Base2::memfun1(<#int#>)
- // RUN: true
diff --git a/test/CodeCompletion/namespace-alias.cpp b/test/CodeCompletion/namespace-alias.cpp
index 0fa2ec2..c1f3417 100644
--- a/test/CodeCompletion/namespace-alias.cpp
+++ b/test/CodeCompletion/namespace-alias.cpp
@@ -11,11 +11,10 @@ namespace N2 {
namespace I1 { }
namespace New =
- // RUN: clang-cc -fsyntax-only -code-completion-at=%s:13:18 %s -o - | FileCheck -check-prefix=CC1 %s &&
+ // RUN: clang-cc -fsyntax-only -code-completion-at=%s:13:18 %s -o - | FileCheck -check-prefix=CC1 %s
// CHECK-CC1: I1 : 1
// CHECK-CC1: I4 : 1
// CHECK-CC1: I5 : 1
// CHECK-CC1: N2 : 3
// CHECK-CC1-NEXT: N4 : 3
- // RUN: true
diff --git a/test/CodeCompletion/namespace.cpp b/test/CodeCompletion/namespace.cpp
index d4ed639..ff90b85 100644
--- a/test/CodeCompletion/namespace.cpp
+++ b/test/CodeCompletion/namespace.cpp
@@ -8,8 +8,7 @@ namespace N2 {
namespace I1 { }
namespace
- // RUN: clang-cc -fsyntax-only -code-completion-at=%s:10:12 %s -o - | FileCheck -check-prefix=CC1 %s &&
+ // RUN: clang-cc -fsyntax-only -code-completion-at=%s:10:12 %s -o - | FileCheck -check-prefix=CC1 %s
// CHECK-CC1: I1 : 0
// CHECK-CC1-NEXT: I5 : 0
- // RUN: true
diff --git a/test/CodeCompletion/nested-name-specifier.cpp b/test/CodeCompletion/nested-name-specifier.cpp
index 0cc5a19..8da7c37 100644
--- a/test/CodeCompletion/nested-name-specifier.cpp
+++ b/test/CodeCompletion/nested-name-specifier.cpp
@@ -10,9 +10,8 @@ namespace N {
}
N::
-// RUN: clang-cc -fsyntax-only -code-completion-at=%s:12:4 %s -o - | FileCheck -check-prefix=CC1 %s &&
+// RUN: clang-cc -fsyntax-only -code-completion-at=%s:12:4 %s -o - | FileCheck -check-prefix=CC1 %s
// CHECK-CC1: A : 0
// CHECK-CC1: B : 0
// CHECK-CC1: M : 0
-// RUN: true
diff --git a/test/CodeCompletion/objc-message.m b/test/CodeCompletion/objc-message.m
new file mode 100644
index 0000000..d16a745
--- /dev/null
+++ b/test/CodeCompletion/objc-message.m
@@ -0,0 +1,35 @@
+// Note: the run lines follow their respective tests, since line/column
+// matter in this test.
+
+@protocol FooTestProtocol
++ protocolClassMethod;
+- protocolInstanceMethod;
+@end
+@interface Foo <FooTestProtocol> {
+ void *isa;
+}
++ (int)classMethod1:a withKeyword:b;
++ (void)classMethod2;
++ new;
+- instanceMethod1;
+@end
+
+@interface Foo (FooTestCategory)
++ categoryClassMethod;
+- categoryInstanceMethod;
+@end
+
+void func() {
+ Foo *obj = [Foo new];
+ [obj xx];
+}
+// RUN: clang-cc -fsyntax-only -code-completion-at=%s:23:19 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
+// CHECK-CC1: categoryClassMethod : 0
+// CHECK-CC1: classMethod1:withKeyword: : 0
+// CHECK-CC1: classMethod2 : 0
+// CHECK-CC1: new : 0
+// CHECK-CC1: protocolClassMethod : 0
+// RUN: clang-cc -fsyntax-only -code-completion-at=%s:24:8 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s
+// CHECK-CC2: categoryInstanceMethod : 0
+// CHECK-CC2: instanceMethod1 : 0
+// CHECK-CC2: protocolInstanceMethod : 0
diff --git a/test/CodeCompletion/operator.cpp b/test/CodeCompletion/operator.cpp
index a3950f6..20ba5ba 100644
--- a/test/CodeCompletion/operator.cpp
+++ b/test/CodeCompletion/operator.cpp
@@ -8,11 +8,10 @@ void f() {
typedef float Float;
operator
- // RUN: clang-cc -fsyntax-only -code-completion-at=%s:10:11 %s -o - | FileCheck -check-prefix=CC1 %s &&
+ // RUN: clang-cc -fsyntax-only -code-completion-at=%s:10:11 %s -o - | FileCheck -check-prefix=CC1 %s
// CHECK-CC1: Float : 0
// CHECK-CC1: + : 0
// CHECK-CC1: short : 0
// CHECK-CC1: Integer : 2
// CHECK-CC1: T : 2
// CHECK-CC1: N : 6
- // RUN: true
diff --git a/test/CodeCompletion/ordinary-name.c b/test/CodeCompletion/ordinary-name.c
index 586e2b3..680d6dc 100644
--- a/test/CodeCompletion/ordinary-name.c
+++ b/test/CodeCompletion/ordinary-name.c
@@ -4,9 +4,8 @@ typedef struct t TYPEDEF;
void foo() {
int y;
- // RUN: clang-cc -fsyntax-only -code-completion-at=%s:6:9 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s &&
+ // RUN: clang-cc -fsyntax-only -code-completion-at=%s:6:9 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: y : 0
// CHECK-CC1: foo : 2
// CHECK-NOT-CC1: y : 2
// CHECK-CC1-NEXT: TYPEDEF : 2
- // RUN: true
diff --git a/test/CodeCompletion/property.m b/test/CodeCompletion/property.m
index 7f2321e..184519b 100644
--- a/test/CodeCompletion/property.m
+++ b/test/CodeCompletion/property.m
@@ -6,7 +6,7 @@
}
@property(copy) Foo *myprop;
@property(retain, nonatomic) id xx;
-// RUN: clang-cc -fsyntax-only -code-completion-at=%s:7:11 %s -o - | FileCheck -check-prefix=CC1 %s &&
+// RUN: clang-cc -fsyntax-only -code-completion-at=%s:7:11 %s -o - | FileCheck -check-prefix=CC1 %s
// CC1: assign
// CC1-NEXT: copy
// CC1-NEXT: getter
diff --git a/test/CodeCompletion/tag.c b/test/CodeCompletion/tag.c
index e7250f5..6d9c1ea 100644
--- a/test/CodeCompletion/tag.c
+++ b/test/CodeCompletion/tag.c
@@ -7,7 +7,6 @@ void X();
void test() {
enum X { x };
enum
- // RUN: clang-cc -fsyntax-only -code-completion-at=%s:9:7 %s -o - | FileCheck -check-prefix=CC1 %s &&
+ // RUN: clang-cc -fsyntax-only -code-completion-at=%s:9:7 %s -o - | FileCheck -check-prefix=CC1 %s
// CHECK-CC1: X : 0
// CHECK-CC1: Y : 2
- // RUN: true
diff --git a/test/CodeCompletion/tag.cpp b/test/CodeCompletion/tag.cpp
index b00ff1f..17c9707 100644
--- a/test/CodeCompletion/tag.cpp
+++ b/test/CodeCompletion/tag.cpp
@@ -15,7 +15,7 @@ namespace N {
void test() {
class
- // RUN: clang-cc -fsyntax-only -code-completion-at=%s:17:10 %s -o - | FileCheck -check-prefix=CC1 %s &&
+ // RUN: clang-cc -fsyntax-only -code-completion-at=%s:17:10 %s -o - | FileCheck -check-prefix=CC1 %s
// CHECK-CC1: Y : 2
// CHECK-CC1: Z : 2
// CHECK-CC1: A : 4
@@ -23,4 +23,3 @@ namespace N {
// CHECK-CC1: Y : 4
// CHECK-CC1: M : 9 : M::
// CHECK-CC1: N : 9 : N::
- // RUN: true
diff --git a/test/CodeCompletion/templates.cpp b/test/CodeCompletion/templates.cpp
index 22cca65..d35e0bb 100644
--- a/test/CodeCompletion/templates.cpp
+++ b/test/CodeCompletion/templates.cpp
@@ -8,10 +8,9 @@ namespace std {
void f() {
std::
- // RUN: clang-cc -fsyntax-only -code-completion-at=%s:10:8 %s -o - | FileCheck -check-prefix=CC1 %s &&
+ // RUN: clang-cc -fsyntax-only -code-completion-at=%s:10:8 %s -o - | FileCheck -check-prefix=CC1 %s
// CHECK-CC1: allocator<<#typename T#>>
// CHECK-CC1: vector<<#typename T#>{#, <#typename Alloc#>#}>
- // RUN: true
diff --git a/test/CodeCompletion/truncation.c b/test/CodeCompletion/truncation.c
index b72aa7f..5af3c4b 100644
--- a/test/CodeCompletion/truncation.c
+++ b/test/CodeCompletion/truncation.c
@@ -2,11 +2,10 @@
struct
-// RUN: clang-cc -fsyntax-only -code-completion-at=%s.h:4:8 -o - %s | FileCheck -check-prefix=CC1 %s &&
+// RUN: clang-cc -fsyntax-only -code-completion-at=%s.h:4:8 -o - %s | FileCheck -check-prefix=CC1 %s
// CHECK-CC1: X : 1
// CHECK-CC1-NEXT: Y : 1
-// RUN: clang-cc -fsyntax-only -code-completion-at=%s:3:8 -o - %s | FileCheck -check-prefix=CC2 %s &&
+// RUN: clang-cc -fsyntax-only -code-completion-at=%s:3:8 -o - %s | FileCheck -check-prefix=CC2 %s
// CHECK-CC2: X : 1
// CHECK-CC2: Xa : 1
// CHECK-CC2: Y : 1
-// RUN: true
diff --git a/test/CodeCompletion/using-namespace.cpp b/test/CodeCompletion/using-namespace.cpp
index a332b88..57383d5 100644
--- a/test/CodeCompletion/using-namespace.cpp
+++ b/test/CodeCompletion/using-namespace.cpp
@@ -12,10 +12,9 @@ namespace N2 {
void foo() {
using namespace
- // RUN: clang-cc -fsyntax-only -code-completion-at=%s:14:20 %s -o - | FileCheck -check-prefix=CC1 %s &&
+ // RUN: clang-cc -fsyntax-only -code-completion-at=%s:14:20 %s -o - | FileCheck -check-prefix=CC1 %s
// CHECK-CC1: I1 : 2
// CHECK-CC1: I4 : 2
// CHECK-CC1: I5 : 2
// CHECK-CC1: N2 : 4
// CHECK-CC1-NEXT: N4 : 4
- // RUN: true
diff --git a/test/CodeCompletion/using.cpp b/test/CodeCompletion/using.cpp
index 57b3aa7..305afda 100644
--- a/test/CodeCompletion/using.cpp
+++ b/test/CodeCompletion/using.cpp
@@ -14,12 +14,11 @@ namespace N2 {
int N3;
using
- // RUN: clang-cc -fsyntax-only -code-completion-at=%s:16:10 %s -o - | FileCheck -check-prefix=CC1 %s &&
+ // RUN: clang-cc -fsyntax-only -code-completion-at=%s:16:10 %s -o - | FileCheck -check-prefix=CC1 %s
// CHECK-CC1: I1 : 2
// CHECK-CC1: I4 : 2
// CHECK-CC1: I5 : 2
// CHECK-CC1: N2 : 4
// CHECK-CC1: N3 : 4
// CHECK-CC1-NEXT: N4 : 4
- // RUN: true
diff --git a/test/CodeGen/2008-07-17-no-emit-on-error.c b/test/CodeGen/2008-07-17-no-emit-on-error.c
index 51ba2b4..fbff541 100644
--- a/test/CodeGen/2008-07-17-no-emit-on-error.c
+++ b/test/CodeGen/2008-07-17-no-emit-on-error.c
@@ -1,5 +1,5 @@
-// RUN: rm -f %t1.bc &&
-// RUN: not clang-cc %s -emit-llvm-bc -o %t1.bc &&
+// RUN: rm -f %t1.bc
+// RUN: not clang-cc %s -emit-llvm-bc -o %t1.bc
// RUN: not test -f %t1.bc
void f() {
diff --git a/test/CodeGen/2008-07-22-bitfield-init-after-zero-len-array.c b/test/CodeGen/2008-07-22-bitfield-init-after-zero-len-array.c
index 348ea75..db3c4b2 100644
--- a/test/CodeGen/2008-07-22-bitfield-init-after-zero-len-array.c
+++ b/test/CodeGen/2008-07-22-bitfield-init-after-zero-len-array.c
@@ -9,4 +9,4 @@ struct et7 {
};
// CHECK: @yv7 = global
-// CHECK: i8 52, \ No newline at end of file
+// CHECK: i8 52,
diff --git a/test/CodeGen/2008-07-29-override-alias-decl.c b/test/CodeGen/2008-07-29-override-alias-decl.c
index 8729500..18e8982 100644
--- a/test/CodeGen/2008-07-29-override-alias-decl.c
+++ b/test/CodeGen/2008-07-29-override-alias-decl.c
@@ -2,10 +2,10 @@
int x() { return 1; }
-// CHECK: %retval = alloca i32
-// CHECK: store i32 1, i32* %retval
-// CHECK: %0 = load i32* %retval
-// CHECK: ret i32 %0
+// CHECK: [[retval:%.*]] = alloca i32
+// CHECK: store i32 1, i32* [[retval]]
+// CHECK: [[load:%.*]] = load i32* [[retval]]
+// CHECK: ret i32 [[load]]
int f() __attribute__((weak, alias("x")));
@@ -17,9 +17,9 @@ int h() {
return f();
}
-// CHECK: %retval = alloca i32
-// CHECK: %call = call i32 (...)* @f()
-// CHECK: store i32 %call, i32* %retval
-// CHECK: %0 = load i32* %retval
-// CHECK: ret i32 %0
+// CHECK: [[retval:%.*]] = alloca i32
+// CHECK: [[call:%.*]] = call i32 (...)* @f()
+// CHECK: store i32 [[call]], i32* [[retval]]
+// CHECK: [[load:%.*]] = load i32* [[retval]]
+// CHECK: ret i32 [[load]]
diff --git a/test/CodeGen/2008-07-30-implicit-initialization.c b/test/CodeGen/2008-07-30-implicit-initialization.c
index 2f4c14e..9cd5300 100644
--- a/test/CodeGen/2008-07-30-implicit-initialization.c
+++ b/test/CodeGen/2008-07-30-implicit-initialization.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -triple i386-unknown-unknown --emit-llvm-bc -o - %s | opt --std-compile-opts | llvm-dis > %t &&
-// RUN: grep "ret i32" %t | count 2 &&
+// RUN: clang-cc -triple i386-unknown-unknown --emit-llvm-bc -o - %s | opt --std-compile-opts | llvm-dis > %t
+// RUN: grep "ret i32" %t | count 2
// RUN: grep "ret i32 0" %t | count 2
// <rdar://problem/6113085>
diff --git a/test/CodeGen/2008-07-31-asm-labels.c b/test/CodeGen/2008-07-31-asm-labels.c
index f114f65..d2dcc04 100644
--- a/test/CodeGen/2008-07-31-asm-labels.c
+++ b/test/CodeGen/2008-07-31-asm-labels.c
@@ -1,10 +1,10 @@
-// RUN: clang-cc -emit-llvm -o %t %s &&
-// RUN: grep "@pipe()" %t | count 0 &&
-// RUN: grep '_thisIsNotAPipe' %t | count 3 &&
-// RUN: grep 'g0' %t | count 0 &&
-// RUN: grep '_renamed' %t | count 2 &&
-// RUN: clang-cc -DUSE_DEF -emit-llvm -o %t %s &&
-// RUN: grep "@pipe()" %t | count 0 &&
+// RUN: clang-cc -emit-llvm -o %t %s
+// RUN: grep "@pipe()" %t | count 0
+// RUN: grep '_thisIsNotAPipe' %t | count 3
+// RUN: grep 'g0' %t | count 0
+// RUN: grep '_renamed' %t | count 2
+// RUN: clang-cc -DUSE_DEF -emit-llvm -o %t %s
+// RUN: grep "@pipe()" %t | count 0
// RUN: grep '_thisIsNotAPipe' %t | count 3
// <rdr://6116729>
diff --git a/test/CodeGen/2009-10-20-GlobalDebug.c b/test/CodeGen/2009-10-20-GlobalDebug.c
index eea3fb5..fddc76c 100644
--- a/test/CodeGen/2009-10-20-GlobalDebug.c
+++ b/test/CodeGen/2009-10-20-GlobalDebug.c
@@ -1,4 +1,4 @@
// RUN: clang -ccc-host-triple i386-apple-darwin10 -S -g -dA %s -o - | FileCheck %s
int global;
-// CHECK: asciz "global" ## DW_AT_MIPS_linkage_name
+// CHECK: asciz "global" ## DW_AT_name
int main() { return 0;}
diff --git a/test/CodeGen/PR2001-bitfield-reload.c b/test/CodeGen/PR2001-bitfield-reload.c
index 797b494..1fef3c5 100644
--- a/test/CodeGen/PR2001-bitfield-reload.c
+++ b/test/CodeGen/PR2001-bitfield-reload.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -triple i386-unknown-unknown --emit-llvm-bc -o - %s | opt --std-compile-opts | llvm-dis > %t &&
-// RUN: grep "ret i32" %t | count 1 &&
+// RUN: clang-cc -triple i386-unknown-unknown --emit-llvm-bc -o - %s | opt --std-compile-opts | llvm-dis > %t
+// RUN: grep "ret i32" %t | count 1
// RUN: grep "ret i32 1" %t | count 1
// PR2001
diff --git a/test/CodeGen/PR3589-freestanding-libcalls.c b/test/CodeGen/PR3589-freestanding-libcalls.c
index 90b5fff..1460813 100644
--- a/test/CodeGen/PR3589-freestanding-libcalls.c
+++ b/test/CodeGen/PR3589-freestanding-libcalls.c
@@ -1,8 +1,8 @@
-// RUN: clang-cc -emit-llvm %s -o - | grep 'declare i32 @printf' | count 1 &&
-// RUN: clang-cc -O2 -emit-llvm %s -o - | grep 'declare i32 @puts' | count 1 &&
+// RUN: clang-cc -emit-llvm %s -o - | grep 'declare i32 @printf' | count 1
+// RUN: clang-cc -O2 -emit-llvm %s -o - | grep 'declare i32 @puts' | count 1
// RUN: clang-cc -ffreestanding -O2 -emit-llvm %s -o - | grep 'declare i32 @puts' | count 0
-#include <stdio.h>
+int printf(const char *, ...);
void f0() {
printf("hello\n");
diff --git a/test/CodeGen/PR3613-static-decl.c b/test/CodeGen/PR3613-static-decl.c
index 2083581..a9dc744 100644
--- a/test/CodeGen/PR3613-static-decl.c
+++ b/test/CodeGen/PR3613-static-decl.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm -o %t %s &&
+// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm -o %t %s
// RUN: grep '@g0 = internal global %.truct.s0 { i32 3 }' %t | count 1
struct s0 {
diff --git a/test/CodeGen/PR4611-bitfield-layout.c b/test/CodeGen/PR4611-bitfield-layout.c
index 83ce4ff..bc514bf 100644
--- a/test/CodeGen/PR4611-bitfield-layout.c
+++ b/test/CodeGen/PR4611-bitfield-layout.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-unknown-unknown %s -emit-llvm -o %t &&
+// RUN: clang-cc -triple i386-unknown-unknown %s -emit-llvm -o %t
// RUN: grep "struct.object_entry = type { i8, \[2 x i8\], i8 }" %t
struct object_entry {
diff --git a/test/CodeGen/address-space-field1.c b/test/CodeGen/address-space-field1.c
index f8ec83c..b041cf55 100644
--- a/test/CodeGen/address-space-field1.c
+++ b/test/CodeGen/address-space-field1.c
@@ -1,23 +1,22 @@
// RUN: clang-cc -emit-llvm < %s -o - | FileCheck %s
// CHECK:%struct.S = type { i32, i32 }
// CHECK:define void @test_addrspace(%struct.S addrspace(1)* %p1, %struct.S addrspace(2)* %p2) nounwind
-// CHECK:entry:
-// CHECK: %p1.addr = alloca %struct.S addrspace(1)* ; <%struct.S addrspace(1)**> [#uses=3]
-// CHECK: %p2.addr = alloca %struct.S addrspace(2)* ; <%struct.S addrspace(2)**> [#uses=3]
-// CHECK: store %struct.S addrspace(1)* %p1, %struct.S addrspace(1)** %p1.addr
-// CHECK: store %struct.S addrspace(2)* %p2, %struct.S addrspace(2)** %p2.addr
-// CHECK: %tmp = load %struct.S addrspace(2)** %p2.addr ; <%struct.S addrspace(2)*> [#uses=1]
-// CHECK: %tmp1 = getelementptr inbounds %struct.S addrspace(2)* %tmp, i32 0, i32 1 ; <i32 addrspace(2)*> [#uses=1]
-// CHECK: %tmp2 = load i32 addrspace(2)* %tmp1 ; <i32> [#uses=1]
-// CHECK: %tmp3 = load %struct.S addrspace(1)** %p1.addr ; <%struct.S addrspace(1)*> [#uses=1]
-// CHECK: %tmp4 = getelementptr inbounds %struct.S addrspace(1)* %tmp3, i32 0, i32 0 ; <i32 addrspace(1)*> [#uses=1]
-// CHECK: store i32 %tmp2, i32 addrspace(1)* %tmp4
-// CHECK: %tmp5 = load %struct.S addrspace(2)** %p2.addr ; <%struct.S addrspace(2)*> [#uses=1]
-// CHECK: %tmp6 = getelementptr inbounds %struct.S addrspace(2)* %tmp5, i32 0, i32 0 ; <i32 addrspace(2)*> [#uses=1]
-// CHECK: %tmp7 = load i32 addrspace(2)* %tmp6 ; <i32> [#uses=1]
-// CHECK: %tmp8 = load %struct.S addrspace(1)** %p1.addr ; <%struct.S addrspace(1)*> [#uses=1]
-// CHECK: %tmp9 = getelementptr inbounds %struct.S addrspace(1)* %tmp8, i32 0, i32 1 ; <i32 addrspace(1)*> [#uses=1]
-// CHECK: store i32 %tmp7, i32 addrspace(1)* %tmp9
+// CHECK: [[p1addr:%.*]] = alloca %struct.S addrspace(1)* ; <%struct.S addrspace(1)**> [#uses=3]
+// CHECK: [[p2addr:%.*]] = alloca %struct.S addrspace(2)* ; <%struct.S addrspace(2)**> [#uses=3]
+// CHECK: store %struct.S addrspace(1)* %p1, %struct.S addrspace(1)** [[p1addr]]
+// CHECK: store %struct.S addrspace(2)* %p2, %struct.S addrspace(2)** [[p2addr]]
+// CHECK: [[t0:%.*]] = load %struct.S addrspace(2)** [[p2addr]] ; <%struct.S addrspace(2)*> [#uses=1]
+// CHECK: [[t1:%.*]] = getelementptr inbounds %struct.S addrspace(2)* [[t0]], i32 0, i32 1 ; <i32 addrspace(2)*> [#uses=1]
+// CHECK: [[t2:%.*]] = load i32 addrspace(2)* [[t1]] ; <i32> [#uses=1]
+// CHECK: [[t3:%.*]] = load %struct.S addrspace(1)** [[p1addr]] ; <%struct.S addrspace(1)*> [#uses=1]
+// CHECK: [[t4:%.*]] = getelementptr inbounds %struct.S addrspace(1)* [[t3]], i32 0, i32 0 ; <i32 addrspace(1)*> [#uses=1]
+// CHECK: store i32 [[t2]], i32 addrspace(1)* [[t4]]
+// CHECK: [[t5:%.*]] = load %struct.S addrspace(2)** [[p2addr]] ; <%struct.S addrspace(2)*> [#uses=1]
+// CHECK: [[t6:%.*]] = getelementptr inbounds %struct.S addrspace(2)* [[t5]], i32 0, i32 0 ; <i32 addrspace(2)*> [#uses=1]
+// CHECK: [[t7:%.*]] = load i32 addrspace(2)* [[t6]] ; <i32> [#uses=1]
+// CHECK: [[t8:%.*]] = load %struct.S addrspace(1)** [[p1addr]] ; <%struct.S addrspace(1)*> [#uses=1]
+// CHECK: [[t9:%.*]] = getelementptr inbounds %struct.S addrspace(1)* [[t8]], i32 0, i32 1 ; <i32 addrspace(1)*> [#uses=1]
+// CHECK: store i32 [[t7]], i32 addrspace(1)* [[t9]]
// CHECK: ret void
// CHECK:}
diff --git a/test/CodeGen/address-space.c b/test/CodeGen/address-space.c
index 3b6a8e6..8536f16 100644
--- a/test/CodeGen/address-space.c
+++ b/test/CodeGen/address-space.c
@@ -1,7 +1,7 @@
-// RUN: clang-cc -emit-llvm < %s | grep '@foo.*global.*addrspace(1)' &&
-// RUN: clang-cc -emit-llvm < %s | grep '@ban.*global.*addrspace(1)' &&
-// RUN: clang-cc -emit-llvm < %s | grep 'load.*addrspace(1)' | count 2 &&
-// RUN: clang-cc -emit-llvm < %s | grep 'load.*addrspace(2).. @A' &&
+// RUN: clang-cc -emit-llvm < %s | grep '@foo.*global.*addrspace(1)'
+// RUN: clang-cc -emit-llvm < %s | grep '@ban.*global.*addrspace(1)'
+// RUN: clang-cc -emit-llvm < %s | grep 'load.*addrspace(1)' | count 2
+// RUN: clang-cc -emit-llvm < %s | grep 'load.*addrspace(2).. @A'
// RUN: clang-cc -emit-llvm < %s | grep 'load.*addrspace(2).. @B'
int foo __attribute__((address_space(1)));
diff --git a/test/CodeGen/alias.c b/test/CodeGen/alias.c
index b0c71fb..f8836e6 100644
--- a/test/CodeGen/alias.c
+++ b/test/CodeGen/alias.c
@@ -1,8 +1,8 @@
-// RUN: clang-cc -triple i386-pc-linux-gnu -emit-llvm -o %t %s &&
-// RUN: grep '@g0 = common global i32 0' %t &&
-// RUN: grep '@f1 = alias void ()\* @f0' %t &&
-// RUN: grep '@g1 = alias i32\* @g0' %t &&
-// RUN: grep 'define void @f0() nounwind {' %t &&
+// RUN: clang-cc -triple i386-pc-linux-gnu -emit-llvm -o %t %s
+// RUN: grep '@g0 = common global i32 0' %t
+// RUN: grep '@f1 = alias void ()\* @f0' %t
+// RUN: grep '@g1 = alias i32\* @g0' %t
+// RUN: grep 'define void @f0() nounwind {' %t
void f0(void) { }
extern void f1(void);
@@ -14,7 +14,7 @@ extern int g1 __attribute((alias("g0")));
// Make sure that aliases cause referenced values to be emitted.
// PR3200
-// RUN: grep 'define internal i32 @foo1()' %t &&
+// RUN: grep 'define internal i32 @foo1()' %t
static inline int foo1() { return 0; }
int foo() __attribute__((alias("foo1")));
diff --git a/test/CodeGen/alignof.c b/test/CodeGen/alignof.c
index d39f4e4..71c2750 100644
--- a/test/CodeGen/alignof.c
+++ b/test/CodeGen/alignof.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-unknown-unknown -O1 -emit-llvm -o %t %s &&
+// RUN: clang-cc -triple i386-unknown-unknown -O1 -emit-llvm -o %t %s
// RUN: grep 'ret i32 4' %t
enum e0 { E0 };
diff --git a/test/CodeGen/always_inline.c b/test/CodeGen/always_inline.c
index c12b454..d995ea1 100644
--- a/test/CodeGen/always_inline.c
+++ b/test/CodeGen/always_inline.c
@@ -1,7 +1,7 @@
-// RUN: clang -emit-llvm -S -o %t %s &&
-// RUN: not grep '@f0' %t &&
-// RUN: not grep 'call ' %t &&
-// RUN: clang -mllvm -disable-llvm-optzns -emit-llvm -S -o %t %s &&
+// RUN: clang -emit-llvm -S -o %t %s
+// RUN: not grep '@f0' %t
+// RUN: not grep 'call ' %t
+// RUN: clang -mllvm -disable-llvm-optzns -emit-llvm -S -o %t %s
// RUN: grep '@f0' %t | count 2
//static int f0() {
diff --git a/test/CodeGen/arm-arguments.c b/test/CodeGen/arm-arguments.c
index c43ede2..3b2c433 100644
--- a/test/CodeGen/arm-arguments.c
+++ b/test/CodeGen/arm-arguments.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple armv7-apple-darwin9 -target-abi=apcs-gnu -emit-llvm -w -o - %s | FileCheck -check-prefix=APCS-GNU %s &&
+// RUN: clang-cc -triple armv7-apple-darwin9 -target-abi=apcs-gnu -emit-llvm -w -o - %s | FileCheck -check-prefix=APCS-GNU %s
// RUN: clang-cc -triple armv7-apple-darwin9 -target-abi=aapcs -emit-llvm -w -o - %s | FileCheck -check-prefix=AAPCS %s
// APCS-GNU: define arm_apcscc signext i8 @f0()
diff --git a/test/CodeGen/asm-2.c b/test/CodeGen/asm-2.c
index f5b378e..72b23b1 100644
--- a/test/CodeGen/asm-2.c
+++ b/test/CodeGen/asm-2.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -emit-llvm %s -o %t -triple i386-pc-linux-gnu -O2 &&
+// RUN: clang-cc -emit-llvm %s -o %t -triple i386-pc-linux-gnu -O2
// RUN: not grep "load" %t
// <rdar://problem/6841383>
diff --git a/test/CodeGen/asm-inout.c b/test/CodeGen/asm-inout.c
index bd287ad..8ddd2ac 100644
--- a/test/CodeGen/asm-inout.c
+++ b/test/CodeGen/asm-inout.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm %s -o %t &&
+// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm %s -o %t
// RUN: grep "load i8\*\*\* %p.addr" %t | count 1
// XFAIL: *
diff --git a/test/CodeGen/asm.c b/test/CodeGen/asm.c
index 52afc91..41951b8 100644
--- a/test/CodeGen/asm.c
+++ b/test/CodeGen/asm.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm %s -o %t &&
+// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm %s -o %t
void t1(int len) {
__asm__ volatile("" : "=&r"(len), "+&r"(len));
}
@@ -28,12 +28,12 @@ void t6(void) {
__asm__ volatile("" : : "i" (t6));
}
-// RUN: grep "T7 NAMED: \$1" %t &&
+// RUN: grep "T7 NAMED: \$1" %t
void t7(int a) {
__asm__ volatile("T7 NAMED: %[input]" : "+r"(a): [input] "i" (4));
}
-// RUN: grep "T8 NAMED MODIFIER: \${0:c}" %t &&
+// RUN: grep "T8 NAMED MODIFIER: \${0:c}" %t
void t8() {
__asm__ volatile("T8 NAMED MODIFIER: %c[input]" :: [input] "i" (4));
}
diff --git a/test/CodeGen/atomic.c b/test/CodeGen/atomic.c
index 66dc702..355f7b8 100644
--- a/test/CodeGen/atomic.c
+++ b/test/CodeGen/atomic.c
@@ -1,14 +1,14 @@
-// RUN: clang-cc %s -emit-llvm -o - -triple=i686-apple-darwin9 > %t1 &&
-// RUN: grep @llvm.atomic.load.add.i32 %t1 | count 3 &&
-// RUN: grep @llvm.atomic.load.sub.i8 %t1 | count 2 &&
-// RUN: grep @llvm.atomic.load.min.i32 %t1 &&
-// RUN: grep @llvm.atomic.load.max.i32 %t1 &&
-// RUN: grep @llvm.atomic.load.umin.i32 %t1 &&
-// RUN: grep @llvm.atomic.load.umax.i32 %t1 &&
-// RUN: grep @llvm.atomic.swap.i32 %t1 &&
-// RUN: grep @llvm.atomic.cmp.swap.i32 %t1 | count 4 &&
-// RUN: grep @llvm.atomic.load.and.i32 %t1 | count 2 &&
-// RUN: grep @llvm.atomic.load.or.i8 %t1 &&
+// RUN: clang-cc %s -emit-llvm -o - -triple=i686-apple-darwin9 > %t1
+// RUN: grep @llvm.atomic.load.add.i32 %t1 | count 3
+// RUN: grep @llvm.atomic.load.sub.i8 %t1 | count 2
+// RUN: grep @llvm.atomic.load.min.i32 %t1
+// RUN: grep @llvm.atomic.load.max.i32 %t1
+// RUN: grep @llvm.atomic.load.umin.i32 %t1
+// RUN: grep @llvm.atomic.load.umax.i32 %t1
+// RUN: grep @llvm.atomic.swap.i32 %t1
+// RUN: grep @llvm.atomic.cmp.swap.i32 %t1 | count 4
+// RUN: grep @llvm.atomic.load.and.i32 %t1 | count 2
+// RUN: grep @llvm.atomic.load.or.i8 %t1
// RUN: grep @llvm.atomic.load.xor.i8 %t1
diff --git a/test/CodeGen/attr-nodebug.c b/test/CodeGen/attr-nodebug.c
index b96ad26..e0c8133 100644
--- a/test/CodeGen/attr-nodebug.c
+++ b/test/CodeGen/attr-nodebug.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -g -emit-llvm -o %t %s &&
+// RUN: clang-cc -g -emit-llvm -o %t %s
// RUN: not grep 'call void @llvm.dbg.func.start' %t
void t1() __attribute__((nodebug));
diff --git a/test/CodeGen/attr-noinline.c b/test/CodeGen/attr-noinline.c
index 199c291..719d6eb 100644
--- a/test/CodeGen/attr-noinline.c
+++ b/test/CodeGen/attr-noinline.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -g -emit-llvm -o %t %s &&
+// RUN: clang-cc -g -emit-llvm -o %t %s
// RUN: grep 'noinline' %t
void t1() __attribute__((noinline));
diff --git a/test/CodeGen/attr-used.c b/test/CodeGen/attr-used.c
index 8521ffd..5537ec2 100644
--- a/test/CodeGen/attr-used.c
+++ b/test/CodeGen/attr-used.c
@@ -1,6 +1,6 @@
-// RUN: clang-cc -emit-llvm -o %t %s &&
-// RUN: grep '@llvm.used = .*@g0' %t &&
-// RUN: grep '@llvm.used = .*@f0' %t &&
+// RUN: clang-cc -emit-llvm -o %t %s
+// RUN: grep '@llvm.used = .*@g0' %t
+// RUN: grep '@llvm.used = .*@f0' %t
// RUN: grep '@llvm.used = .*@f1.l0' %t
diff --git a/test/CodeGen/attributes.c b/test/CodeGen/attributes.c
index d539e03..29672c2 100644
--- a/test/CodeGen/attributes.c
+++ b/test/CodeGen/attributes.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -emit-llvm -triple i386-linux-gnu -o %t %s &&
+// RUN: clang-cc -emit-llvm -triple i386-linux-gnu -o %t %s
// RUN: FileCheck --input-file=%t %s
// CHECK: @t5 = weak global i32 2
@@ -69,8 +69,7 @@ int t19(void) {
}
// CHECK:define void @t20() nounwind {
-// CHECK-NEXT:entry:
-// CHECK-NEXT: call void @abort()
+// CHECK: call void @abort()
// CHECK-NEXT: unreachable
void t20(void) {
__builtin_abort();
diff --git a/test/CodeGen/bitfield-assign.c b/test/CodeGen/bitfield-assign.c
index 05d4dda..575a9fb 100644
--- a/test/CodeGen/bitfield-assign.c
+++ b/test/CodeGen/bitfield-assign.c
@@ -4,13 +4,13 @@
/* Check that we get one load for each simple assign and two for the
compound assign (load the old value before the add then load again
to store back). Also check that our g0 pattern is good. */
-// RUN: clang-cc -triple i386-unknown-unknown -O0 -emit-llvm -o %t %s &&
-// RUN: grep 'load ' %t | count 5 &&
-// RUN: grep "@g0" %t | count 4 &&
+// RUN: clang-cc -triple i386-unknown-unknown -O0 -emit-llvm -o %t %s
+// RUN: grep 'load ' %t | count 5
+// RUN: grep "@g0" %t | count 4
// Check that we got the right value.
-// RUN: clang-cc -triple i386-unknown-unknown -O3 -emit-llvm -o %t %s &&
-// RUN: grep 'load ' %t | count 0 &&
+// RUN: clang-cc -triple i386-unknown-unknown -O3 -emit-llvm -o %t %s
+// RUN: grep 'load ' %t | count 0
// RUN: grep "@g0" %t | count 0
struct s0 {
diff --git a/test/CodeGen/bitfield-promote.c b/test/CodeGen/bitfield-promote.c
index 5894e51..1290a1e 100644
--- a/test/CodeGen/bitfield-promote.c
+++ b/test/CodeGen/bitfield-promote.c
@@ -1,7 +1,6 @@
-// RUN: clang -O3 -emit-llvm -S -o %t %s &&
-// RUN: grep 'ret i64 4294967292' %t | count 2 &&
-// RUN: grep 'ret i64 -4' %t | count 1 &&
-// RUN: true
+// RUN: clang -O3 -emit-llvm -S -o %t %s
+// RUN: grep 'ret i64 4294967292' %t | count 2
+// RUN: grep 'ret i64 -4' %t | count 1
long long f0(void) {
struct { unsigned f0 : 32; } x = { 18 };
diff --git a/test/CodeGen/bitfield.c b/test/CodeGen/bitfield.c
index 02f2de7..9cd79d3 100644
--- a/test/CodeGen/bitfield.c
+++ b/test/CodeGen/bitfield.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -triple i386-unknown-unknown %s -emit-llvm -o %t -O3 &&
-// RUN: grep "ret i32" %t | count 4 &&
+// RUN: clang-cc -triple i386-unknown-unknown %s -emit-llvm -o %t -O3
+// RUN: grep "ret i32" %t | count 4
// RUN: grep "ret i32 1" %t | count 4
static int f0(int n) {
diff --git a/test/CodeGen/blocks-1.c b/test/CodeGen/blocks-1.c
index 10498cb..ae5a74a 100644
--- a/test/CodeGen/blocks-1.c
+++ b/test/CodeGen/blocks-1.c
@@ -1,13 +1,13 @@
-// RUN: clang-cc %s -emit-llvm -o %t -fblocks &&
-// RUN: grep "_Block_object_dispose" %t | count 17 &&
-// RUN: grep "__copy_helper_block_" %t | count 16 &&
-// RUN: grep "__destroy_helper_block_" %t | count 16 &&
-// RUN: grep "__Block_byref_id_object_copy_" %t | count 2 &&
-// RUN: grep "__Block_byref_id_object_dispose_" %t | count 2 &&
-// RUN: grep "i32 135)" %t | count 2 &&
+// RUN: clang-cc %s -emit-llvm -o %t -fblocks
+// RUN: grep "_Block_object_dispose" %t | count 17
+// RUN: grep "__copy_helper_block_" %t | count 16
+// RUN: grep "__destroy_helper_block_" %t | count 16
+// RUN: grep "__Block_byref_id_object_copy_" %t | count 2
+// RUN: grep "__Block_byref_id_object_dispose_" %t | count 2
+// RUN: grep "i32 135)" %t | count 2
// RUN: grep "_Block_object_assign" %t | count 10
-#include <stdio.h>
+int printf(const char *, ...);
void test1() {
__block int a;
diff --git a/test/CodeGen/blocks-2.c b/test/CodeGen/blocks-2.c
index acbaafd..c22e882 100644
--- a/test/CodeGen/blocks-2.c
+++ b/test/CodeGen/blocks-2.c
@@ -1,5 +1,9 @@
-// RUN: clang-cc -g %s -emit-llvm -o %t -fblocks &&
+// RUN: clang-cc -g %s -emit-llvm -o %t -fblocks
// RUN: grep "func.start" %t | count 4
+// RUN: clang-cc -g %s -triple i386-unknown-unknown -emit-llvm -o %t -fblocks -fblock-introspection
+// RUN: grep "v8@?0i4" %t | count 1
+// RUN: clang-cc -g %s -triple i386-unknown-unknown -emit-llvm -o %t -fblocks
+// RUN: grep "v8@?0i4" %t | count 0
// 1 declaration, 1 bar, 1 test_block_dbg and 1 for the block.
// XFAIL: *
diff --git a/test/CodeGen/blocks-aligned-byref-variable.c b/test/CodeGen/blocks-aligned-byref-variable.c
index 1ae3062..61522fd 100644
--- a/test/CodeGen/blocks-aligned-byref-variable.c
+++ b/test/CodeGen/blocks-aligned-byref-variable.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -emit-llvm -o - -triple x86_64-apple-darwin10 &&
+// RUN: clang-cc -emit-llvm -o - -triple x86_64-apple-darwin10
// RUN: clang-cc -emit-llvm -o - -triple i386-apple-darwin10
typedef int __attribute__((aligned(32))) ai;
diff --git a/test/CodeGen/blocks-seq.c b/test/CodeGen/blocks-seq.c
index 3ff241e..4006b71 100644
--- a/test/CodeGen/blocks-seq.c
+++ b/test/CodeGen/blocks-seq.c
@@ -1,12 +1,12 @@
// FIXME: We forcibly strip the names so that the test doesn't vary between
// builds with and without asserts. We need a better solution for this.
-// RUN: clang-cc -fblocks -triple x86_64-apple-darwin10 -emit-llvm-bc -o - %s | opt -strip | llvm-dis > %t &&
-// RUN: grep '%6 = call i32 (...)\* @rhs()' %t | count 1 &&
-// RUN: grep '%7 = getelementptr inbounds %0\* %1, i32 0, i32 1' %t | count 1 &&
-// RUN: grep '%8 = load %0\*\* %7' %t | count 1 &&
-// RUN: grep '%10 = call i32 (...)\* @rhs()' %t | count 1 &&
-// RUN: grep '%11 = getelementptr inbounds %0\* %1, i32 0, i32 1' %t | count 1 &&
+// RUN: clang-cc -fblocks -triple x86_64-apple-darwin10 -emit-llvm-bc -o - %s | opt -strip | llvm-dis > %t
+// RUN: grep '%6 = call i32 (...)\* @rhs()' %t | count 1
+// RUN: grep '%7 = getelementptr inbounds %0\* %1, i32 0, i32 1' %t | count 1
+// RUN: grep '%8 = load %0\*\* %7' %t | count 1
+// RUN: grep '%10 = call i32 (...)\* @rhs()' %t | count 1
+// RUN: grep '%11 = getelementptr inbounds %0\* %1, i32 0, i32 1' %t | count 1
// RUN: grep '%12 = load %0\*\* %11' %t | count 1
int rhs();
diff --git a/test/CodeGen/blocks.c b/test/CodeGen/blocks.c
index 39c5b06..eddf25c 100644
--- a/test/CodeGen/blocks.c
+++ b/test/CodeGen/blocks.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-unknown-unknown %s -emit-llvm -o %t -fblocks &&
+// RUN: clang-cc -triple i386-unknown-unknown %s -emit-llvm -o %t -fblocks
void (^f)(void) = ^{};
// rdar://6768379
@@ -12,7 +12,7 @@ struct s0 {
int a[64];
};
-// RUN: grep 'internal void @__f2_block_invoke_(.struct.s0\* noalias sret .*, .*, .* byval .*)' %t &&
+// RUN: grep 'internal void @__f2_block_invoke_(.struct.s0\* noalias sret .*, .*, .* byval .*)' %t
struct s0 f2(struct s0 a0) {
return ^(struct s0 a1){ return a1; }(a0);
}
@@ -27,4 +27,3 @@ void (^test1)(void) = ^(void) {
^ { i = 1; }();
};
-// RUN: true
diff --git a/test/CodeGen/builtin-count-zeros.c b/test/CodeGen/builtin-count-zeros.c
index 374acc4..ff08bd1 100644
--- a/test/CodeGen/builtin-count-zeros.c
+++ b/test/CodeGen/builtin-count-zeros.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -emit-llvm %s -o - | grep 'cttz' | count 2 &&
+// RUN: clang-cc -emit-llvm %s -o - | grep 'cttz' | count 2
// RUN: clang-cc -emit-llvm %s -o - | grep 'ctlz' | count 2
int a(int a) {return __builtin_ctz(a) + __builtin_clz(a);}
diff --git a/test/CodeGen/builtin-memfns.c b/test/CodeGen/builtin-memfns.c
index 9ae380c..f1d0925 100644
--- a/test/CodeGen/builtin-memfns.c
+++ b/test/CodeGen/builtin-memfns.c
@@ -1,7 +1,7 @@
-// RUN: clang-cc -triple i386-pc-linux-gnu -emit-llvm -o %t %s &&
-// RUN: grep '@llvm.memset.i32' %t &&
-// RUN: grep '@llvm.memcpy.i32' %t &&
-// RUN: grep '@llvm.memmove.i32' %t &&
+// RUN: clang-cc -triple i386-pc-linux-gnu -emit-llvm -o %t %s
+// RUN: grep '@llvm.memset.i32' %t
+// RUN: grep '@llvm.memcpy.i32' %t
+// RUN: grep '@llvm.memmove.i32' %t
// RUN: grep __builtin %t | count 0
int main(int argc, char **argv) {
diff --git a/test/CodeGen/builtin-nanf.c b/test/CodeGen/builtin-nanf.c
index e048c7a..8f7d2a1 100644
--- a/test/CodeGen/builtin-nanf.c
+++ b/test/CodeGen/builtin-nanf.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple x86_64-apple-darwin9 -emit-llvm -o %t %s &&
+// RUN: clang-cc -triple x86_64-apple-darwin9 -emit-llvm -o %t %s
// RUN: grep 'float 0x7FF8000000000000, float 0x7FF8000000000000, float 0x7FF8000020000000, float 0x7FF8000000000000, float 0x7FF80001E0000000, float 0x7FF8001E00000000, float 0x7FF801E000000000, float 0x7FF81E0000000000, float 0x7FF9E00000000000, float 0x7FFFFFFFE0000000' %t
float n[] = {
diff --git a/test/CodeGen/builtin-stackaddress.c b/test/CodeGen/builtin-stackaddress.c
index 5c6d540..d8e58c4 100644
--- a/test/CodeGen/builtin-stackaddress.c
+++ b/test/CodeGen/builtin-stackaddress.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -emit-llvm < %s | grep "llvm.returnaddress" &&
+// RUN: clang-cc -emit-llvm < %s | grep "llvm.returnaddress"
// RUN: clang-cc -emit-llvm < %s | grep "llvm.frameaddress"
void* a(unsigned x) {
return __builtin_return_address(0);
diff --git a/test/CodeGen/builtins-ffs_parity_popcount.c b/test/CodeGen/builtins-ffs_parity_popcount.c
index e3fa4d2..74e104b 100644
--- a/test/CodeGen/builtins-ffs_parity_popcount.c
+++ b/test/CodeGen/builtins-ffs_parity_popcount.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -emit-llvm -o - %s > %t &&
+// RUN: clang-cc -emit-llvm -o - %s > %t
// RUN: not grep "__builtin" %t
#include <stdio.h>
diff --git a/test/CodeGen/builtins-powi.c b/test/CodeGen/builtins-powi.c
index 57fa81a..945ec5d 100644
--- a/test/CodeGen/builtins-powi.c
+++ b/test/CodeGen/builtins-powi.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -emit-llvm -o - %s > %t &&
+// RUN: clang-cc -emit-llvm -o - %s > %t
// RUN: not grep "__builtin" %t
#include <stdio.h>
diff --git a/test/CodeGen/builtins-x86.c b/test/CodeGen/builtins-x86.c
index f49e7b6..c82ecde 100644
--- a/test/CodeGen/builtins-x86.c
+++ b/test/CodeGen/builtins-x86.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -DUSE_64 -triple x86_64-unknown-unknown -emit-llvm -o %t %s &&
+// RUN: clang-cc -DUSE_64 -triple x86_64-unknown-unknown -emit-llvm -o %t %s
// RUN: clang-cc -DUSE_ALL -triple x86_64-unknown-unknown -fsyntax-only -o %t %s
#ifdef USE_ALL
diff --git a/test/CodeGen/builtins.c b/test/CodeGen/builtins.c
index 359d507..11bcc14 100644
--- a/test/CodeGen/builtins.c
+++ b/test/CodeGen/builtins.c
@@ -1,7 +1,7 @@
-// RUN: clang-cc -emit-llvm -o %t %s &&
+// RUN: clang-cc -emit-llvm -o %t %s
// RUN: not grep __builtin %t
-#include <stdio.h>
+int printf(const char *, ...);
void p(char *str, int x) {
printf("%s: %d\n", str, x);
diff --git a/test/CodeGen/c-strings.c b/test/CodeGen/c-strings.c
index ee85f60..2cf4036 100644
--- a/test/CodeGen/c-strings.c
+++ b/test/CodeGen/c-strings.c
@@ -1,7 +1,7 @@
-// RUN: clang-cc -emit-llvm -o %t %s &&
-// RUN: grep "hello" %t | count 3 &&
-// RUN: grep 'c"hello\\00"' %t | count 2 &&
-// RUN: grep 'c"hello\\00\\00\\00"' %t | count 1 &&
+// RUN: clang-cc -emit-llvm -o %t %s
+// RUN: grep "hello" %t | count 3
+// RUN: grep 'c"hello\\00"' %t | count 2
+// RUN: grep 'c"hello\\00\\00\\00"' %t | count 1
// RUN: grep 'c"ola"' %t | count 1
/* Should be 3 hello string, two global (of different sizes), the rest
diff --git a/test/CodeGen/cleanup-stack.c b/test/CodeGen/cleanup-stack.c
index b0c5e88..3954d85 100644
--- a/test/CodeGen/cleanup-stack.c
+++ b/test/CodeGen/cleanup-stack.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-unknown-unknown -O3 -emit-llvm %s -o %t &&
+// RUN: clang-cc -triple i386-unknown-unknown -O3 -emit-llvm %s -o %t
// RUN: grep "ret i32 9" %t
struct s0 {
diff --git a/test/CodeGen/compound-type.c b/test/CodeGen/compound-type.c
index 352f6cc..47eb3a6 100644
--- a/test/CodeGen/compound-type.c
+++ b/test/CodeGen/compound-type.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc < %s -emit-llvm -triple i686-pc-linux-gnu > %t &&
-// RUN: grep "div i32" %t &&
+// RUN: clang-cc < %s -emit-llvm -triple i686-pc-linux-gnu > %t
+// RUN: grep "div i32" %t
// RUN: grep "shl i32" %t
unsigned char a,b;
diff --git a/test/CodeGen/conditional.c b/test/CodeGen/conditional.c
index 8a30463..f55d590 100644
--- a/test/CodeGen/conditional.c
+++ b/test/CodeGen/conditional.c
@@ -39,3 +39,11 @@ void _php_stream_free3() {
void _php_stream_free4() {
1 ? _efree(0) : free(0);
}
+
+// PR5526
+struct test9 { int a; };
+void* test9spare();
+void test9(struct test9 *p) {
+ p ? p : test9spare();
+}
+
diff --git a/test/CodeGen/const-init.c b/test/CodeGen/const-init.c
index e25da9c..06cdde9 100644
--- a/test/CodeGen/const-init.c
+++ b/test/CodeGen/const-init.c
@@ -111,3 +111,15 @@ void *g20(void) {
// PR4108
struct g21 {int g21;};
const struct g21 g21 = (struct g21){1};
+
+// PR5474
+struct g22 {int x;} __attribute((packed));
+struct g23 {char a; short b; char c; struct g22 d;};
+struct g23 g24 = {1,2,3,4};
+
+// CHECK: @__func__.g25 = private constant [4 x i8] c"g25\00"
+// CHECK: @g25.g26 = internal global i8* getelementptr inbounds ([4 x i8]* @__func__.g25, i32 0, i32 0)
+int g25() {
+ static const char *g26 = __func__;
+ return *g26;
+}
diff --git a/test/CodeGen/constant-comparison.c b/test/CodeGen/constant-comparison.c
index ea3e896..3089ae4 100644
--- a/test/CodeGen/constant-comparison.c
+++ b/test/CodeGen/constant-comparison.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -emit-llvm %s -o - 2>&1 | not grep warning &&
+// RUN: clang-cc -emit-llvm %s -o - 2>&1 | not grep warning
// RUN: clang-cc -emit-llvm %s -o - | grep @b | count 1
int a, b;
diff --git a/test/CodeGen/constructor-attribute.c b/test/CodeGen/constructor-attribute.c
index 9a1fa76..b715201 100644
--- a/test/CodeGen/constructor-attribute.c
+++ b/test/CodeGen/constructor-attribute.c
@@ -1,10 +1,10 @@
-// RUN: clang-cc -emit-llvm -o %t %s &&
-// RUN: grep -e "global_ctors.*@A" %t &&
-// RUN: grep -e "global_dtors.*@B" %t &&
-// RUN: grep -e "global_ctors.*@C" %t &&
+// RUN: clang-cc -emit-llvm -o %t %s
+// RUN: grep -e "global_ctors.*@A" %t
+// RUN: grep -e "global_dtors.*@B" %t
+// RUN: grep -e "global_ctors.*@C" %t
// RUN: grep -e "global_dtors.*@D" %t
-#include <stdio.h>
+int printf(const char *, ...);
void A() __attribute__((constructor));
void B() __attribute__((destructor));
diff --git a/test/CodeGen/darwin-string-literals.c b/test/CodeGen/darwin-string-literals.c
index 04e43a2..427e9c2 100644
--- a/test/CodeGen/darwin-string-literals.c
+++ b/test/CodeGen/darwin-string-literals.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-apple-darwin9 -emit-llvm %s -o - | FileCheck -check-prefix LSB %s &&
+// RUN: clang-cc -triple i386-apple-darwin9 -emit-llvm %s -o - | FileCheck -check-prefix LSB %s
// CHECK-LSB: @.str = private constant [8 x i8] c"string0\00"
// CHECK-LSB: @.str1 = private constant [8 x i8] c"string1\00"
diff --git a/test/CodeGen/debug-info.c b/test/CodeGen/debug-info.c
index 85ad988..856b919 100644
--- a/test/CodeGen/debug-info.c
+++ b/test/CodeGen/debug-info.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -o %t --emit-llvm -g %s &&
+// RUN: clang-cc -o %t --emit-llvm -g %s
// RUN: FileCheck --input-file=%t %s
// PR3023
diff --git a/test/CodeGen/designated-initializers.c b/test/CodeGen/designated-initializers.c
index f20bc78..cc88cef 100644
--- a/test/CodeGen/designated-initializers.c
+++ b/test/CodeGen/designated-initializers.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -triple i386-unknown-unknown %s -emit-llvm -o %t &&
-// RUN: grep "{ i8\* null, i32 1024 }" %t &&
+// RUN: clang-cc -triple i386-unknown-unknown %s -emit-llvm -o %t
+// RUN: grep "{ i8\* null, i32 1024 }" %t
// RUN: grep "i32 0, i32 22" %t
struct foo {
diff --git a/test/CodeGen/dllimport-dllexport.c b/test/CodeGen/dllimport-dllexport.c
index fe49ae7..6e25905 100644
--- a/test/CodeGen/dllimport-dllexport.c
+++ b/test/CodeGen/dllimport-dllexport.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -emit-llvm < %s -o %t &&
-// RUN: grep 'dllexport' %t | count 1 &&
+// RUN: clang-cc -emit-llvm < %s -o %t
+// RUN: grep 'dllexport' %t | count 1
// RUN: not grep 'dllimport' %t
void __attribute__((dllimport)) foo1();
diff --git a/test/CodeGen/emit-all-decls.c b/test/CodeGen/emit-all-decls.c
index 775cb6f..3e7927d 100644
--- a/test/CodeGen/emit-all-decls.c
+++ b/test/CodeGen/emit-all-decls.c
@@ -1,6 +1,6 @@
-// RUN: clang-cc -emit-llvm -o %t %s &&
-// RUN: not grep "@foo" %t &&
-// RUN: clang-cc -femit-all-decls -emit-llvm -o %t %s &&
+// RUN: clang-cc -emit-llvm -o %t %s
+// RUN: not grep "@foo" %t
+// RUN: clang-cc -femit-all-decls -emit-llvm -o %t %s
// RUN: grep "@foo" %t
static void foo() {
diff --git a/test/CodeGen/ext-vector-shuffle.c b/test/CodeGen/ext-vector-shuffle.c
index 7655515..88f8c24 100644
--- a/test/CodeGen/ext-vector-shuffle.c
+++ b/test/CodeGen/ext-vector-shuffle.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc %s -x cl -emit-llvm -o - | not grep 'extractelement' &&
-// RUN: clang-cc %s -x cl -emit-llvm -o - | not grep 'insertelement' &&
+// RUN: clang-cc %s -x cl -emit-llvm -o - | not grep 'extractelement'
+// RUN: clang-cc %s -x cl -emit-llvm -o - | not grep 'insertelement'
// RUN: clang-cc %s -x cl -emit-llvm -o - | grep 'shufflevector'
typedef __attribute__(( ext_vector_type(2) )) float float2;
diff --git a/test/CodeGen/flexible-array-init.c b/test/CodeGen/flexible-array-init.c
index fb98a8e..2f0df90 100644
--- a/test/CodeGen/flexible-array-init.c
+++ b/test/CodeGen/flexible-array-init.c
@@ -1,6 +1,6 @@
-// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm -o - %s | grep 7 | count 1 &&
-// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm -o - %s | grep 11 | count 1 &&
-// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm -o - %s | grep 13 | count 1 &&
+// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm -o - %s | grep 7 | count 1
+// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm -o - %s | grep 11 | count 1
+// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm -o - %s | grep 13 | count 1
// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm -o - %s | grep 15 | count 1
struct { int x; int y[]; } a = { 1, 7, 11 };
diff --git a/test/CodeGen/functions.c b/test/CodeGen/functions.c
index dba2931..1c53db4 100644
--- a/test/CodeGen/functions.c
+++ b/test/CodeGen/functions.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc %s -emit-llvm -o %t &&
+// RUN: clang-cc %s -emit-llvm -o %t
int g();
@@ -19,15 +19,15 @@ void test3(T f) {
int a(int);
int a() {return 1;}
-// RUN: grep 'define void @f0()' %t &&
+// RUN: grep 'define void @f0()' %t
void f0() {}
void f1();
-// RUN: grep 'call void @f1()' %t &&
+// RUN: grep 'call void @f1()' %t
void f2(void) {
f1(1, 2, 3);
}
-// RUN: grep 'define void @f1()' %t &&
+// RUN: grep 'define void @f1()' %t
void f1() {}
// RUN: grep 'define .* @f3' %t | not grep -F '...'
diff --git a/test/CodeGen/global-decls.c b/test/CodeGen/global-decls.c
index decb6a9..c7a70fa 100644
--- a/test/CodeGen/global-decls.c
+++ b/test/CodeGen/global-decls.c
@@ -1,16 +1,16 @@
-// RUN: clang-cc -triple i386-pc-linux-gnu -emit-llvm -o %t %s &&
+// RUN: clang-cc -triple i386-pc-linux-gnu -emit-llvm -o %t %s
-// RUN: grep '@g0_ext = extern_weak global i32' %t &&
+// RUN: grep '@g0_ext = extern_weak global i32' %t
extern int g0_ext __attribute__((weak));
-// RUN: grep 'declare extern_weak i32 @g1_ext()' %t &&
+// RUN: grep 'declare extern_weak i32 @g1_ext()' %t
extern int __attribute__((weak)) g1_ext (void);
-// RUN: grep '@g0_common = weak global i32' %t &&
+// RUN: grep '@g0_common = weak global i32' %t
int g0_common __attribute__((weak));
-// RUN: grep '@g0_def = weak global i32' %t &&
+// RUN: grep '@g0_def = weak global i32' %t
int g0_def __attribute__((weak)) = 52;
-// RUN: grep 'define weak i32 @g1_def()' %t &&
+// RUN: grep 'define weak i32 @g1_def()' %t
int __attribute__((weak)) g1_def (void) { return 0; }
// Force _ext references
@@ -19,4 +19,3 @@ void f0() {
int b = g1_ext();
}
-// RUN: true
diff --git a/test/CodeGen/init.c b/test/CodeGen/init.c
index 2e239cf..b0537ae 100644
--- a/test/CodeGen/init.c
+++ b/test/CodeGen/init.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm %s -o %t &&
+// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm %s -o %t
void f1() {
// Scalars in braces.
@@ -22,7 +22,7 @@ void f3() {
}
// Constants
-// RUN: grep '@g3 = constant i32 10' %t &&
+// RUN: grep '@g3 = constant i32 10' %t
// RUN: grep '@f4.g4 = internal constant i32 12' %t
const int g3 = 10;
int f4() {
diff --git a/test/CodeGen/inline.c b/test/CodeGen/inline.c
index bf17fd7..76d90ed 100644
--- a/test/CodeGen/inline.c
+++ b/test/CodeGen/inline.c
@@ -1,40 +1,40 @@
-// RUN: echo "GNU89 tests:" &&
-// RUN: clang %s -emit-llvm -S -o %t -std=gnu89 &&
-// RUN: grep "define available_externally i32 @ei()" %t &&
-// RUN: grep "define i32 @foo()" %t &&
-// RUN: grep "define i32 @bar()" %t &&
-// RUN: grep "define void @unreferenced1()" %t &&
-// RUN: not grep unreferenced2 %t &&
-// RUN: grep "define void @gnu_inline()" %t &&
-// RUN: grep "define available_externally void @gnu_ei_inline()" %t &&
-// RUN: grep "define i32 @test1" %t &&
-// RUN: grep "define i32 @test2" %t &&
-// RUN: grep "define void @test3()" %t &&
-// RUN: grep "define available_externally i32 @test4" %t &&
-// RUN: grep "define available_externally i32 @test5" %t &&
-
-// RUN: echo "\nC99 tests:" &&
-// RUN: clang %s -emit-llvm -S -o %t -std=c99 &&
-// RUN: grep "define i32 @ei()" %t &&
-// RUN: grep "define available_externally i32 @foo()" %t &&
-// RUN: grep "define i32 @bar()" %t &&
-// RUN: not grep unreferenced1 %t &&
-// RUN: grep "define void @unreferenced2()" %t &&
-// RUN: grep "define void @gnu_inline()" %t &&
-// RUN: grep "define available_externally void @gnu_ei_inline()" %t &&
-// RUN: grep "define i32 @test1" %t &&
-// RUN: grep "define i32 @test2" %t &&
-// RUN: grep "define void @test3" %t &&
-// RUN: grep "define available_externally i32 @test4" %t &&
-// RUN: grep "define available_externally i32 @test5" %t &&
-
-// RUN: echo "\nC++ tests:" &&
-// RUN: clang %s -emit-llvm -S -o %t -std=c++98 &&
-// RUN: grep "define linkonce_odr i32 @_Z2eiv()" %t &&
-// RUN: grep "define linkonce_odr i32 @_Z3foov()" %t &&
-// RUN: grep "define i32 @_Z3barv()" %t &&
-// RUN: not grep unreferenced %t &&
-// RUN: grep "define void @_Z10gnu_inlinev()" %t &&
+// RUN: echo "GNU89 tests:"
+// RUN: clang %s -emit-llvm -S -o %t -std=gnu89
+// RUN: grep "define available_externally i32 @ei()" %t
+// RUN: grep "define i32 @foo()" %t
+// RUN: grep "define i32 @bar()" %t
+// RUN: grep "define void @unreferenced1()" %t
+// RUN: not grep unreferenced2 %t
+// RUN: grep "define void @gnu_inline()" %t
+// RUN: grep "define available_externally void @gnu_ei_inline()" %t
+// RUN: grep "define i32 @test1" %t
+// RUN: grep "define i32 @test2" %t
+// RUN: grep "define void @test3()" %t
+// RUN: grep "define available_externally i32 @test4" %t
+// RUN: grep "define available_externally i32 @test5" %t
+
+// RUN: echo "\nC99 tests:"
+// RUN: clang %s -emit-llvm -S -o %t -std=c99
+// RUN: grep "define i32 @ei()" %t
+// RUN: grep "define available_externally i32 @foo()" %t
+// RUN: grep "define i32 @bar()" %t
+// RUN: not grep unreferenced1 %t
+// RUN: grep "define void @unreferenced2()" %t
+// RUN: grep "define void @gnu_inline()" %t
+// RUN: grep "define available_externally void @gnu_ei_inline()" %t
+// RUN: grep "define i32 @test1" %t
+// RUN: grep "define i32 @test2" %t
+// RUN: grep "define void @test3" %t
+// RUN: grep "define available_externally i32 @test4" %t
+// RUN: grep "define available_externally i32 @test5" %t
+
+// RUN: echo "\nC++ tests:"
+// RUN: clang %s -emit-llvm -S -o %t -std=c++98
+// RUN: grep "define linkonce_odr i32 @_Z2eiv()" %t
+// RUN: grep "define linkonce_odr i32 @_Z3foov()" %t
+// RUN: grep "define i32 @_Z3barv()" %t
+// RUN: not grep unreferenced %t
+// RUN: grep "define void @_Z10gnu_inlinev()" %t
// RUN: grep "define available_externally void @_Z13gnu_ei_inlinev()" %t
extern __inline int ei() { return 123; }
diff --git a/test/CodeGen/inline2.c b/test/CodeGen/inline2.c
index 6f165f5..304d616 100644
--- a/test/CodeGen/inline2.c
+++ b/test/CodeGen/inline2.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -std=gnu89 -triple i386-apple-darwin9 -emit-llvm %s -o - | FileCheck -check-prefix GNU89 %s &&
+// RUN: clang-cc -std=gnu89 -triple i386-apple-darwin9 -emit-llvm %s -o - | FileCheck -check-prefix GNU89 %s
// RUN: clang-cc -std=c99 -triple i386-apple-darwin9 -emit-llvm %s -o - | FileCheck -check-prefix C99 %s
// CHECK-GNU89: define i32 @f0()
diff --git a/test/CodeGen/libcalls.c b/test/CodeGen/libcalls.c
index ea9e0c3..cbbde8a 100644
--- a/test/CodeGen/libcalls.c
+++ b/test/CodeGen/libcalls.c
@@ -1,8 +1,8 @@
-// RUN: clang-cc -fmath-errno=1 -emit-llvm -o %t %s -triple i386-unknown-unknown &&
-// RUN: grep "declare " %t | count 6 &&
-// RUN: grep "declare " %t | grep "@llvm." | count 1 &&
-// RUN: clang-cc -fmath-errno=0 -emit-llvm -o %t %s -triple i386-unknown-unknown &&
-// RUN: grep "declare " %t | count 6 &&
+// RUN: clang-cc -fmath-errno=1 -emit-llvm -o %t %s -triple i386-unknown-unknown
+// RUN: grep "declare " %t | count 6
+// RUN: grep "declare " %t | grep "@llvm." | count 1
+// RUN: clang-cc -fmath-errno=0 -emit-llvm -o %t %s -triple i386-unknown-unknown
+// RUN: grep "declare " %t | count 6
// RUN: grep "declare " %t | grep -v "@llvm." | count 0
// IRgen only pays attention to const; it should always call llvm for
diff --git a/test/CodeGen/lineno-dbginfo.c b/test/CodeGen/lineno-dbginfo.c
index 12c32ce..b78dd21 100644
--- a/test/CodeGen/lineno-dbginfo.c
+++ b/test/CodeGen/lineno-dbginfo.c
@@ -1,6 +1,6 @@
-// RUN: echo "#include <stdio.h>" > %t.h &&
-// RUN: clang -S -save-temps -g -include %t.h %s -emit-llvm -o %t.ll &&
-// RUN: grep "i32 5" %t.ll &&
+// RUN: echo "#include <stdio.h>" > %t.h
+// RUN: clang -S -save-temps -g -include %t.h %s -emit-llvm -o %t.ll
+// RUN: grep "i32 5" %t.ll
// RUN: rm -f lineno-dbginfo.i
// outer is at line number 5.
int outer = 42;
diff --git a/test/CodeGen/mandel.c b/test/CodeGen/mandel.c
index 27993f0..9d7956c 100644
--- a/test/CodeGen/mandel.c
+++ b/test/CodeGen/mandel.c
@@ -25,7 +25,7 @@ int main() { return 0; }
#define I 1.0iF
-#include <stdio.h>
+int putchar(char c);
volatile double __complex__ accum;
diff --git a/test/CodeGen/no-common.c b/test/CodeGen/no-common.c
index 190873c..64e37d7 100644
--- a/test/CodeGen/no-common.c
+++ b/test/CodeGen/no-common.c
@@ -1,6 +1,6 @@
-// RUN: clang -emit-llvm -S -o %t %s &&
-// RUN: grep '@x = common global' %t &&
-// RUN: clang -fno-common -emit-llvm -S -o %t %s &&
+// RUN: clang -emit-llvm -S -o %t %s
+// RUN: grep '@x = common global' %t
+// RUN: clang -fno-common -emit-llvm -S -o %t %s
// RUN: grep '@x = global' %t
int x;
diff --git a/test/CodeGen/object-size.c b/test/CodeGen/object-size.c
index 61d8541..038d8f9 100644
--- a/test/CodeGen/object-size.c
+++ b/test/CodeGen/object-size.c
@@ -15,39 +15,39 @@ int gi, gj;
void test1() {
// CHECK: movabsq $59, %rdx
- // CHECK-NEXT: movq %rax, %rdi
- // CHECK-NEXT: movq %rcx, %rsi
+ // CHECK-NEXT: movq
+ // CHECK-NEXT: movq
// CHECK-NEXT: call ___strcpy_chk
strcpy(&gbuf[4], "Hi there");
}
void test2() {
// CHECK: movabsq $63, %rdx
- // CHECK-NEXT: movq %rax, %rdi
- // CHECK-NEXT: movq %rcx, %rsi
+ // CHECK-NEXT: movq
+ // CHECK-NEXT: movq
// CHECK-NEXT: call ___strcpy_chk
strcpy(gbuf, "Hi there");
}
void test3() {
// CHECK: movabsq $0, %rdx
- // CHECK-NEXT: movq %rax, %rdi
- // CHECK-NEXT: movq %rcx, %rsi
+ // CHECK-NEXT: movq
+ // CHECK-NEXT: movq
// CHECK-NEXT: call ___strcpy_chk
strcpy(&gbuf[100], "Hi there");
}
void test4() {
// CHECK: movabsq $0, %rdx
- // CHECK-NEXT: movq %rax, %rdi
- // CHECK-NEXT: movq %rcx, %rsi
+ // CHECK-NEXT: movq
+ // CHECK-NEXT: movq
// CHECK-NEXT: call ___strcpy_chk
strcpy((char*)(void*)&gbuf[-1], "Hi there");
}
void test5() {
- // CHECK: movb $0, %al
- // CHECK-NEXT: testb %al, %al
+ // CHECK: movq $-1, %rax
+ // CHECK-NEXT: cmpq $-1, %rax
// CHECK: call ___inline_strcpy_chk
strcpy(gp, "Hi there");
}
@@ -56,8 +56,8 @@ void test6() {
char buf[57];
// CHECK: movabsq $53, %rdx
- // CHECK-NEXT: movq %rax, %rdi
- // CHECK-NEXT: movq %rcx, %rsi
+ // CHECK-NEXT: movq
+ // CHECK-NEXT: movq
// CHECK-NEXT: call ___strcpy_chk
strcpy(&buf[4], "Hi there");
}
diff --git a/test/CodeGen/packed-union.c b/test/CodeGen/packed-union.c
index d11d3a4..41dc94c 100644
--- a/test/CodeGen/packed-union.c
+++ b/test/CodeGen/packed-union.c
@@ -1,6 +1,6 @@
-// RUN: clang-cc -triple x86_64-apple-darwin10 -emit-llvm %s -o %t &&
+// RUN: clang-cc -triple x86_64-apple-darwin10 -emit-llvm %s -o %t
-// RUN: grep "struct._attrs = type <{ i32, i8 }>" %t &&
+// RUN: grep "struct._attrs = type <{ i32, i8 }>" %t
typedef struct _attrs {
unsigned file_attributes;
unsigned char filename_length;
diff --git a/test/CodeGen/parameter-passing.c b/test/CodeGen/parameter-passing.c
index dce0ff8..966223a 100644
--- a/test/CodeGen/parameter-passing.c
+++ b/test/CodeGen/parameter-passing.c
@@ -5,15 +5,14 @@
// We also check _Bool and empty structures, as these can have annoying
// corner cases.
-// RUN: clang-cc %s -triple i386-unknown-unknown -O3 -emit-llvm -o %t &&
-// RUN: not grep '@g0' %t &&
+// RUN: clang-cc %s -triple i386-unknown-unknown -O3 -emit-llvm -o %t
+// RUN: not grep '@g0' %t
-// RUN: clang-cc %s -triple x86_64-unknown-unknown -O3 -emit-llvm -o %t &&
-// RUN: not grep '@g0' %t &&
+// RUN: clang-cc %s -triple x86_64-unknown-unknown -O3 -emit-llvm -o %t
+// RUN: not grep '@g0' %t
-// RUN: clang-cc %s -triple powerpc-unknown-unknown -O3 -emit-llvm -o %t &&
-// RUN: not grep '@g0' %t &&
-// RUN: true
+// RUN: clang-cc %s -triple powerpc-unknown-unknown -O3 -emit-llvm -o %t
+// RUN: not grep '@g0' %t
typedef _Bool BoolTy;
typedef int ScalarTy;
diff --git a/test/CodeGen/pragma-pack-2.c b/test/CodeGen/pragma-pack-2.c
index 306f02d..bfc5dc9 100644
--- a/test/CodeGen/pragma-pack-2.c
+++ b/test/CodeGen/pragma-pack-2.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-apple-darwin9 %s -emit-llvm -o - | FileCheck -check-prefix X32 %s &&
+// RUN: clang-cc -triple i386-apple-darwin9 %s -emit-llvm -o - | FileCheck -check-prefix X32 %s
// CHECK-X32: %struct.s0 = type { i64, i64, i32, [12 x i32] }
// CHECK-X32: %struct.s1 = type { [15 x i32], %struct.s0 }
diff --git a/test/CodeGen/pragma-pack-3.c b/test/CodeGen/pragma-pack-3.c
index b9166ae..56a6be3 100644
--- a/test/CodeGen/pragma-pack-3.c
+++ b/test/CodeGen/pragma-pack-3.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-apple-darwin9 %s -emit-llvm -o - | FileCheck -check-prefix X32 %s &&
+// RUN: clang-cc -triple i386-apple-darwin9 %s -emit-llvm -o - | FileCheck -check-prefix X32 %s
// CHECK-X32: %struct.menu = type <{ i8*, i8, i8 }>
// CHECK-X32: %union.command = type <{ i8*, [2 x i8] }>
diff --git a/test/CodeGen/predefined-expr.c b/test/CodeGen/predefined-expr.c
index 9b64593..1a5dcb4 100644
--- a/test/CodeGen/predefined-expr.c
+++ b/test/CodeGen/predefined-expr.c
@@ -9,7 +9,7 @@
// CHECK: @__func__.staticFunction = private constant [15 x i8] c"staticFunction\00"
// CHECK: @__PRETTY_FUNCTION__.staticFunction = private constant [22 x i8] c"void staticFunction()\00"
-#include <stdio.h>
+int printf(const char *, ...);
void plainFunction() {
printf("__func__ %s\n", __func__);
diff --git a/test/CodeGen/private-extern.c b/test/CodeGen/private-extern.c
index f3ffe54..a9bb28b 100644
--- a/test/CodeGen/private-extern.c
+++ b/test/CodeGen/private-extern.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -emit-llvm -o %t %s &&
-// RUN: grep '@g0 = external hidden constant i32' %t &&
+// RUN: clang-cc -emit-llvm -o %t %s
+// RUN: grep '@g0 = external hidden constant i32' %t
// RUN: grep '@g1 = hidden constant i32 1' %t
__private_extern__ const int g0;
diff --git a/test/CodeGen/rdr-6098585-default-after-caserange.c b/test/CodeGen/rdr-6098585-default-after-caserange.c
index 3a11ad6..239383a 100644
--- a/test/CodeGen/rdr-6098585-default-after-caserange.c
+++ b/test/CodeGen/rdr-6098585-default-after-caserange.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -triple i386-unknown-unknown --emit-llvm-bc -o - %s | opt -std-compile-opts | llvm-dis > %t &&
-// RUN: grep "ret i32" %t | count 1 &&
+// RUN: clang-cc -triple i386-unknown-unknown --emit-llvm-bc -o - %s | opt -std-compile-opts | llvm-dis > %t
+// RUN: grep "ret i32" %t | count 1
// RUN: grep "ret i32 10" %t | count 1
// Ensure that default after a case range is not ignored.
diff --git a/test/CodeGen/rdr-6098585-default-fallthrough-to-caserange.c b/test/CodeGen/rdr-6098585-default-fallthrough-to-caserange.c
index f1d15dc..39a6bc6 100644
--- a/test/CodeGen/rdr-6098585-default-fallthrough-to-caserange.c
+++ b/test/CodeGen/rdr-6098585-default-fallthrough-to-caserange.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-unknown-unknown --emit-llvm-bc -o - %s | opt -std-compile-opts | llvm-dis > %t &&
+// RUN: clang-cc -triple i386-unknown-unknown --emit-llvm-bc -o - %s | opt -std-compile-opts | llvm-dis > %t
// RUN: grep "ret i32 10" %t
// Ensure that this doesn't compile to infinite loop in g() due to
diff --git a/test/CodeGen/rdr-6098585-empty-case-range.c b/test/CodeGen/rdr-6098585-empty-case-range.c
index ca5ff1b..f80b599 100644
--- a/test/CodeGen/rdr-6098585-empty-case-range.c
+++ b/test/CodeGen/rdr-6098585-empty-case-range.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -triple i386-unknown-unknown --emit-llvm-bc -o - %s | opt -std-compile-opts | llvm-dis > %t &&
-// RUN: grep "ret i32" %t | count 2 &&
+// RUN: clang-cc -triple i386-unknown-unknown --emit-llvm-bc -o - %s | opt -std-compile-opts | llvm-dis > %t
+// RUN: grep "ret i32" %t | count 2
// RUN: grep "ret i32 3" %t | count 2
// This generated incorrect code because of poor switch chaining.
diff --git a/test/CodeGen/rdr-6098585-fallthrough-to-empty-range.c b/test/CodeGen/rdr-6098585-fallthrough-to-empty-range.c
index b347449..6c51a37 100644
--- a/test/CodeGen/rdr-6098585-fallthrough-to-empty-range.c
+++ b/test/CodeGen/rdr-6098585-fallthrough-to-empty-range.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-unknown-unknown --emit-llvm-bc -o - %s | opt -std-compile-opts | llvm-dis > %t &&
+// RUN: clang-cc -triple i386-unknown-unknown --emit-llvm-bc -o - %s | opt -std-compile-opts | llvm-dis > %t
// RUN: grep "ret i32 %" %t
// Make sure return is not constant (if empty range is skipped or miscompiled)
diff --git a/test/CodeGen/rdr-6098585-unsigned-caserange.c b/test/CodeGen/rdr-6098585-unsigned-caserange.c
index 8003598..3b4384b 100644
--- a/test/CodeGen/rdr-6098585-unsigned-caserange.c
+++ b/test/CodeGen/rdr-6098585-unsigned-caserange.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -triple i386-unknown-unknown --emit-llvm-bc -o - %s | opt -std-compile-opts | llvm-dis > %t &&
-// RUN: grep "ret i32" %t | count 1 &&
+// RUN: clang-cc -triple i386-unknown-unknown --emit-llvm-bc -o - %s | opt -std-compile-opts | llvm-dis > %t
+// RUN: grep "ret i32" %t | count 1
// RUN: grep "ret i32 3" %t | count 1
int f2(unsigned x) {
diff --git a/test/CodeGen/stack-protector.c b/test/CodeGen/stack-protector.c
index 0b5924d..c29d1f7 100644
--- a/test/CodeGen/stack-protector.c
+++ b/test/CodeGen/stack-protector.c
@@ -1,16 +1,9 @@
-// RUN: clang-cc -triple i686-unknown-unknown -emit-llvm -o %t %s &&
-// RUN: not grep 'ssp' %t &&
-// RUN: clang-cc -triple i686-apple-darwin9 -emit-llvm -o %t %s &&
-// RUN: not grep 'ssp' %t &&
-// RUN: clang-cc -triple i686-apple-darwin10 -emit-llvm -o %t %s &&
-// RUN: grep 'ssp' %t &&
-// RUN: clang -fstack-protector-all -emit-llvm -S -o %t %s &&
-// RUN: grep 'sspreq' %t &&
-// RUN: clang -fstack-protector -emit-llvm -S -o %t %s &&
-// RUN: grep 'ssp' %t &&
-// RUN: clang -fno-stack-protector -emit-llvm -S -o %t %s &&
-// RUN: not grep 'ssp' %t &&
-// RUN: true
+// RUN: clang-cc -emit-llvm -o - %s -stack-protector=0 | FileCheck -check-prefix=NOSSP %s
+// NOSSP: define void @test1(i8* %msg) nounwind {
+// RUN: clang-cc -emit-llvm -o - %s -stack-protector=1 | FileCheck -check-prefix=WITHSSP %s
+// WITHSSP: define void @test1(i8* %msg) nounwind ssp {
+// RUN: clang-cc -emit-llvm -o - %s -stack-protector=2 | FileCheck -check-prefix=SSPREQ %s
+// SSPREQ: define void @test1(i8* %msg) nounwind sspreq {
int printf(const char * _Format, ...);
diff --git a/test/CodeGen/staticinit.c b/test/CodeGen/staticinit.c
index c68366f..8b87ccd6 100644
--- a/test/CodeGen/staticinit.c
+++ b/test/CodeGen/staticinit.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -triple i386-pc-linux-gnu -emit-llvm -o %t %s &&
-// RUN: grep "g.b = internal global i8. getelementptr" %t &&
+// RUN: clang-cc -triple i386-pc-linux-gnu -emit-llvm -o %t %s
+// RUN: grep "g.b = internal global i8. getelementptr" %t
struct AStruct {
int i;
diff --git a/test/CodeGen/stdcall-fastcall.c b/test/CodeGen/stdcall-fastcall.c
index 89ed8c9..11b6521 100644
--- a/test/CodeGen/stdcall-fastcall.c
+++ b/test/CodeGen/stdcall-fastcall.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -emit-llvm < %s | grep 'fastcallcc' | count 4 &&
+// RUN: clang-cc -emit-llvm < %s | grep 'fastcallcc' | count 4
// RUN: clang-cc -emit-llvm < %s | grep 'stdcallcc' | count 4
void __attribute__((fastcall)) f1(void);
diff --git a/test/CodeGen/string-init.c b/test/CodeGen/string-init.c
index 4a80851..0cb6aff 100644
--- a/test/CodeGen/string-init.c
+++ b/test/CodeGen/string-init.c
@@ -1,6 +1,6 @@
-// RUN: clang-cc -emit-llvm %s -o %t &&
-// RUN: grep 'private constant \[10 x i8\]' %t &&
-// RUN: not grep -F "[5 x i8]" %t &&
+// RUN: clang-cc -emit-llvm %s -o %t
+// RUN: grep 'private constant \[10 x i8\]' %t
+// RUN: not grep -F "[5 x i8]" %t
// RUN: not grep "store " %t
void test(void) {
diff --git a/test/CodeGen/struct-passing.c b/test/CodeGen/struct-passing.c
index 9a4f476..772077a 100644
--- a/test/CodeGen/struct-passing.c
+++ b/test/CodeGen/struct-passing.c
@@ -1,11 +1,10 @@
-// RUN: clang-cc -triple i386-pc-linux-gnu -emit-llvm -o %t %s &&
-// RUN: grep 'declare i32 @f0() readnone$' %t &&
-// RUN: grep 'declare i32 @f1() readonly$' %t &&
-// RUN: grep 'declare void @f2(.* noalias sret)$' %t &&
-// RUN: grep 'declare void @f3(.* noalias sret)$' %t &&
-// RUN: grep 'declare void @f4(.* byval)$' %t &&
-// RUN: grep 'declare void @f5(.* byval)$' %t &&
-// RUN: true
+// RUN: clang-cc -triple i386-pc-linux-gnu -emit-llvm -o %t %s
+// RUN: grep 'declare i32 @f0() readnone$' %t
+// RUN: grep 'declare i32 @f1() readonly$' %t
+// RUN: grep 'declare void @f2(.* noalias sret)$' %t
+// RUN: grep 'declare void @f3(.* noalias sret)$' %t
+// RUN: grep 'declare void @f4(.* byval)$' %t
+// RUN: grep 'declare void @f5(.* byval)$' %t
// PR3835
typedef int T0;
diff --git a/test/CodeGen/struct-x86-darwin.c b/test/CodeGen/struct-x86-darwin.c
index c61005f..e7822f0 100644
--- a/test/CodeGen/struct-x86-darwin.c
+++ b/test/CodeGen/struct-x86-darwin.c
@@ -1,12 +1,12 @@
-// RUN: clang-cc < %s -emit-llvm > %t1 -triple=i686-apple-darwin9 &&
-// RUN: grep "STest1 = type { i32, \[4 x i16\], double }" %t1 &&
-// RUN: grep "STest2 = type { i16, i16, i32, i32 }" %t1 &&
-// RUN: grep "STest3 = type { i8, i16, i32 }" %t1 &&
-// RUN: grep "STestB1 = type { i8, i8 }" %t1 &&
-// RUN: grep "STestB2 = type { i8, i8, i8 }" %t1 &&
-// RUN: grep "STestB3 = type { i8, i8 }" %t1 &&
-// RUN: grep "STestB4 = type { i8, i8, i8, i8 }" %t1 &&
-// RUN: grep "STestB5 = type { i8, i8, \[2 x i8\], i8, i8 }" %t1 &&
+// RUN: clang-cc < %s -emit-llvm > %t1 -triple=i686-apple-darwin9
+// RUN: grep "STest1 = type { i32, \[4 x i16\], double }" %t1
+// RUN: grep "STest2 = type { i16, i16, i32, i32 }" %t1
+// RUN: grep "STest3 = type { i8, i16, i32 }" %t1
+// RUN: grep "STestB1 = type { i8, i8 }" %t1
+// RUN: grep "STestB2 = type { i8, i8, i8 }" %t1
+// RUN: grep "STestB3 = type { i8, i8 }" %t1
+// RUN: grep "STestB4 = type { i8, i8, i8, i8 }" %t1
+// RUN: grep "STestB5 = type { i8, i8, \[2 x i8\], i8, i8 }" %t1
// RUN: grep "STestB6 = type { i8, i8, \[2 x i8\] }" %t1
// Test struct layout for x86-darwin target
diff --git a/test/CodeGen/target-data.c b/test/CodeGen/target-data.c
index 9d73d5c..26775f9 100644
--- a/test/CodeGen/target-data.c
+++ b/test/CodeGen/target-data.c
@@ -1,7 +1,6 @@
-// RUN: clang-cc -triple i686-unknown-unknown -emit-llvm -o %t %s &&
-// RUN: grep 'target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"' %t &&
-// RUN: clang-cc -triple i686-apple-darwin9 -emit-llvm -o %t %s &&
-// RUN: grep 'target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"' %t &&
-// RUN: clang-cc -triple x86_64-unknown-unknown -emit-llvm -o %t %s &&
-// RUN: grep 'target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"' %t &&
-// RUN: true
+// RUN: clang-cc -triple i686-unknown-unknown -emit-llvm -o %t %s
+// RUN: grep 'target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32"' %t
+// RUN: clang-cc -triple i686-apple-darwin9 -emit-llvm -o %t %s
+// RUN: grep 'target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32"' %t
+// RUN: clang-cc -triple x86_64-unknown-unknown -emit-llvm -o %t %s
+// RUN: grep 'target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"' %t
diff --git a/test/CodeGen/tentative-decls.c b/test/CodeGen/tentative-decls.c
index 3301c23..b72c585 100644
--- a/test/CodeGen/tentative-decls.c
+++ b/test/CodeGen/tentative-decls.c
@@ -1,16 +1,16 @@
-// RUN: clang-cc -emit-llvm -o %t %s &&
+// RUN: clang-cc -emit-llvm -o %t %s
-// RUN: grep '@r = common global \[1 x .*\] zeroinitializer' %t &&
+// RUN: grep '@r = common global \[1 x .*\] zeroinitializer' %t
int r[];
int (*a)[] = &r;
struct s0;
struct s0 x;
-// RUN: grep '@x = common global .struct.s0 zeroinitializer' %t &&
+// RUN: grep '@x = common global .struct.s0 zeroinitializer' %t
struct s0 y;
-// RUN: grep '@y = common global .struct.s0 zeroinitializer' %t &&
+// RUN: grep '@y = common global .struct.s0 zeroinitializer' %t
struct s0 *f0() {
return &y;
}
@@ -19,21 +19,20 @@ struct s0 {
int x;
};
-// RUN: grep '@b = common global \[1 x .*\] zeroinitializer' %t &&
+// RUN: grep '@b = common global \[1 x .*\] zeroinitializer' %t
int b[];
int *f1() {
return b;
}
// Check that the most recent tentative definition wins.
-// RUN: grep '@c = common global \[4 x .*\] zeroinitializer' %t &&
+// RUN: grep '@c = common global \[4 x .*\] zeroinitializer' %t
int c[];
int c[4];
// Check that we emit static tentative definitions
-// RUN: grep '@c5 = internal global \[1 x .*\] zeroinitializer' %t &&
+// RUN: grep '@c5 = internal global \[1 x .*\] zeroinitializer' %t
static int c5[];
static int func() { return c5[0]; }
int callfunc() { return func(); }
-// RUN: true
diff --git a/test/CodeGen/trapv.c b/test/CodeGen/trapv.c
index c96488b..6045ed9 100644
--- a/test/CodeGen/trapv.c
+++ b/test/CodeGen/trapv.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -ftrapv %s -emit-llvm -o %t &&
+// RUN: clang-cc -ftrapv %s -emit-llvm -o %t
// RUN: grep "__overflow_handler" %t | count 2
unsigned int ui, uj, uk;
diff --git a/test/CodeGen/unreachable.c b/test/CodeGen/unreachable.c
index ea4f047..3f39a27 100644
--- a/test/CodeGen/unreachable.c
+++ b/test/CodeGen/unreachable.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -emit-llvm -o %t %s &&
+// RUN: clang-cc -emit-llvm -o %t %s
// RUN: grep '@unreachable' %t | count 0
extern void abort() __attribute__((noreturn));
diff --git a/test/CodeGen/unwind-attr.c b/test/CodeGen/unwind-attr.c
index 86036f9..1148ba1 100644
--- a/test/CodeGen/unwind-attr.c
+++ b/test/CodeGen/unwind-attr.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fexceptions -emit-llvm -o - %s | grep "@foo()" | not grep nounwind &&
+// RUN: clang-cc -fexceptions -emit-llvm -o - %s | grep "@foo()" | not grep nounwind
// RUN: clang-cc -emit-llvm -o - %s | grep "@foo()" | grep nounwind
int foo(void) {
diff --git a/test/CodeGen/visibility.c b/test/CodeGen/visibility.c
index 958eb61..7c837ba 100644
--- a/test/CodeGen/visibility.c
+++ b/test/CodeGen/visibility.c
@@ -1,28 +1,27 @@
-// RUN: clang-cc -triple i386-unknown-unknown -fvisibility=default -emit-llvm -o %t %s &&
-// RUN: grep '@g_com = common global i32 0' %t &&
-// RUN: grep '@g_def = global i32 0' %t &&
-// RUN: grep '@g_ext = external global i32' %t &&
-// RUN: grep '@g_deferred = internal global' %t &&
-// RUN: grep 'declare void @f_ext()' %t &&
-// RUN: grep 'define internal void @f_deferred()' %t &&
-// RUN: grep 'define i32 @f_def()' %t &&
-// RUN: clang-cc -triple i386-unknown-unknown -fvisibility=protected -emit-llvm -o %t %s &&
-// RUN: grep '@g_com = common protected global i32 0' %t &&
-// RUN: grep '@g_def = protected global i32 0' %t &&
-// RUN: grep '@g_ext = external global i32' %t &&
-// RUN: grep '@g_deferred = internal global' %t &&
-// RUN: grep 'declare void @f_ext()' %t &&
-// RUN: grep 'define internal void @f_deferred()' %t &&
-// RUN: grep 'define protected i32 @f_def()' %t &&
-// RUN: clang-cc -triple i386-unknown-unknown -fvisibility=hidden -emit-llvm -o %t %s &&
-// RUN: grep '@g_com = common hidden global i32 0' %t &&
-// RUN: grep '@g_def = hidden global i32 0' %t &&
-// RUN: grep '@g_ext = external global i32' %t &&
-// RUN: grep '@g_deferred = internal global' %t &&
-// RUN: grep 'declare void @f_ext()' %t &&
-// RUN: grep 'define internal void @f_deferred()' %t &&
-// RUN: grep 'define hidden i32 @f_def()' %t &&
-// RUN: true
+// RUN: clang-cc -triple i386-unknown-unknown -fvisibility=default -emit-llvm -o %t %s
+// RUN: grep '@g_com = common global i32 0' %t
+// RUN: grep '@g_def = global i32 0' %t
+// RUN: grep '@g_ext = external global i32' %t
+// RUN: grep '@g_deferred = internal global' %t
+// RUN: grep 'declare void @f_ext()' %t
+// RUN: grep 'define internal void @f_deferred()' %t
+// RUN: grep 'define i32 @f_def()' %t
+// RUN: clang-cc -triple i386-unknown-unknown -fvisibility=protected -emit-llvm -o %t %s
+// RUN: grep '@g_com = common protected global i32 0' %t
+// RUN: grep '@g_def = protected global i32 0' %t
+// RUN: grep '@g_ext = external global i32' %t
+// RUN: grep '@g_deferred = internal global' %t
+// RUN: grep 'declare void @f_ext()' %t
+// RUN: grep 'define internal void @f_deferred()' %t
+// RUN: grep 'define protected i32 @f_def()' %t
+// RUN: clang-cc -triple i386-unknown-unknown -fvisibility=hidden -emit-llvm -o %t %s
+// RUN: grep '@g_com = common hidden global i32 0' %t
+// RUN: grep '@g_def = hidden global i32 0' %t
+// RUN: grep '@g_ext = external global i32' %t
+// RUN: grep '@g_deferred = internal global' %t
+// RUN: grep 'declare void @f_ext()' %t
+// RUN: grep 'define internal void @f_deferred()' %t
+// RUN: grep 'define hidden i32 @f_def()' %t
int g_com;
int g_def = 0;
diff --git a/test/CodeGen/volatile-1.c b/test/CodeGen/volatile-1.c
index ac3b4c2..3203326 100644
--- a/test/CodeGen/volatile-1.c
+++ b/test/CodeGen/volatile-1.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -Wno-unused-value -emit-llvm < %s -o %t &&
-// RUN: grep volatile %t | count 145 &&
+// RUN: clang-cc -Wno-unused-value -emit-llvm < %s -o %t
+// RUN: grep volatile %t | count 145
// RUN: grep memcpy %t | count 4
volatile int i, j, k;
@@ -14,7 +14,7 @@ volatile struct S {
} a, b;
//void operator =(volatile struct S&o1, volatile struct S&o2) volatile;
-#include <stdio.h>
+int printf(const char *, ...);
int main() {
// A use.
diff --git a/test/CodeGen/volatile.c b/test/CodeGen/volatile.c
index e176690..a0cc891 100644
--- a/test/CodeGen/volatile.c
+++ b/test/CodeGen/volatile.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -emit-llvm < %s -o %t &&
-// RUN: grep volatile %t | count 29 &&
+// RUN: clang-cc -emit-llvm < %s -o %t
+// RUN: grep volatile %t | count 29
// RUN: grep memcpy %t | count 7
// The number 29 comes from the current codegen for volatile loads;
diff --git a/test/CodeGen/x86.c b/test/CodeGen/x86.c
index be09302..0420a4c 100644
--- a/test/CodeGen/x86.c
+++ b/test/CodeGen/x86.c
@@ -1,11 +1,11 @@
-// RUN: clang-cc %s -triple=i686-pc-linux-gnu -emit-llvm -o - > %t1 &&
-// RUN: grep "ax" %t1 &&
-// RUN: grep "bx" %t1 &&
-// RUN: grep "cx" %t1 &&
-// RUN: grep "dx" %t1 &&
-// RUN: grep "di" %t1 &&
-// RUN: grep "si" %t1 &&
-// RUN: grep "st" %t1 &&
+// RUN: clang-cc %s -triple=i686-pc-linux-gnu -emit-llvm -o - > %t1
+// RUN: grep "ax" %t1
+// RUN: grep "bx" %t1
+// RUN: grep "cx" %t1
+// RUN: grep "dx" %t1
+// RUN: grep "di" %t1
+// RUN: grep "si" %t1
+// RUN: grep "st" %t1
// RUN: grep "st(1)" %t1
void test1() {
diff --git a/test/CodeGen/x86_32-arguments.c b/test/CodeGen/x86_32-arguments.c
index 78fb834..33f635c 100644
--- a/test/CodeGen/x86_32-arguments.c
+++ b/test/CodeGen/x86_32-arguments.c
@@ -1,14 +1,14 @@
-// RUN: clang-cc -fblocks -triple i386-apple-darwin9 -emit-llvm -o %t %s &&
-// RUN: grep 'define signext i8 @f0()' %t &&
-// RUN: grep 'define signext i16 @f1()' %t &&
-// RUN: grep 'define i32 @f2()' %t &&
-// RUN: grep 'define float @f3()' %t &&
-// RUN: grep 'define double @f4()' %t &&
-// RUN: grep 'define x86_fp80 @f5()' %t &&
-// RUN: grep 'define void @f6(i8 signext %a0, i16 signext %a1, i32 %a2, i64 %a3, i8\* %a4)' %t &&
-// RUN: grep 'define void @f7(i32 %a0)' %t &&
-// RUN: grep 'define i64 @f8_1()' %t &&
-// RUN: grep 'define void @f8_2(i32 %a0.0, i32 %a0.1)' %t &&
+// RUN: clang-cc -fblocks -triple i386-apple-darwin9 -emit-llvm -o %t %s
+// RUN: grep 'define signext i8 @f0()' %t
+// RUN: grep 'define signext i16 @f1()' %t
+// RUN: grep 'define i32 @f2()' %t
+// RUN: grep 'define float @f3()' %t
+// RUN: grep 'define double @f4()' %t
+// RUN: grep 'define x86_fp80 @f5()' %t
+// RUN: grep 'define void @f6(i8 signext %a0, i16 signext %a1, i32 %a2, i64 %a3, i8\* %a4)' %t
+// RUN: grep 'define void @f7(i32 %a0)' %t
+// RUN: grep 'define i64 @f8_1()' %t
+// RUN: grep 'define void @f8_2(i32 %a0.0, i32 %a0.1)' %t
char f0(void) {
return 0;
@@ -49,11 +49,11 @@ void f8_2(struct s8 a0) {}
// This should be passed just as s8.
-// RUN: grep 'define i64 @f9_1()' %t &&
+// RUN: grep 'define i64 @f9_1()' %t
// FIXME: llvm-gcc expands this, this may have some value for the
// backend in terms of optimization but doesn't change the ABI.
-// RUN: grep 'define void @f9_2(%.truct.s9\* byval %a0)' %t &&
+// RUN: grep 'define void @f9_2(%.truct.s9\* byval %a0)' %t
struct s9 {
int a : 17;
int b;
@@ -63,7 +63,7 @@ void f9_2(struct s9 a0) {}
// Return of small structures and unions
-// RUN: grep 'float @f10()' %t &&
+// RUN: grep 'float @f10()' %t
struct s10 {
union { };
float f;
@@ -71,12 +71,12 @@ struct s10 {
// Small vectors and 1 x {i64,double} are returned in registers
-// RUN: grep 'i32 @f11()' %t &&
-// RUN: grep -F 'void @f12(<2 x i32>* noalias sret %agg.result)' %t &&
-// RUN: grep 'i64 @f13()' %t &&
-// RUN: grep 'i64 @f14()' %t &&
-// RUN: grep '<2 x i64> @f15()' %t &&
-// RUN: grep '<2 x i64> @f16()' %t &&
+// RUN: grep 'i32 @f11()' %t
+// RUN: grep -F 'void @f12(<2 x i32>* noalias sret %agg.result)' %t
+// RUN: grep 'i64 @f13()' %t
+// RUN: grep 'i64 @f14()' %t
+// RUN: grep '<2 x i64> @f15()' %t
+// RUN: grep '<2 x i64> @f16()' %t
typedef short T11 __attribute__ ((vector_size (4)));
T11 f11(void) { while (1) {} }
typedef int T12 __attribute__ ((vector_size (8)));
@@ -93,12 +93,12 @@ T16 f16(void) { while (1) {} }
// And when the single element in a struct (but not for 64 and
// 128-bits).
-// RUN: grep 'i32 @f17()' %t &&
-// RUN: grep -F 'void @f18(%2* noalias sret %agg.result)' %t &&
-// RUN: grep -F 'void @f19(%3* noalias sret %agg.result)' %t &&
-// RUN: grep -F 'void @f20(%4* noalias sret %agg.result)' %t &&
-// RUN: grep -F 'void @f21(%5* noalias sret %agg.result)' %t &&
-// RUN: grep -F 'void @f22(%6* noalias sret %agg.result)' %t &&
+// RUN: grep 'i32 @f17()' %t
+// RUN: grep -F 'void @f18(%2* noalias sret %agg.result)' %t
+// RUN: grep -F 'void @f19(%3* noalias sret %agg.result)' %t
+// RUN: grep -F 'void @f20(%4* noalias sret %agg.result)' %t
+// RUN: grep -F 'void @f21(%5* noalias sret %agg.result)' %t
+// RUN: grep -F 'void @f22(%6* noalias sret %agg.result)' %t
struct { T11 a; } f17(void) { while (1) {} }
struct { T12 a; } f18(void) { while (1) {} }
struct { T13 a; } f19(void) { while (1) {} }
@@ -108,98 +108,97 @@ struct { T16 a; } f22(void) { while (1) {} }
// Single element structures are handled specially
-// RUN: grep -F 'float @f23()' %t &&
-// RUN: grep -F 'float @f24()' %t &&
-// RUN: grep -F 'float @f25()' %t &&
+// RUN: grep -F 'float @f23()' %t
+// RUN: grep -F 'float @f24()' %t
+// RUN: grep -F 'float @f25()' %t
struct { float a; } f23(void) { while (1) {} }
struct { float a[1]; } f24(void) { while (1) {} }
struct { struct {} a; struct { float a[1]; } b; } f25(void) { while (1) {} }
// Small structures are handled recursively
-// RUN: grep -F 'i32 @f26()' %t &&
-// RUN: grep 'void @f27(%.truct.s27\* noalias sret %agg.result)' %t &&
+// RUN: grep -F 'i32 @f26()' %t
+// RUN: grep 'void @f27(%.truct.s27\* noalias sret %agg.result)' %t
struct s26 { struct { char a, b; } a; struct { char a, b; } b; } f26(void) { while (1) {} }
struct s27 { struct { char a, b, c; } a; struct { char a; } b; } f27(void) { while (1) {} }
-// RUN: grep 'void @f28(%.truct.s28\* noalias sret %agg.result)' %t &&
+// RUN: grep 'void @f28(%.truct.s28\* noalias sret %agg.result)' %t
struct s28 { int a; int b[]; } f28(void) { while (1) {} }
-// RUN: grep 'define i16 @f29()' %t &&
+// RUN: grep 'define i16 @f29()' %t
struct s29 { struct { } a[1]; char b; char c; } f29(void) { while (1) {} }
-// RUN: grep 'define i16 @f30()' %t &&
+// RUN: grep 'define i16 @f30()' %t
struct s30 { char a; char b : 4; } f30(void) { while (1) {} }
-// RUN: grep 'define float @f31()' %t &&
+// RUN: grep 'define float @f31()' %t
struct s31 { char : 0; float b; char : 0; } f31(void) { while (1) {} }
-// RUN: grep 'define i32 @f32()' %t &&
+// RUN: grep 'define i32 @f32()' %t
struct s32 { char a; unsigned : 0; } f32(void) { while (1) {} }
-// RUN: grep 'define float @f33()' %t &&
+// RUN: grep 'define float @f33()' %t
struct s33 { float a; long long : 0; } f33(void) { while (1) {} }
-// RUN: grep 'define float @f34()' %t &&
+// RUN: grep 'define float @f34()' %t
struct s34 { struct { int : 0; } a; float b; } f34(void) { while (1) {} }
-// RUN: grep 'define i16 @f35()' %t &&
+// RUN: grep 'define i16 @f35()' %t
struct s35 { struct { int : 0; } a; char b; char c; } f35(void) { while (1) {} }
-// RUN: grep 'define i16 @f36()' %t &&
+// RUN: grep 'define i16 @f36()' %t
struct s36 { struct { int : 0; } a[2][10]; char b; char c; } f36(void) { while (1) {} }
-// RUN: grep 'define float @f37()' %t &&
+// RUN: grep 'define float @f37()' %t
struct s37 { float c[1][1]; } f37(void) { while (1) {} }
-// RUN: grep 'define void @f38(.struct.s38. noalias sret .agg.result)' %t &&
+// RUN: grep 'define void @f38(.struct.s38. noalias sret .agg.result)' %t
struct s38 { char a[3]; short b; } f38(void) { while (1) {} }
-// RUN: grep 'define void @f39(.struct.s39. byval align 16 .x)' %t &&
+// RUN: grep 'define void @f39(.struct.s39. byval align 16 .x)' %t
typedef int v39 __attribute((vector_size(16)));
struct s39 { v39 x; };
void f39(struct s39 x) {}
// <rdar://problem/7247671>
-// RUN: grep 'define i32 @f40()' %t &&
+// RUN: grep 'define i32 @f40()' %t
enum e40 { ec0 = 0 };
enum e40 f40(void) { }
-// RUN: grep 'define void ()\* @f41()' %t &&
+// RUN: grep 'define void ()\* @f41()' %t
typedef void (^vvbp)(void);
vvbp f41(void) { }
-// RUN: grep 'define i32 @f42()' %t &&
+// RUN: grep 'define i32 @f42()' %t
struct s42 { enum e40 f0; } f42(void) { }
-// RUN: grep 'define i64 @f43()' %t &&
+// RUN: grep 'define i64 @f43()' %t
struct s43 { enum e40 f0; int f1; } f43(void) { }
-// RUN: grep 'define i32 @f44()' %t &&
+// RUN: grep 'define i32 @f44()' %t
struct s44 { vvbp f0; } f44(void) { }
-// RUN: grep 'define i64 @f45()' %t &&
+// RUN: grep 'define i64 @f45()' %t
struct s45 { vvbp f0; int f1; } f45(void) { }
-// RUN: grep 'define void @f46(i32 %a0)' %t &&
+// RUN: grep 'define void @f46(i32 %a0)' %t
void f46(enum e40 a0) { }
-// RUN: grep 'define void @f47(void ()\* %a1)' %t &&
+// RUN: grep 'define void @f47(void ()\* %a1)' %t
void f47(vvbp a1) { }
-// RUN: grep 'define void @f48(i32 %a0.0)' %t &&
+// RUN: grep 'define void @f48(i32 %a0.0)' %t
struct s48 { enum e40 f0; };
void f48(struct s48 a0) { }
-// RUN: grep 'define void @f49(i32 %a0.0, i32 %a0.1)' %t &&
+// RUN: grep 'define void @f49(i32 %a0.0, i32 %a0.1)' %t
struct s49 { enum e40 f0; int f1; };
void f49(struct s49 a0) { }
-// RUN: grep 'define void @f50(void ()\* %a0.0)' %t &&
+// RUN: grep 'define void @f50(void ()\* %a0.0)' %t
struct s50 { vvbp f0; };
void f50(struct s50 a0) { }
-// RUN: grep 'define void @f51(void ()\* %a0.0, i32 %a0.1)' %t &&
+// RUN: grep 'define void @f51(void ()\* %a0.0, i32 %a0.1)' %t
struct s51 { vvbp f0; int f1; };
void f51(struct s51 a0) { }
-// RUN: true
diff --git a/test/CodeGen/x86_64-arguments.c b/test/CodeGen/x86_64-arguments.c
index 19f9cda..1a848ea 100644
--- a/test/CodeGen/x86_64-arguments.c
+++ b/test/CodeGen/x86_64-arguments.c
@@ -1,15 +1,15 @@
-// RUN: clang-cc -triple x86_64-unknown-unknown -emit-llvm -o %t %s &&
-// RUN: grep 'define signext i8 @f0()' %t &&
-// RUN: grep 'define signext i16 @f1()' %t &&
-// RUN: grep 'define i32 @f2()' %t &&
-// RUN: grep 'define float @f3()' %t &&
-// RUN: grep 'define double @f4()' %t &&
-// RUN: grep 'define x86_fp80 @f5()' %t &&
-// RUN: grep 'define void @f6(i8 signext %a0, i16 signext %a1, i32 %a2, i64 %a3, i8\* %a4)' %t &&
-// RUN: grep 'define void @f7(i32 %a0)' %t &&
-// RUN: grep '.0 = type { i64, double }' %t &&
-// RUN: grep 'define .0 @f8_1()' %t &&
-// RUN: grep 'define void @f8_2(.0)' %t &&
+// RUN: clang-cc -triple x86_64-unknown-unknown -emit-llvm -o %t %s
+// RUN: grep 'define signext i8 @f0()' %t
+// RUN: grep 'define signext i16 @f1()' %t
+// RUN: grep 'define i32 @f2()' %t
+// RUN: grep 'define float @f3()' %t
+// RUN: grep 'define double @f4()' %t
+// RUN: grep 'define x86_fp80 @f5()' %t
+// RUN: grep 'define void @f6(i8 signext %a0, i16 signext %a1, i32 %a2, i64 %a3, i8\* %a4)' %t
+// RUN: grep 'define void @f7(i32 %a0)' %t
+// RUN: grep '.0 = type { i64, double }' %t
+// RUN: grep 'define .0 @f8_1()' %t
+// RUN: grep 'define void @f8_2(.0)' %t
char f0(void) {
return 0;
@@ -51,49 +51,48 @@ union u8 {
union u8 f8_1() { while (1) {} }
void f8_2(union u8 a0) {}
-// RUN: grep 'define i64 @f9()' %t &&
+// RUN: grep 'define i64 @f9()' %t
struct s9 { int a; int b; int : 0; } f9(void) { while (1) {} }
-// RUN: grep 'define void @f10(i64)' %t &&
+// RUN: grep 'define void @f10(i64)' %t
struct s10 { int a; int b; int : 0; };
void f10(struct s10 a0) {}
-// RUN: grep 'define void @f11(.union.anon. noalias sret .agg.result)' %t &&
+// RUN: grep 'define void @f11(.union.anon. noalias sret .agg.result)' %t
union { long double a; float b; } f11() { while (1) {} }
-// RUN: grep 'define i64 @f12_0()' %t &&
-// RUN: grep 'define void @f12_1(i64)' %t &&
+// RUN: grep 'define i64 @f12_0()' %t
+// RUN: grep 'define void @f12_1(i64)' %t
struct s12 { int a __attribute__((aligned(16))); };
struct s12 f12_0(void) { while (1) {} }
void f12_1(struct s12 a0) {}
// Check that sret parameter is accounted for when checking available integer
// registers.
-// RUN: grep 'define void @f13(.struct.s13_0. noalias sret .agg.result, i32 .a, i32 .b, i32 .c, i32 .d, .struct.s13_1. byval .e, i32 .f)' %t &&
+// RUN: grep 'define void @f13(.struct.s13_0. noalias sret .agg.result, i32 .a, i32 .b, i32 .c, i32 .d, .struct.s13_1. byval .e, i32 .f)' %t
struct s13_0 { long long f0[3]; };
struct s13_1 { long long f0[2]; };
struct s13_0 f13(int a, int b, int c, int d,
struct s13_1 e, int f) { while (1) {} }
-// RUN: grep 'define void @f14(.*, i8 signext .X)' %t &&
+// RUN: grep 'define void @f14(.*, i8 signext .X)' %t
void f14(int a, int b, int c, int d, int e, int f,
char X) {}
-// RUN: grep 'define void @f15(.*, i8\* .X)' %t &&
+// RUN: grep 'define void @f15(.*, i8\* .X)' %t
void f15(int a, int b, int c, int d, int e, int f,
void *X) {}
-// RUN: grep 'define void @f16(.*, float .X)' %t &&
+// RUN: grep 'define void @f16(.*, float .X)' %t
void f16(float a, float b, float c, float d, float e, float f, float g, float h,
float X) {}
-// RUN: grep 'define void @f17(.*, x86_fp80 .X)' %t &&
+// RUN: grep 'define void @f17(.*, x86_fp80 .X)' %t
void f17(float a, float b, float c, float d, float e, float f, float g, float h,
long double X) {}
// Check for valid coercion.
-// RUN: grep '.. = bitcast i64. .* to .struct.f18_s0.' %t &&
-// RUN: grep '.. = load .struct.f18_s0. .., align 1' %t &&
-// RUN: grep 'store .struct.f18_s0 .., .struct.f18_s0. .f18_arg1' %t &&
+// RUN: grep '.. = bitcast i64. .* to .struct.f18_s0.' %t
+// RUN: grep '.. = load .struct.f18_s0. .., align 1' %t
+// RUN: grep 'store .struct.f18_s0 .., .struct.f18_s0. .f18_arg1' %t
struct f18_s0 { int f0; };
void f18(int a, struct f18_s0 f18_arg1) { while (1) {} }
-// RUN: true
diff --git a/test/CodeGenCXX/PR5050-constructor-conversion.cpp b/test/CodeGenCXX/PR5050-constructor-conversion.cpp
index e5f722c..c0b53d5 100644
--- a/test/CodeGenCXX/PR5050-constructor-conversion.cpp
+++ b/test/CodeGenCXX/PR5050-constructor-conversion.cpp
@@ -1,8 +1,7 @@
-// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s &&
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s &&
-// RUN: clang-cc -triple i386-apple-darwin -std=c++0x -S %s -o %t-32.s &&
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s &&
-// RUN: true
+// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s
+// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: clang-cc -triple i386-apple-darwin -std=c++0x -S %s -o %t-32.s
+// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
struct A { A(const A&, int i1 = 1); };
diff --git a/test/CodeGenCXX/array-construction.cpp b/test/CodeGenCXX/array-construction.cpp
index 5b6bc2e..2f82872 100644
--- a/test/CodeGenCXX/array-construction.cpp
+++ b/test/CodeGenCXX/array-construction.cpp
@@ -1,8 +1,7 @@
-// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s &&
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s &&
-// RUN: clang-cc -triple i386-apple-darwin -std=c++0x -S %s -o %t-32.s &&
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s &&
-// RUN: true
+// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s
+// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: clang-cc -triple i386-apple-darwin -std=c++0x -S %s -o %t-32.s
+// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
extern "C" int printf(...);
diff --git a/test/CodeGenCXX/array-operator-delete-call.cpp b/test/CodeGenCXX/array-operator-delete-call.cpp
new file mode 100644
index 0000000..c23d336
--- /dev/null
+++ b/test/CodeGenCXX/array-operator-delete-call.cpp
@@ -0,0 +1,63 @@
+// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s
+// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: clang-cc -triple i386-apple-darwin -std=c++0x -S %s -o %t-32.s
+// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
+
+extern "C" int printf(...);
+
+int count;
+
+struct S {
+ S() : iS (++count) { printf("S::S(%d)\n", iS); }
+ ~S() { printf("S::~S(%d)\n", iS); }
+ int iS;
+};
+
+struct V {
+ V() : iV (++count) { printf("V::V(%d)\n", iV); }
+ virtual ~V() { printf("V::~V(%d)\n", iV); }
+ int iV;
+};
+
+struct COST
+{
+ S *cost;
+ V *vcost;
+ unsigned *cost_val;
+
+ ~COST();
+ COST();
+};
+
+
+COST::COST()
+{
+ cost = new S[3];
+ vcost = new V[4];
+ cost_val = new unsigned[10];
+}
+
+COST::~COST()
+{
+ if (cost) {
+ delete [] cost;
+ }
+ if (vcost) {
+ delete [] vcost;
+ }
+ if (cost_val)
+ delete [] cost_val;
+}
+
+COST c1;
+
+int main()
+{
+ COST c3;
+}
+COST c2;
+
+// CHECK-LP64: call __ZdaPv
+
+// CHECK-LP32: call L__ZdaPv
+
diff --git a/test/CodeGenCXX/array-value-initialize.cpp b/test/CodeGenCXX/array-value-initialize.cpp
new file mode 100644
index 0000000..f041bc5
--- /dev/null
+++ b/test/CodeGenCXX/array-value-initialize.cpp
@@ -0,0 +1,28 @@
+// RUN: clang-cc -emit-llvm -o - %s
+
+// PR5463
+extern "C" int printf(...);
+
+struct S {
+ double filler;
+};
+
+struct Foo {
+ Foo(void) : bar_(), dbar_(), sbar_() {
+ for (int i = 0; i < 5; i++) {
+ printf("bar_[%d] = %d\n", i, bar_[i]);
+ printf("dbar_[%d] = %f\n", i, dbar_[i]);
+ printf("sbar_[%d].filler = %f\n", i, sbar_[i].filler);
+ }
+ }
+
+ int bar_[5];
+ double dbar_[5];
+ S sbar_[5];
+};
+
+int main(void)
+{
+ Foo a;
+}
+
diff --git a/test/CodeGenCXX/assign-operator.cpp b/test/CodeGenCXX/assign-operator.cpp
new file mode 100644
index 0000000..3e0be45
--- /dev/null
+++ b/test/CodeGenCXX/assign-operator.cpp
@@ -0,0 +1,9 @@
+// RUN: clang-cc %s -emit-llvm-only -verify
+
+class x {
+int operator=(int);
+};
+void a() {
+ x a;
+ a = 1u;
+}
diff --git a/test/CodeGenCXX/attr.cpp b/test/CodeGenCXX/attr.cpp
index 8077b78..695e9e7 100644
--- a/test/CodeGenCXX/attr.cpp
+++ b/test/CodeGenCXX/attr.cpp
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple x86_64-apple-darwin -O0 -S %s -o %t.s &&
+// RUN: clang-cc -triple x86_64-apple-darwin -O0 -S %s -o %t.s
// RUN: FileCheck --input-file=%t.s %s
int foo() __attribute__((aligned(1024)));
diff --git a/test/CodeGenCXX/call-arg-zero-temp.cpp b/test/CodeGenCXX/call-arg-zero-temp.cpp
index 2c44f69..e066927 100644
--- a/test/CodeGenCXX/call-arg-zero-temp.cpp
+++ b/test/CodeGenCXX/call-arg-zero-temp.cpp
@@ -1,8 +1,7 @@
-// RUN: clang-cc -triple x86_64-apple-darwin -S %s -o %t-64.s &&
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s &&
-// RUN: clang-cc -triple i386-apple-darwin -S %s -o %t-32.s &&
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s &&
-// RUN: true
+// RUN: clang-cc -triple x86_64-apple-darwin -S %s -o %t-64.s
+// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: clang-cc -triple i386-apple-darwin -S %s -o %t-32.s
+// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
extern "C" int printf(...);
diff --git a/test/CodeGenCXX/cast-conversion.cpp b/test/CodeGenCXX/cast-conversion.cpp
index f571f54..fa8487a 100644
--- a/test/CodeGenCXX/cast-conversion.cpp
+++ b/test/CodeGenCXX/cast-conversion.cpp
@@ -1,8 +1,7 @@
-// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s &&
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s &&
-// RUN: clang-cc -triple i386-apple-darwin -std=c++0x -S %s -o %t-32.s &&
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s &&
-// RUN: true
+// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s
+// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: clang-cc -triple i386-apple-darwin -std=c++0x -S %s -o %t-32.s
+// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
struct A {
A(int);
diff --git a/test/CodeGenCXX/class-layout.cpp b/test/CodeGenCXX/class-layout.cpp
index 7255d3e..7663d2e 100644
--- a/test/CodeGenCXX/class-layout.cpp
+++ b/test/CodeGenCXX/class-layout.cpp
@@ -1,4 +1,4 @@
-// RUN: clang-cc %s -emit-llvm -o %t &&
+// RUN: clang-cc %s -emit-llvm -o %t
// An extra byte shoudl be allocated for an empty class.
// RUN: grep '%.truct.A = type { i8 }' %t
diff --git a/test/CodeGenCXX/constructor-conversion.cpp b/test/CodeGenCXX/constructor-conversion.cpp
index 980b230..dcc9535 100644
--- a/test/CodeGenCXX/constructor-conversion.cpp
+++ b/test/CodeGenCXX/constructor-conversion.cpp
@@ -1,8 +1,7 @@
-// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s &&
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s &&
-// RUN: clang-cc -triple i386-apple-darwin -std=c++0x -S %s -o %t-32.s &&
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s &&
-// RUN: true
+// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s
+// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: clang-cc -triple i386-apple-darwin -std=c++0x -S %s -o %t-32.s
+// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
extern "C" int printf(...);
diff --git a/test/CodeGenCXX/constructor-default-arg.cpp b/test/CodeGenCXX/constructor-default-arg.cpp
index 7e6a7cd..c494149 100644
--- a/test/CodeGenCXX/constructor-default-arg.cpp
+++ b/test/CodeGenCXX/constructor-default-arg.cpp
@@ -1,8 +1,7 @@
-// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s &&
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s &&
-// RUN: clang-cc -triple i386-apple-darwin -std=c++0x -S %s -o %t-32.s &&
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s &&
-// RUN: true
+// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s
+// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: clang-cc -triple i386-apple-darwin -std=c++0x -S %s -o %t-32.s
+// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
extern "C" int printf(...);
diff --git a/test/CodeGenCXX/constructor-for-array-members.cpp b/test/CodeGenCXX/constructor-for-array-members.cpp
index fbb13e0..5160a89 100644
--- a/test/CodeGenCXX/constructor-for-array-members.cpp
+++ b/test/CodeGenCXX/constructor-for-array-members.cpp
@@ -1,8 +1,7 @@
-// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s &&
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s &&
-// RUN: clang-cc -triple i386-apple-darwin -std=c++0x -S %s -o %t-32.s &&
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s &&
-// RUN: true
+// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s
+// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: clang-cc -triple i386-apple-darwin -std=c++0x -S %s -o %t-32.s
+// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
extern "C" int printf(...);
diff --git a/test/CodeGenCXX/constructor-template.cpp b/test/CodeGenCXX/constructor-template.cpp
index 8c4f2c9..66ec9ea 100644
--- a/test/CodeGenCXX/constructor-template.cpp
+++ b/test/CodeGenCXX/constructor-template.cpp
@@ -1,8 +1,7 @@
-// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s &&
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s &&
-// RUN: clang-cc -triple i386-apple-darwin -std=c++0x -S %s -o %t-32.s &&
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s &&
-// RUN: true
+// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s
+// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: clang-cc -triple i386-apple-darwin -std=c++0x -S %s -o %t-32.s
+// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
// PR4826
struct A {
diff --git a/test/CodeGenCXX/conversion-function.cpp b/test/CodeGenCXX/conversion-function.cpp
index 0bfd4af..c935876 100644
--- a/test/CodeGenCXX/conversion-function.cpp
+++ b/test/CodeGenCXX/conversion-function.cpp
@@ -1,8 +1,7 @@
-// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s &&
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s &&
-// RUN: clang-cc -triple i386-apple-darwin -std=c++0x -S %s -o %t-32.s &&
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s &&
-// RUN: true
+// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s
+// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: clang-cc -triple i386-apple-darwin -std=c++0x -S %s -o %t-32.s
+// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
extern "C" int printf(...);
struct S {
diff --git a/test/CodeGenCXX/convert-to-fptr.cpp b/test/CodeGenCXX/convert-to-fptr.cpp
index c0bd2f7..7cc8c08 100644
--- a/test/CodeGenCXX/convert-to-fptr.cpp
+++ b/test/CodeGenCXX/convert-to-fptr.cpp
@@ -1,8 +1,7 @@
-// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s &&
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s &&
-// RUN: clang-cc -triple i386-apple-darwin -std=c++0x -S %s -o %t-32.s &&
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s &&
-// RUN: true
+// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s
+// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: clang-cc -triple i386-apple-darwin -std=c++0x -S %s -o %t-32.s
+// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
extern "C" int printf(...);
diff --git a/test/CodeGenCXX/copy-assign-synthesis-1.cpp b/test/CodeGenCXX/copy-assign-synthesis-1.cpp
index d4a93af..14fbe30 100644
--- a/test/CodeGenCXX/copy-assign-synthesis-1.cpp
+++ b/test/CodeGenCXX/copy-assign-synthesis-1.cpp
@@ -1,8 +1,7 @@
-// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s &&
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s &&
-// RUN: clang-cc -triple i386-apple-darwin -std=c++0x -S %s -o %t-32.s &&
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s &&
-// RUN: true
+// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s
+// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: clang-cc -triple i386-apple-darwin -std=c++0x -S %s -o %t-32.s
+// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
extern "C" int printf(...);
diff --git a/test/CodeGenCXX/copy-assign-synthesis.cpp b/test/CodeGenCXX/copy-assign-synthesis.cpp
index f9baa8f..65a84f4 100644
--- a/test/CodeGenCXX/copy-assign-synthesis.cpp
+++ b/test/CodeGenCXX/copy-assign-synthesis.cpp
@@ -1,4 +1,4 @@
-// RUN: clang-cc -emit-llvm -o %t %s &&
+// RUN: clang-cc -emit-llvm -o %t %s
// RUN: grep "_ZN1XaSERK1X" %t | count 0
extern "C" int printf(...);
diff --git a/test/CodeGenCXX/copy-constructor-elim.cpp b/test/CodeGenCXX/copy-constructor-elim.cpp
index daef92c..953effe 100644
--- a/test/CodeGenCXX/copy-constructor-elim.cpp
+++ b/test/CodeGenCXX/copy-constructor-elim.cpp
@@ -1,7 +1,6 @@
-// RUN: clang-cc -emit-llvm -o %t %s &&
-// RUN: grep "_ZN1CC1ERK1C" %t | count 0 &&
-// RUN: grep "_ZN1SC1ERK1S" %t | count 0 &&
-// RUN: true
+// RUN: clang-cc -emit-llvm -o %t %s
+// RUN: grep "_ZN1CC1ERK1C" %t | count 0
+// RUN: grep "_ZN1SC1ERK1S" %t | count 0
extern "C" int printf(...);
diff --git a/test/CodeGenCXX/copy-constructor-synthesis.cpp b/test/CodeGenCXX/copy-constructor-synthesis.cpp
index 47971af..3b8f782 100644
--- a/test/CodeGenCXX/copy-constructor-synthesis.cpp
+++ b/test/CodeGenCXX/copy-constructor-synthesis.cpp
@@ -1,8 +1,7 @@
-// RUN: clang-cc -triple x86_64-apple-darwin -S %s -o %t-64.s &&
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s &&
-// RUN: clang-cc -triple i386-apple-darwin -S %s -o %t-32.s &&
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s &&
-// RUN: true
+// RUN: clang-cc -triple x86_64-apple-darwin -S %s -o %t-64.s
+// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: clang-cc -triple i386-apple-darwin -S %s -o %t-32.s
+// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
extern "C" int printf(...);
@@ -45,6 +44,8 @@ struct X : M, N, P { // ...
const char *name;
unsigned bf1 : 8;
unsigned bf2 : 16;
+ int arr[2];
+ _Complex float complex;
union {
int au_i1;
diff --git a/test/CodeGenCXX/debug-info.cpp b/test/CodeGenCXX/debug-info.cpp
new file mode 100644
index 0000000..b89435a
--- /dev/null
+++ b/test/CodeGenCXX/debug-info.cpp
@@ -0,0 +1,13 @@
+// RUN: clang-cc -emit-llvm-only -g
+template<typename T> struct Identity {
+ typedef T Type;
+};
+
+void f(Identity<int>::Type a) {}
+void f(Identity<int> a) {}
+void f(int& a) { }
+
+template<typename T> struct A {
+ A<T> *next;
+};
+void f(A<int>) { }
diff --git a/test/CodeGenCXX/decl-ref-init.cpp b/test/CodeGenCXX/decl-ref-init.cpp
index 27d200f..fd93b7b 100644
--- a/test/CodeGenCXX/decl-ref-init.cpp
+++ b/test/CodeGenCXX/decl-ref-init.cpp
@@ -1,8 +1,7 @@
-// RUN: clang-cc -triple x86_64-apple-darwin -S %s -o %t-64.s &&
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s &&
-// RUN: clang-cc -triple i386-apple-darwin -S %s -o %t-32.s &&
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s &&
-// RUN: true
+// RUN: clang-cc -triple x86_64-apple-darwin -S %s -o %t-64.s
+// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: clang-cc -triple i386-apple-darwin -S %s -o %t-32.s
+// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
struct A {};
diff --git a/test/CodeGenCXX/default-arg-temps.cpp b/test/CodeGenCXX/default-arg-temps.cpp
index 8385aff..0ec5b58 100644
--- a/test/CodeGenCXX/default-arg-temps.cpp
+++ b/test/CodeGenCXX/default-arg-temps.cpp
@@ -1,4 +1,4 @@
-// RUN: clang-cc -emit-llvm %s -o %t -triple=x86_64-apple-darwin9 &&
+// RUN: clang-cc -emit-llvm %s -o %t -triple=x86_64-apple-darwin9
struct T {
T();
@@ -14,8 +14,8 @@ public:
};
void g() {
- // RUN: grep "call void @_ZN1TC1Ev" %t | count 4 &&
- // RUN: grep "call void @_ZN1TD1Ev" %t | count 4 &&
+ // RUN: grep "call void @_ZN1TC1Ev" %t | count 4
+ // RUN: grep "call void @_ZN1TD1Ev" %t | count 4
f();
f();
diff --git a/test/CodeGenCXX/default-arguments.cpp b/test/CodeGenCXX/default-arguments.cpp
new file mode 100644
index 0000000..5028ce9
--- /dev/null
+++ b/test/CodeGenCXX/default-arguments.cpp
@@ -0,0 +1,13 @@
+// RUN: clang-cc -emit-llvm %s -o - -triple=x86_64-apple-darwin10
+
+// PR5484
+namespace PR5484 {
+struct A { };
+extern A a;
+
+void f(const A & = a);
+
+void g() {
+ f();
+}
+}
diff --git a/test/CodeGenCXX/default-constructor-default-argument.cpp b/test/CodeGenCXX/default-constructor-default-argument.cpp
new file mode 100644
index 0000000..f53732e
--- /dev/null
+++ b/test/CodeGenCXX/default-constructor-default-argument.cpp
@@ -0,0 +1,8 @@
+// RUN: clang-cc %s -emit-llvm -o - | FileCheck %s
+
+// Check that call to constructor for struct A is generated correctly.
+struct A { A(int x = 2); };
+struct B : public A {};
+B x;
+
+// CHECK: call void @_ZN1AC1Ei
diff --git a/test/CodeGenCXX/default-constructor-for-members.cpp b/test/CodeGenCXX/default-constructor-for-members.cpp
index 2d04bc9..d972d63 100644
--- a/test/CodeGenCXX/default-constructor-for-members.cpp
+++ b/test/CodeGenCXX/default-constructor-for-members.cpp
@@ -1,8 +1,7 @@
-// RUN: clang-cc -triple x86_64-apple-darwin -S %s -o %t-64.s &&
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s &&
-// RUN: clang-cc -triple i386-apple-darwin -S %s -o %t-32.s &&
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s &&
-// RUN: true
+// RUN: clang-cc -triple x86_64-apple-darwin -S %s -o %t-64.s
+// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: clang-cc -triple i386-apple-darwin -S %s -o %t-32.s
+// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
extern "C" int printf(...);
diff --git a/test/CodeGenCXX/default-destructor-synthesis.cpp b/test/CodeGenCXX/default-destructor-synthesis.cpp
index 9cc802c..fef9c03 100644
--- a/test/CodeGenCXX/default-destructor-synthesis.cpp
+++ b/test/CodeGenCXX/default-destructor-synthesis.cpp
@@ -1,8 +1,7 @@
-// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -O0 -S %s -o %t-64.s &&
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s &&
-// RUN: clang-cc -triple i386-apple-darwin -std=c++0x -O0 -S %s -o %t-32.s &&
-// RUN: FileCheck -check-prefix LP32 -input-file=%t-32.s %s &&
-// RUN: true
+// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -O0 -S %s -o %t-64.s
+// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: clang-cc -triple i386-apple-darwin -std=c++0x -O0 -S %s -o %t-32.s
+// RUN: FileCheck -check-prefix LP32 -input-file=%t-32.s %s
extern "C" int printf(...);
diff --git a/test/CodeGenCXX/delete-two-arg.cpp b/test/CodeGenCXX/delete-two-arg.cpp
new file mode 100644
index 0000000..a5b18ba
--- /dev/null
+++ b/test/CodeGenCXX/delete-two-arg.cpp
@@ -0,0 +1,6 @@
+// RUN: clang-cc -triple i686-pc-linux-gnu %s -o - -emit-llvm -verify | FileCheck %s
+
+struct A { void operator delete(void*,__typeof(sizeof(int))); int x; };
+void a(A* x) { delete x; }
+
+// CHECK: call void @_ZN1AdlEPvj(i8* %0, i32 4)
diff --git a/test/CodeGenCXX/delete.cpp b/test/CodeGenCXX/delete.cpp
index 9e3feef..78c83cf 100644
--- a/test/CodeGenCXX/delete.cpp
+++ b/test/CodeGenCXX/delete.cpp
@@ -1,4 +1,4 @@
-// RUN: clang-cc %s -emit-llvm -o %t &&
+// RUN: clang-cc %s -emit-llvm -o %t
void t1(int *a) {
delete a;
diff --git a/test/CodeGenCXX/derived-to-base-conv.cpp b/test/CodeGenCXX/derived-to-base-conv.cpp
index 0c89019..70948b0 100644
--- a/test/CodeGenCXX/derived-to-base-conv.cpp
+++ b/test/CodeGenCXX/derived-to-base-conv.cpp
@@ -1,8 +1,7 @@
-// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s &&
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s &&
-// RUN: clang-cc -triple i386-apple-darwin -std=c++0x -S %s -o %t-32.s &&
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s &&
-// RUN: true
+// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s
+// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: clang-cc -triple i386-apple-darwin -std=c++0x -S %s -o %t-32.s
+// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
extern "C" int printf(...);
extern "C" void exit(int);
diff --git a/test/CodeGenCXX/destructors.cpp b/test/CodeGenCXX/destructors.cpp
index 44d2b29..a196c13 100644
--- a/test/CodeGenCXX/destructors.cpp
+++ b/test/CodeGenCXX/destructors.cpp
@@ -28,3 +28,17 @@ class A1 {
};
template<> A1<char>::~A1();
+
+// PR5529
+namespace PR5529 {
+ struct A {
+ ~A();
+ };
+
+ A::~A() { }
+ struct B : A {
+ virtual ~B();
+ };
+
+ B::~B() {}
+}
diff --git a/test/CodeGenCXX/dyncast.cpp b/test/CodeGenCXX/dyncast.cpp
new file mode 100644
index 0000000..4719f80
--- /dev/null
+++ b/test/CodeGenCXX/dyncast.cpp
@@ -0,0 +1,414 @@
+// RUN: clang-cc -I%S -triple x86_64-apple-darwin -std=c++0x -emit-llvm %s -o %t.ll
+// RUN: FileCheck -check-prefix LL --input-file=%t.ll %s
+
+#include <typeinfo>
+
+class test1_A { virtual void f() { } };
+class test1_B { virtual void g() { } };
+class test1_D : public virtual test1_A, private test1_B {};
+class test1_E : public test1_D, public test1_B {};
+class test1_F : public test1_E, public test1_D {};
+
+extern test1_D test1_d;
+extern test1_F test1_f;
+
+extern "C" int printf(const char *str...);
+
+#define S(V, N) if (V) printf("PASS: %d\n", N); else printf("FAIL: %d\n", N)
+
+void test1() {
+ test1_B* bp = (test1_B*)&test1_d;
+ test1_A* ap = &test1_d;
+ // This throws
+ // test1_D& dr = dynamic_cast<D&>(*bp);
+ test1_D* dp = dynamic_cast<test1_D*>(bp);
+ S(dp == 0, 1);
+ ap = dynamic_cast<test1_A*>(bp);
+ S(ap == 0, 2);
+ bp = dynamic_cast<test1_B*>(ap);
+ S(bp == 0, 3);
+ ap = dynamic_cast<test1_A*>(&test1_d);
+ S(ap != 0, 4);
+ // FIXME: Doesn't work yet, gcc fails this at compile time. We'd need access
+ // control for this to work.
+ // bp = dynamic_cast<test1_B*>(&test1_d);
+ // S(bp == 0, 5);
+ {
+ test1_A* ap = &test1_f;
+ S(ap != 0, 6);
+ test1_D* dp = dynamic_cast<test1_D*>(ap);
+ S(dp == 0, 7);
+ // cast from virtual base
+ test1_E* ep1 = dynamic_cast<test1_E*>(ap);
+ S(ep1 != 0, 8);
+ }
+ dp = dynamic_cast<test1_D*>(&test1_d);
+ S(dp == &test1_d, 9);
+ const test1_D *cdp = dynamic_cast<const test1_D*>(&test1_d);
+ S(cdp == &test1_d, 10);
+ dp = dynamic_cast<test1_D*>((test1_A*)0);
+ S(dp == 0, 11);
+ ap = dynamic_cast<test1_A*>(&test1_d);
+ S(ap == (test1_A*)&test1_d, 12);
+ test1_E* ep = dynamic_cast<test1_E*>(&test1_f);
+ S(ep == (test1_E*)&test1_f, 13);
+ void *vp = dynamic_cast<void*>(ap);
+ S(vp == &test1_d, 14);
+ const void *cvp = dynamic_cast<const void*>(ap);
+ S(cvp == &test1_d, 15);
+}
+
+// CHECK-LL: define void @_Z5test1v() nounwind {
+// CHECK-LL-NEXT:entry:
+// CHECK-LL-NEXT: %bp = alloca %class.test1_A*, align 8
+// CHECK-LL-NEXT: %ap = alloca %class.test1_A*, align 8
+// CHECK-LL-NEXT: %dp = alloca %class.test1_D*, align 8
+// CHECK-LL-NEXT: %ap37 = alloca %class.test1_A*, align 8
+// CHECK-LL-NEXT: %dp53 = alloca %class.test1_D*, align 8
+// CHECK-LL-NEXT: %ep1 = alloca %class.test1_E*, align 8
+// CHECK-LL-NEXT: %cdp = alloca %class.test1_D*, align 8
+// CHECK-LL-NEXT: %ep = alloca %class.test1_E*, align 8
+// CHECK-LL-NEXT: %vp = alloca i8*, align 8
+// CHECK-LL-NEXT: %cvp = alloca i8*, align 8
+// CHECK-LL-NEXT: br i1 false, label %cast.null, label %cast.notnull
+// CHECK-LL: cast.notnull:
+// CHECK-LL-NEXT: br label %cast.end
+// CHECK-LL: cast.null:
+// CHECK-LL-NEXT: br label %cast.end
+// CHECK-LL: cast.end:
+// CHECK-LL-NEXT: %0 = phi %class.test1_A* [ bitcast (%class.test1_D* @test1_d to %class.test1_A*), %cast.notnull ], [ null, %cast.null ]
+// CHECK-LL-NEXT: store %class.test1_A* %0, %class.test1_A** %bp
+// CHECK-LL-NEXT: br i1 false, label %cast.null2, label %cast.notnull1
+// CHECK-LL: cast.notnull1:
+// CHECK-LL-NEXT: %vtable = load i8** bitcast (%class.test1_D* @test1_d to i8**)
+// CHECK-LL-NEXT: %vbase.offset.ptr = getelementptr i8* %vtable, i64 -24
+// CHECK-LL-NEXT: %1 = bitcast i8* %vbase.offset.ptr to i64*
+// CHECK-LL-NEXT: %vbase.offset = load i64* %1
+// CHECK-LL-NEXT: %add.ptr = getelementptr i8* getelementptr inbounds (%class.test1_D* @test1_d, i32 0, i32 0, i32 0), i64 %vbase.offset
+// CHECK-LL-NEXT: %2 = bitcast i8* %add.ptr to %class.test1_A*
+// CHECK-LL-NEXT: br label %cast.end3
+// CHECK-LL: cast.null2:
+// CHECK-LL-NEXT: br label %cast.end3
+// CHECK-LL: cast.end3:
+// CHECK-LL-NEXT: %3 = phi %class.test1_A* [ %2, %cast.notnull1 ], [ null, %cast.null2 ]
+// CHECK-LL-NEXT: store %class.test1_A* %3, %class.test1_A** %ap
+// CHECK-LL-NEXT: %tmp = load %class.test1_A** %bp
+// CHECK-LL-NEXT: %4 = icmp ne %class.test1_A* %tmp, null
+// CHECK-LL-NEXT: br i1 %4, label %5, label %9
+// CHECK-LL: ; <label>:5
+// CHECK-LL-NEXT: %6 = bitcast %class.test1_A* %tmp to i8*
+// CHECK-LL-NEXT: %7 = call i8* @__dynamic_cast(i8* %6, i8* bitcast (i8** @_ZTI7test1_B to i8*), i8* bitcast (i8** @_ZTI7test1_D to i8*), i64 -1)
+// CHECK-LL-NEXT: %8 = bitcast i8* %7 to %class.test1_D*
+// CHECK-LL-NEXT: br label %10
+// CHECK-LL: ; <label>:9
+// CHECK-LL-NEXT: br label %10
+// CHECK-LL: ; <label>:10
+// CHECK-LL-NEXT: %11 = phi %class.test1_D* [ %8, %5 ], [ null, %9 ]
+// CHECK-LL-NEXT: store %class.test1_D* %11, %class.test1_D** %dp
+// CHECK-LL-NEXT: %tmp4 = load %class.test1_D** %dp
+// CHECK-LL-NEXT: %cmp = icmp eq %class.test1_D* %tmp4, null
+// CHECK-LL-NEXT: br i1 %cmp, label %if.then, label %if.else
+// CHECK-LL: if.then:
+// CHECK-LL-NEXT: %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 1)
+// CHECK-LL-NEXT: br label %if.end
+// CHECK-LL: if.else:
+// CHECK-LL-NEXT: %call5 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 1)
+// CHECK-LL-NEXT: br label %if.end
+// CHECK-LL: if.end:
+// CHECK-LL-NEXT: %tmp6 = load %class.test1_A** %bp
+// CHECK-LL-NEXT: %12 = icmp ne %class.test1_A* %tmp6, null
+// CHECK-LL-NEXT: br i1 %12, label %13, label %17
+// CHECK-LL: ; <label>:13
+// CHECK-LL-NEXT: %14 = bitcast %class.test1_A* %tmp6 to i8*
+// CHECK-LL-NEXT: %15 = call i8* @__dynamic_cast(i8* %14, i8* bitcast (i8** @_ZTI7test1_B to i8*), i8* bitcast (i8** @_ZTI7test1_A to i8*), i64 -1)
+// CHECK-LL-NEXT: %16 = bitcast i8* %15 to %class.test1_A*
+// CHECK-LL-NEXT: br label %18
+// CHECK-LL: ; <label>:17
+// CHECK-LL-NEXT: br label %18
+// CHECK-LL: ; <label>:18
+// CHECK-LL-NEXT: %19 = phi %class.test1_A* [ %16, %13 ], [ null, %17 ]
+// CHECK-LL-NEXT: store %class.test1_A* %19, %class.test1_A** %ap
+// CHECK-LL-NEXT: %tmp7 = load %class.test1_A** %ap
+// CHECK-LL-NEXT: %cmp8 = icmp eq %class.test1_A* %tmp7, null
+// CHECK-LL-NEXT: br i1 %cmp8, label %if.then9, label %if.else11
+// CHECK-LL: if.then9:
+// CHECK-LL-NEXT: %call10 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 2)
+// CHECK-LL-NEXT: br label %if.end13
+// CHECK-LL: if.else11:
+// CHECK-LL-NEXT: %call12 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 2)
+// CHECK-LL-NEXT: br label %if.end13
+// CHECK-LL: if.end13:
+// CHECK-LL-NEXT: %tmp14 = load %class.test1_A** %ap
+// CHECK-LL-NEXT: %20 = icmp ne %class.test1_A* %tmp14, null
+// CHECK-LL-NEXT: br i1 %20, label %21, label %25
+// CHECK-LL: ; <label>:21
+// CHECK-LL-NEXT: %22 = bitcast %class.test1_A* %tmp14 to i8*
+// CHECK-LL-NEXT: %23 = call i8* @__dynamic_cast(i8* %22, i8* bitcast (i8** @_ZTI7test1_A to i8*), i8* bitcast (i8** @_ZTI7test1_B to i8*), i64 -1)
+// CHECK-LL-NEXT: %24 = bitcast i8* %23 to %class.test1_A*
+// CHECK-LL-NEXT: br label %26
+// CHECK-LL: ; <label>:25
+// CHECK-LL-NEXT: br label %26
+// CHECK-LL: ; <label>:26
+// CHECK-LL-NEXT: %27 = phi %class.test1_A* [ %24, %21 ], [ null, %25 ]
+// CHECK-LL-NEXT: store %class.test1_A* %27, %class.test1_A** %bp
+// CHECK-LL-NEXT: %tmp15 = load %class.test1_A** %bp
+// CHECK-LL-NEXT: %cmp16 = icmp eq %class.test1_A* %tmp15, null
+// CHECK-LL-NEXT: br i1 %cmp16, label %if.then17, label %if.else19
+// CHECK-LL: if.then17:
+// CHECK-LL-NEXT: %call18 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 3)
+// CHECK-LL-NEXT: br label %if.end21
+// CHECK-LL: if.else19:
+// CHECK-LL-NEXT: %call20 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 3)
+// CHECK-LL-NEXT: br label %if.end21
+// CHECK-LL: if.end21:
+// CHECK-LL-NEXT: br i1 false, label %cast.null27, label %cast.notnull22
+// CHECK-LL: cast.notnull22:
+// CHECK-LL-NEXT: %vtable23 = load i8** bitcast (%class.test1_D* @test1_d to i8**)
+// CHECK-LL-NEXT: %vbase.offset.ptr24 = getelementptr i8* %vtable23, i64 -24
+// CHECK-LL-NEXT: %28 = bitcast i8* %vbase.offset.ptr24 to i64*
+// CHECK-LL-NEXT: %vbase.offset25 = load i64* %28
+// CHECK-LL-NEXT: %add.ptr26 = getelementptr i8* getelementptr inbounds (%class.test1_D* @test1_d, i32 0, i32 0, i32 0), i64 %vbase.offset25
+// CHECK-LL-NEXT: %29 = bitcast i8* %add.ptr26 to %class.test1_A*
+// CHECK-LL-NEXT: br label %cast.end28
+// CHECK-LL: cast.null27:
+// CHECK-LL-NEXT: br label %cast.end28
+// CHECK-LL: cast.end28:
+// CHECK-LL-NEXT: %30 = phi %class.test1_A* [ %29, %cast.notnull22 ], [ null, %cast.null27 ]
+// CHECK-LL-NEXT: store %class.test1_A* %30, %class.test1_A** %ap
+// CHECK-LL-NEXT: %tmp29 = load %class.test1_A** %ap
+// CHECK-LL-NEXT: %cmp30 = icmp ne %class.test1_A* %tmp29, null
+// CHECK-LL-NEXT: br i1 %cmp30, label %if.then31, label %if.else33
+// CHECK-LL: if.then31:
+// CHECK-LL-NEXT: %call32 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 4)
+// CHECK-LL-NEXT: br label %if.end35
+// CHECK-LL: if.else33:
+// CHECK-LL-NEXT: %call34 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 4)
+// CHECK-LL-NEXT: br label %if.end35
+// CHECK-LL: if.end35:
+// CHECK-LL-NEXT: br i1 false, label %cast.null43, label %cast.notnull38
+// CHECK-LL: cast.notnull38:
+// CHECK-LL-NEXT: %vtable39 = load i8** bitcast (%class.test1_F* @test1_f to i8**)
+// CHECK-LL-NEXT: %vbase.offset.ptr40 = getelementptr i8* %vtable39, i64 -24
+// CHECK-LL-NEXT: %31 = bitcast i8* %vbase.offset.ptr40 to i64*
+// CHECK-LL-NEXT: %vbase.offset41 = load i64* %31
+// CHECK-LL-NEXT: %add.ptr42 = getelementptr i8* getelementptr inbounds (%class.test1_F* @test1_f, i32 0, i32 0, i32 0), i64 %vbase.offset41
+// CHECK-LL-NEXT: %32 = bitcast i8* %add.ptr42 to %class.test1_A*
+// CHECK-LL-NEXT: br label %cast.end44
+// CHECK-LL: cast.null43:
+// CHECK-LL-NEXT: br label %cast.end44
+// CHECK-LL: cast.end44:
+// CHECK-LL-NEXT: %33 = phi %class.test1_A* [ %32, %cast.notnull38 ], [ null, %cast.null43 ]
+// CHECK-LL-NEXT: store %class.test1_A* %33, %class.test1_A** %ap37
+// CHECK-LL-NEXT: %tmp45 = load %class.test1_A** %ap37
+// CHECK-LL-NEXT: %cmp46 = icmp ne %class.test1_A* %tmp45, null
+// CHECK-LL-NEXT: br i1 %cmp46, label %if.then47, label %if.else49
+// CHECK-LL: if.then47:
+// CHECK-LL-NEXT: %call48 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 6)
+// CHECK-LL-NEXT: br label %if.end51
+// CHECK-LL: if.else49:
+// CHECK-LL-NEXT: %call50 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 6)
+// CHECK-LL-NEXT: br label %if.end51
+// CHECK-LL: if.end51:
+// CHECK-LL-NEXT: %tmp54 = load %class.test1_A** %ap37
+// CHECK-LL-NEXT: %34 = icmp ne %class.test1_A* %tmp54, null
+// CHECK-LL-NEXT: br i1 %34, label %35, label %39
+// CHECK-LL: ; <label>:35
+// CHECK-LL-NEXT: %36 = bitcast %class.test1_A* %tmp54 to i8*
+// CHECK-LL-NEXT: %37 = call i8* @__dynamic_cast(i8* %36, i8* bitcast (i8** @_ZTI7test1_A to i8*), i8* bitcast (i8** @_ZTI7test1_D to i8*), i64 -1)
+// CHECK-LL-NEXT: %38 = bitcast i8* %37 to %class.test1_D*
+// CHECK-LL-NEXT: br label %40
+// CHECK-LL: ; <label>:39
+// CHECK-LL-NEXT: br label %40
+// CHECK-LL: ; <label>:40
+// CHECK-LL-NEXT: %41 = phi %class.test1_D* [ %38, %35 ], [ null, %39 ]
+// CHECK-LL-NEXT: store %class.test1_D* %41, %class.test1_D** %dp53
+// CHECK-LL-NEXT: %tmp55 = load %class.test1_D** %dp53
+// CHECK-LL-NEXT: %cmp56 = icmp eq %class.test1_D* %tmp55, null
+// CHECK-LL-NEXT: br i1 %cmp56, label %if.then57, label %if.else59
+// CHECK-LL: if.then57:
+// CHECK-LL-NEXT: %call58 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 7)
+// CHECK-LL-NEXT: br label %if.end61
+// CHECK-LL: if.else59:
+// CHECK-LL-NEXT: %call60 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 7)
+// CHECK-LL-NEXT: br label %if.end61
+// CHECK-LL: if.end61:
+// CHECK-LL-NEXT: %tmp63 = load %class.test1_A** %ap37
+// CHECK-LL-NEXT: %42 = icmp ne %class.test1_A* %tmp63, null
+// CHECK-LL-NEXT: br i1 %42, label %43, label %47
+// CHECK-LL: ; <label>:43
+// CHECK-LL-NEXT: %44 = bitcast %class.test1_A* %tmp63 to i8*
+// CHECK-LL-NEXT: %45 = call i8* @__dynamic_cast(i8* %44, i8* bitcast (i8** @_ZTI7test1_A to i8*), i8* bitcast (i8** @_ZTI7test1_E to i8*), i64 -1)
+// CHECK-LL-NEXT: %46 = bitcast i8* %45 to %class.test1_E*
+// CHECK-LL-NEXT: br label %48
+// CHECK-LL: ; <label>:47
+// CHECK-LL-NEXT: br label %48
+// CHECK-LL: ; <label>:48
+// CHECK-LL-NEXT: %49 = phi %class.test1_E* [ %46, %43 ], [ null, %47 ]
+// CHECK-LL-NEXT: store %class.test1_E* %49, %class.test1_E** %ep1
+// CHECK-LL-NEXT: %tmp64 = load %class.test1_E** %ep1
+// CHECK-LL-NEXT: %cmp65 = icmp ne %class.test1_E* %tmp64, null
+// CHECK-LL-NEXT: br i1 %cmp65, label %if.then66, label %if.else68
+// CHECK-LL: if.then66:
+// CHECK-LL-NEXT: %call67 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 8)
+// CHECK-LL-NEXT: br label %if.end70
+// CHECK-LL: if.else68:
+// CHECK-LL-NEXT: %call69 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 8)
+// CHECK-LL-NEXT: br label %if.end70
+// CHECK-LL: if.end70:
+// CHECK-LL-NEXT: store %class.test1_D* @test1_d, %class.test1_D** %dp
+// CHECK-LL-NEXT: %tmp71 = load %class.test1_D** %dp
+// CHECK-LL-NEXT: %cmp72 = icmp eq %class.test1_D* %tmp71, @test1_d
+// CHECK-LL-NEXT: br i1 %cmp72, label %if.then73, label %if.else75
+// CHECK-LL: if.then73:
+// CHECK-LL-NEXT: %call74 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 9)
+// CHECK-LL-NEXT: br label %if.end77
+// CHECK-LL: if.else75:
+// CHECK-LL-NEXT: %call76 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 9)
+// CHECK-LL-NEXT: br label %if.end77
+// CHECK-LL: if.end77:
+// CHECK-LL-NEXT: store %class.test1_D* @test1_d, %class.test1_D** %cdp
+// CHECK-LL-NEXT: %tmp79 = load %class.test1_D** %cdp
+// CHECK-LL-NEXT: %cmp80 = icmp eq %class.test1_D* %tmp79, @test1_d
+// CHECK-LL-NEXT: br i1 %cmp80, label %if.then81, label %if.else83
+// CHECK-LL: if.then81:
+// CHECK-LL-NEXT: %call82 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 10)
+// CHECK-LL-NEXT: br label %if.end85
+// CHECK-LL: if.else83:
+// CHECK-LL-NEXT: %call84 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 10)
+// CHECK-LL-NEXT: br label %if.end85
+// CHECK-LL: if.end85:
+// CHECK-LL-NEXT: br i1 false, label %50, label %53
+// CHECK-LL: ; <label>:50
+// CHECK-LL-NEXT: %51 = call i8* @__dynamic_cast(i8* null, i8* bitcast (i8** @_ZTI7test1_A to i8*), i8* bitcast (i8** @_ZTI7test1_D to i8*), i64 -1)
+// CHECK-LL-NEXT: %52 = bitcast i8* %51 to %class.test1_D*
+// CHECK-LL-NEXT: br label %54
+// CHECK-LL: ; <label>:53
+// CHECK-LL-NEXT: br label %54
+// CHECK-LL: ; <label>:54
+// CHECK-LL-NEXT: %55 = phi %class.test1_D* [ %52, %50 ], [ null, %53 ]
+// CHECK-LL-NEXT: store %class.test1_D* %55, %class.test1_D** %dp
+// CHECK-LL-NEXT: %tmp86 = load %class.test1_D** %dp
+// CHECK-LL-NEXT: %cmp87 = icmp eq %class.test1_D* %tmp86, null
+// CHECK-LL-NEXT: br i1 %cmp87, label %if.then88, label %if.else90
+// CHECK-LL: if.then88:
+// CHECK-LL-NEXT: %call89 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 11)
+// CHECK-LL-NEXT: br label %if.end92
+// CHECK-LL: if.else90:
+// CHECK-LL-NEXT: %call91 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 11)
+// CHECK-LL-NEXT: br label %if.end92
+// CHECK-LL: if.end92:
+// CHECK-LL-NEXT: br i1 false, label %cast.null98, label %cast.notnull93
+// CHECK-LL: cast.notnull93:
+// CHECK-LL-NEXT: %vtable94 = load i8** bitcast (%class.test1_D* @test1_d to i8**)
+// CHECK-LL-NEXT: %vbase.offset.ptr95 = getelementptr i8* %vtable94, i64 -24
+// CHECK-LL-NEXT: %56 = bitcast i8* %vbase.offset.ptr95 to i64*
+// CHECK-LL-NEXT: %vbase.offset96 = load i64* %56
+// CHECK-LL-NEXT: %add.ptr97 = getelementptr i8* getelementptr inbounds (%class.test1_D* @test1_d, i32 0, i32 0, i32 0), i64 %vbase.offset96
+// CHECK-LL-NEXT: %57 = bitcast i8* %add.ptr97 to %class.test1_A*
+// CHECK-LL-NEXT: br label %cast.end99
+// CHECK-LL: cast.null98:
+// CHECK-LL-NEXT: br label %cast.end99
+// CHECK-LL: cast.end99:
+// CHECK-LL-NEXT: %58 = phi %class.test1_A* [ %57, %cast.notnull93 ], [ null, %cast.null98 ]
+// CHECK-LL-NEXT: store %class.test1_A* %58, %class.test1_A** %ap
+// CHECK-LL-NEXT: %tmp100 = load %class.test1_A** %ap
+// CHECK-LL-NEXT: br i1 false, label %cast.null106, label %cast.notnull101
+// CHECK-LL: cast.notnull101:
+// CHECK-LL-NEXT: %vtable102 = load i8** bitcast (%class.test1_D* @test1_d to i8**)
+// CHECK-LL-NEXT: %vbase.offset.ptr103 = getelementptr i8* %vtable102, i64 -24
+// CHECK-LL-NEXT: %59 = bitcast i8* %vbase.offset.ptr103 to i64*
+// CHECK-LL-NEXT: %vbase.offset104 = load i64* %59
+// CHECK-LL-NEXT: %add.ptr105 = getelementptr i8* getelementptr inbounds (%class.test1_D* @test1_d, i32 0, i32 0, i32 0), i64 %vbase.offset104
+// CHECK-LL-NEXT: %60 = bitcast i8* %add.ptr105 to %class.test1_A*
+// CHECK-LL-NEXT: br label %cast.end107
+// CHECK-LL: cast.null106:
+// CHECK-LL-NEXT: br label %cast.end107
+// CHECK-LL: cast.end107:
+// CHECK-LL-NEXT: %61 = phi %class.test1_A* [ %60, %cast.notnull101 ], [ null, %cast.null106 ]
+// CHECK-LL-NEXT: %cmp108 = icmp eq %class.test1_A* %tmp100, %61
+// CHECK-LL-NEXT: br i1 %cmp108, label %if.then109, label %if.else111
+// CHECK-LL: if.then109:
+// CHECK-LL-NEXT: %call110 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 12)
+// CHECK-LL-NEXT: br label %if.end113
+// CHECK-LL: if.else111:
+// CHECK-LL-NEXT: %call112 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 12)
+// CHECK-LL-NEXT: br label %if.end113
+// CHECK-LL: if.end113:
+// CHECK-LL-NEXT: br i1 false, label %cast.null116, label %cast.notnull115
+// CHECK-LL: cast.notnull115:
+// CHECK-LL-NEXT: br label %cast.end117
+// CHECK-LL: cast.null116:
+// CHECK-LL-NEXT: br label %cast.end117
+// CHECK-LL: cast.end117:
+// CHECK-LL-NEXT: %62 = phi %class.test1_E* [ bitcast (%class.test1_F* @test1_f to %class.test1_E*), %cast.notnull115 ], [ null, %cast.null116 ]
+// CHECK-LL-NEXT: store %class.test1_E* %62, %class.test1_E** %ep
+// CHECK-LL-NEXT: %tmp118 = load %class.test1_E** %ep
+// CHECK-LL-NEXT: br i1 false, label %cast.null120, label %cast.notnull119
+// CHECK-LL: cast.notnull119:
+// CHECK-LL-NEXT: br label %cast.end121
+// CHECK-LL: cast.null120:
+// CHECK-LL-NEXT: br label %cast.end121
+// CHECK-LL: cast.end121:
+// CHECK-LL-NEXT: %63 = phi %class.test1_E* [ bitcast (%class.test1_F* @test1_f to %class.test1_E*), %cast.notnull119 ], [ null, %cast.null120 ]
+// CHECK-LL-NEXT: %cmp122 = icmp eq %class.test1_E* %tmp118, %63
+// CHECK-LL-NEXT: br i1 %cmp122, label %if.then123, label %if.else125
+// CHECK-LL: if.then123:
+// CHECK-LL-NEXT: %call124 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 13)
+// CHECK-LL-NEXT: br label %if.end127
+// CHECK-LL: if.else125:
+// CHECK-LL-NEXT: %call126 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 13)
+// CHECK-LL-NEXT: br label %if.end127
+// CHECK-LL: if.end127:
+// CHECK-LL-NEXT: %tmp129 = load %class.test1_A** %ap
+// CHECK-LL-NEXT: %64 = icmp ne %class.test1_A* %tmp129, null
+// CHECK-LL-NEXT: br i1 %64, label %65, label %70
+// CHECK-LL: ; <label>:65
+// CHECK-LL-NEXT: %66 = bitcast %class.test1_A* %tmp129 to i64**
+// CHECK-LL-NEXT: %vtable130 = load i64** %66
+// CHECK-LL-NEXT: %67 = getelementptr inbounds i64* %vtable130, i64 -2
+// CHECK-LL-NEXT: %"offset to top" = load i64* %67
+// CHECK-LL-NEXT: %68 = bitcast %class.test1_A* %tmp129 to i8*
+// CHECK-LL-NEXT: %69 = getelementptr inbounds i8* %68, i64 %"offset to top"
+// CHECK-LL-NEXT: br label %71
+// CHECK-LL: ; <label>:70
+// CHECK-LL-NEXT: br label %71
+// CHECK-LL: ; <label>:71
+// CHECK-LL-NEXT: %72 = phi i8* [ %69, %65 ], [ null, %70 ]
+// CHECK-LL-NEXT: store i8* %72, i8** %vp
+// CHECK-LL-NEXT: %tmp131 = load i8** %vp
+// CHECK-LL-NEXT: %cmp132 = icmp eq i8* %tmp131, getelementptr inbounds (%class.test1_D* @test1_d, i32 0, i32 0, i32 0)
+// CHECK-LL-NEXT: br i1 %cmp132, label %if.then133, label %if.else135
+// CHECK-LL: if.then133:
+// CHECK-LL-NEXT: %call134 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 14)
+// CHECK-LL-NEXT: br label %if.end137
+// CHECK-LL: if.else135:
+// CHECK-LL-NEXT: %call136 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 14)
+// CHECK-LL-NEXT: br label %if.end137
+// CHECK-LL: if.end137:
+// CHECK-LL-NEXT: %tmp139 = load %class.test1_A** %ap
+// CHECK-LL-NEXT: %73 = icmp ne %class.test1_A* %tmp139, null
+// CHECK-LL-NEXT: br i1 %73, label %74, label %79
+// CHECK-LL: ; <label>:74
+// CHECK-LL-NEXT: %75 = bitcast %class.test1_A* %tmp139 to i64**
+// CHECK-LL-NEXT: %vtable140 = load i64** %75
+// CHECK-LL-NEXT: %76 = getelementptr inbounds i64* %vtable140, i64 -2
+// CHECK-LL-NEXT: %"offset to top141" = load i64* %76
+// CHECK-LL-NEXT: %77 = bitcast %class.test1_A* %tmp139 to i8*
+// CHECK-LL-NEXT: %78 = getelementptr inbounds i8* %77, i64 %"offset to top141"
+// CHECK-LL-NEXT: br label %80
+// CHECK-LL: ; <label>:79
+// CHECK-LL-NEXT: br label %80
+// CHECK-LL: ; <label>:80
+// CHECK-LL-NEXT: %81 = phi i8* [ %78, %74 ], [ null, %79 ]
+// CHECK-LL-NEXT: store i8* %81, i8** %cvp
+// CHECK-LL-NEXT: %tmp142 = load i8** %cvp
+// CHECK-LL-NEXT: %cmp143 = icmp eq i8* %tmp142, getelementptr inbounds (%class.test1_D* @test1_d, i32 0, i32 0, i32 0)
+// CHECK-LL-NEXT: br i1 %cmp143, label %if.then144, label %if.else146
+// CHECK-LL: if.then144:
+// CHECK-LL-NEXT: %call145 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 15)
+// CHECK-LL-NEXT: br label %if.end148
+// CHECK-LL: if.else146:
+// CHECK-LL-NEXT: %call147 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 15)
+// CHECK-LL-NEXT: br label %if.end148
+// CHECK-LL: if.end148:
+// CHECK-LL-NEXT: ret void
diff --git a/test/CodeGenCXX/empty-union.cpp b/test/CodeGenCXX/empty-union.cpp
new file mode 100644
index 0000000..fdd9741
--- /dev/null
+++ b/test/CodeGenCXX/empty-union.cpp
@@ -0,0 +1,10 @@
+// RUN: clang-cc -emit-llvm -o - %s
+
+union sigval { };
+
+union sigval sigev_value;
+
+int main()
+{
+ return sizeof(sigev_value);
+}
diff --git a/test/CodeGenCXX/explicit-instantiation.cpp b/test/CodeGenCXX/explicit-instantiation.cpp
index 8a9e65c..b33ba85 100644
--- a/test/CodeGenCXX/explicit-instantiation.cpp
+++ b/test/CodeGenCXX/explicit-instantiation.cpp
@@ -1,4 +1,4 @@
-// RUN: clang-cc -emit-llvm -triple i686-pc-linue-gnu -o %t %s &&
+// RUN: clang-cc -emit-llvm -triple i686-pc-linux-gnu -o %t %s
// RUN: grep "define i32 @_ZNK4plusIillEclERKiRKl" %t | count 1
template<typename T, typename U, typename Result>
diff --git a/test/CodeGenCXX/extern-c.cpp b/test/CodeGenCXX/extern-c.cpp
index 6353293..3af8f3a 100644
--- a/test/CodeGenCXX/extern-c.cpp
+++ b/test/CodeGenCXX/extern-c.cpp
@@ -1,10 +1,10 @@
-// RUN: clang-cc -emit-llvm %s -o %t &&
+// RUN: clang-cc -emit-llvm %s -o %t
namespace foo {
-// RUN: not grep "@a = global i32" %t &&
+// RUN: not grep "@a = global i32" %t
extern "C" int a;
-// RUN: not grep "@_ZN3foo1bE = global i32" %t &&
+// RUN: not grep "@_ZN3foo1bE = global i32" %t
extern int b;
// RUN: grep "@_ZN3foo1cE = global i32" %t | count 1
diff --git a/test/CodeGenCXX/global-array-destruction.cpp b/test/CodeGenCXX/global-array-destruction.cpp
new file mode 100644
index 0000000..ebea9c1
--- /dev/null
+++ b/test/CodeGenCXX/global-array-destruction.cpp
@@ -0,0 +1,33 @@
+// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s
+// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+
+extern "C" int printf(...);
+
+int count;
+
+struct S {
+ S() : iS(++count) { printf("S::S(%d)\n", iS); }
+ ~S() { printf("S::~S(%d)\n", iS); }
+ int iS;
+};
+
+
+S arr[2][1];
+S s1;
+S arr1[3];
+static S sarr[4];
+
+int main () {}
+S arr2[2];
+static S sarr1[4];
+S s2;
+S arr3[3];
+
+// CHECK-LP64: call ___cxa_atexit
+// CHECK-LP64: call ___cxa_atexit
+// CHECK-LP64: call ___cxa_atexit
+// CHECK-LP64: call ___cxa_atexit
+// CHECK-LP64: call ___cxa_atexit
+// CHECK-LP64: call ___cxa_atexit
+// CHECK-LP64: call ___cxa_atexit
+// CHECK-LP64: call ___cxa_atexit
diff --git a/test/CodeGenCXX/implicit-instantiation-1.cpp b/test/CodeGenCXX/implicit-instantiation-1.cpp
index f6c6114..cc86ef4 100644
--- a/test/CodeGenCXX/implicit-instantiation-1.cpp
+++ b/test/CodeGenCXX/implicit-instantiation-1.cpp
@@ -1,4 +1,4 @@
-// RUN: clang-cc -emit-llvm %s -o %t &&
+// RUN: clang-cc -emit-llvm %s -o %t
template<typename T>
struct X {
@@ -11,18 +11,17 @@ struct X {
};
void foo(X<int> &xi, X<float> *xfp, int i, float f) {
- // RUN: grep "linkonce_odr.*_ZN1XIiE1fEi" %t | count 1 &&
+ // RUN: grep "linkonce_odr.*_ZN1XIiE1fEi" %t | count 1
xi.f(i);
- // RUN: grep "linkonce_odr.*_ZN1XIiE1gEi" %t | count 1 &&
+ // RUN: grep "linkonce_odr.*_ZN1XIiE1gEi" %t | count 1
xi.g(f);
- // RUN: grep "linkonce_odr.*_ZN1XIfE1fEf" %t | count 1 &&
+ // RUN: grep "linkonce_odr.*_ZN1XIfE1fEf" %t | count 1
xfp->f(f);
- // RUN: grep "linkonce_odr.*_ZN1XIfE1hEf" %t | count 0 &&
+ // RUN: grep "linkonce_odr.*_ZN1XIfE1hEf" %t | count 0
- // RUN: true
}
diff --git a/test/CodeGenCXX/init-incomplete-type.cpp b/test/CodeGenCXX/init-incomplete-type.cpp
new file mode 100644
index 0000000..402b86e
--- /dev/null
+++ b/test/CodeGenCXX/init-incomplete-type.cpp
@@ -0,0 +1,12 @@
+// RUN: clang-cc %s -emit-llvm-only -verify
+// PR5489
+
+template<typename E>
+struct Bar {
+ int x_;
+};
+
+static struct Bar<int> bar[1] = {
+ { 0 }
+};
+
diff --git a/test/CodeGenCXX/instantiate-init-list.cpp b/test/CodeGenCXX/instantiate-init-list.cpp
new file mode 100644
index 0000000..7d5458a
--- /dev/null
+++ b/test/CodeGenCXX/instantiate-init-list.cpp
@@ -0,0 +1,13 @@
+// RUN: clang-cc %s -emit-llvm-only -verify
+
+struct F {
+ void (*x)();
+};
+void G();
+template<class T> class A {
+ A();
+};
+template<class T> A<T>::A() {
+ static F f = { G };
+}
+A<int> a;
diff --git a/test/CodeGenCXX/mangle-subst.cpp b/test/CodeGenCXX/mangle-subst.cpp
index 46a21b6..a940f4f 100644
--- a/test/CodeGenCXX/mangle-subst.cpp
+++ b/test/CodeGenCXX/mangle-subst.cpp
@@ -59,3 +59,11 @@ template void ft3<int>(S1<int>, S1<char>);
// CHECK: @_Z1fPKcS0_
void f(const char*, const char*) {}
+namespace NS {
+ class C;
+}
+
+namespace NS {
+ // CHECK: @_ZN2NS1fERNS_1CE
+ void f(C&) { }
+}
diff --git a/test/CodeGenCXX/mangle-system-header.cpp b/test/CodeGenCXX/mangle-system-header.cpp
new file mode 100644
index 0000000..8c642bd
--- /dev/null
+++ b/test/CodeGenCXX/mangle-system-header.cpp
@@ -0,0 +1,7 @@
+// RUN: clang-cc -emit-llvm %s -o - -triple=x86_64-apple-darwin9 | FileCheck %s
+
+// PR5420
+
+# 1 "fake_system_header.h" 1 3 4
+// CHECK: define void @_ZdlPvS_(
+void operator delete (void*, void*) {}
diff --git a/test/CodeGenCXX/mangle.cpp b/test/CodeGenCXX/mangle.cpp
index 2ffbae7..03e405e 100644
--- a/test/CodeGenCXX/mangle.cpp
+++ b/test/CodeGenCXX/mangle.cpp
@@ -221,3 +221,9 @@ struct S7 {
// CHECK: @"_ZN2S73$_0C1Ev"
S7::S7() {}
+// PR5063
+template<typename T> typename __enable_if<(__is_scalar<T>::__value), void>::__type ft8() { }
+// CHECK: @_Z3ft8IiEN11__enable_ifIXsr11__is_scalarIT_E7__valueEvE6__typeEv
+template void ft8<int>();
+// CHECK: @_Z3ft8IPvEN11__enable_ifIXsr11__is_scalarIT_E7__valueEvE6__typeEv
+template void ft8<void*>();
diff --git a/test/CodeGenCXX/member-expressions.cpp b/test/CodeGenCXX/member-expressions.cpp
new file mode 100644
index 0000000..f90b807
--- /dev/null
+++ b/test/CodeGenCXX/member-expressions.cpp
@@ -0,0 +1,19 @@
+// RUN: clang-cc -emit-llvm %s -o - -triple=x86_64-apple-darwin10 | FileCheck %s
+
+// PR5392
+namespace PR5392 {
+struct A
+{
+ static int a;
+};
+
+A a1;
+void f()
+{
+ // CHECK: store i32 10, i32* @_ZN6PR53921A1aE
+ a1.a = 10;
+ // CHECK: store i32 20, i32* @_ZN6PR53921A1aE
+ A().a = 20;
+}
+
+}
diff --git a/test/CodeGenCXX/member-function-pointers.cpp b/test/CodeGenCXX/member-function-pointers.cpp
index a7c2113..7792560 100644
--- a/test/CodeGenCXX/member-function-pointers.cpp
+++ b/test/CodeGenCXX/member-function-pointers.cpp
@@ -30,8 +30,8 @@ void f() {
// CHECK: volatile store i64 0, i64* getelementptr inbounds (%0* @vpa, i32 0, i32 1)
vpa = 0;
- // CHECK: store i64 %0, i64* getelementptr inbounds (%0* @pc, i32 0, i32 0)
- // CHECK: [[ADJ:%[a-zA-Z0-9\.]+]] = add i64 %1, 16
+ // CHECK: store i64 {{.*}}, i64* getelementptr inbounds (%0* @pc, i32 0, i32 0)
+ // CHECK: [[ADJ:%[a-zA-Z0-9\.]+]] = add i64 {{.*}}, 16
// CHECK: store i64 [[ADJ]], i64* getelementptr inbounds (%0* @pc, i32 0, i32 1)
pc = pa;
}
@@ -46,7 +46,7 @@ void f2() {
// CHECK: [[pa3ptr:%[a-zA-Z0-9\.]+]] = getelementptr inbounds %0* %pa3, i32 0, i32 0
// CHECK: store i64 1, i64* [[pa3ptr]]
// CHECK: [[pa3adj:%[a-zA-Z0-9\.]+]] = getelementptr inbounds %0* %pa3, i32 0, i32 1
- // CHECK: store i64 0, i64* [[pa2adj]]
+ // CHECK: store i64 0, i64* [[pa3adj]]
void (A::*pa3)() = &A::vf;
}
diff --git a/test/CodeGenCXX/member-functions.cpp b/test/CodeGenCXX/member-functions.cpp
index 29629d5..0dfaedf 100644
--- a/test/CodeGenCXX/member-functions.cpp
+++ b/test/CodeGenCXX/member-functions.cpp
@@ -1,43 +1,43 @@
-// RUN: clang-cc -emit-llvm %s -triple x86_64-apple-darwin9 -o %t &&
+// RUN: clang-cc -emit-llvm %s -triple x86_64-apple-darwin9 -o %t
struct C {
void f();
void g(int, ...);
};
-// RUN: grep "define void @_ZN1C1fEv" %t | count 1 &&
+// RUN: grep "define void @_ZN1C1fEv" %t | count 1
void C::f() {
}
void test1() {
C c;
-// RUN: grep "call void @_ZN1C1fEv" %t | count 1 &&
+// RUN: grep "call void @_ZN1C1fEv" %t | count 1
c.f();
-// RUN: grep "call void (.struct.C\*, i32, ...)\* @_ZN1C1gEiz" %t | count 1 &&
+// RUN: grep "call void (.struct.C\*, i32, ...)\* @_ZN1C1gEiz" %t | count 1
c.g(1, 2, 3);
}
struct S {
- // RUN: grep "define linkonce_odr void @_ZN1SC1Ev" %t &&
+ // RUN: grep "define linkonce_odr void @_ZN1SC1Ev" %t
inline S() { }
- // RUN: grep "define linkonce_odr void @_ZN1SC1Ev" %t &&
+ // RUN: grep "define linkonce_odr void @_ZN1SC1Ev" %t
inline ~S() { }
- // RUN: grep "define linkonce_odr void @_ZN1S9f_inline1Ev" %t &&
+ // RUN: grep "define linkonce_odr void @_ZN1S9f_inline1Ev" %t
void f_inline1() { }
- // RUN: grep "define linkonce_odr void @_ZN1S9f_inline2Ev" %t &&
+ // RUN: grep "define linkonce_odr void @_ZN1S9f_inline2Ev" %t
inline void f_inline2() { }
- // RUN: grep "define linkonce_odr void @_ZN1S1gEv" %t &&
+ // RUN: grep "define linkonce_odr void @_ZN1S1gEv" %t
static void g() { }
static void f();
};
-// RUN: grep "define void @_ZN1S1fEv" %t &&
+// RUN: grep "define void @_ZN1S1fEv" %t
void S::f() {
}
diff --git a/test/CodeGenCXX/member-init-struct.cpp b/test/CodeGenCXX/member-init-struct.cpp
new file mode 100644
index 0000000..9c0c391
--- /dev/null
+++ b/test/CodeGenCXX/member-init-struct.cpp
@@ -0,0 +1,18 @@
+// RUN: clang-cc %s -emit-llvm-only -verify
+
+struct A {int a;};
+struct B {float a;};
+struct C {
+ union {
+ A a;
+ B b[10];
+ };
+ _Complex float c;
+ int d[10];
+ void (C::*e)();
+ C() : a(), c(), d(), e() {}
+ C(A x) : a(x) {}
+ C(void (C::*x)(), int y) : b(), c(y), e(x) {}
+};
+A x;
+C a, b(x), c(0, 2);
diff --git a/test/CodeGenCXX/member-init-union.cpp b/test/CodeGenCXX/member-init-union.cpp
new file mode 100644
index 0000000..334d5fd
--- /dev/null
+++ b/test/CodeGenCXX/member-init-union.cpp
@@ -0,0 +1,10 @@
+// RUN: clang-cc %s -emit-llvm-only -verify
+
+union x {
+ int a;
+ float b;
+ x(float y) : b(y) {}
+ x(int y) : a(y) {}
+};
+x a(1), b(1.0f);
+
diff --git a/test/CodeGenCXX/member-pointers-zero-init.cpp b/test/CodeGenCXX/member-pointers-zero-init.cpp
index e7b0fda..caf31bd 100644
--- a/test/CodeGenCXX/member-pointers-zero-init.cpp
+++ b/test/CodeGenCXX/member-pointers-zero-init.cpp
@@ -1,30 +1,30 @@
-// RUN: clang-cc -emit-llvm %s -o %t -triple=x86_64-apple-darwin9 &&
+// RUN: clang-cc -emit-llvm %s -o %t -triple=x86_64-apple-darwin9
struct A {
int i;
};
-// RUN: grep "@a = global i64 -1" %t &&
+// RUN: grep "@a = global i64 -1" %t
int A::* a;
-// RUN: grep "@aa = global \[2 x i64\] \[i64 -1, i64 -1\]" %t &&
+// RUN: grep "@aa = global \[2 x i64\] \[i64 -1, i64 -1\]" %t
int A::* aa[2];
-// RUN: grep "@aaa = global \[2 x \[2 x i64\]\] \[\[2 x i64\] \[i64 -1, i64 -1\], \[2 x i64\] \[i64 -1, i64 -1\]\]" %t &&
+// RUN: grep "@aaa = global \[2 x \[2 x i64\]\] \[\[2 x i64\] \[i64 -1, i64 -1\], \[2 x i64\] \[i64 -1, i64 -1\]\]" %t
int A::* aaa[2][2];
-// RUN: grep "@b = global i64 -1" %t &&
+// RUN: grep "@b = global i64 -1" %t
int A::* b = 0;
void f() {
- // RUN: grep "%.* = icmp ne i64 %.*, -1" %t | count 2 &&
+ // RUN: grep "%.* = icmp ne i64 %.*, -1" %t | count 2
if (a) { }
if (a != 0) { }
- // RUN: grep "%.* = icmp ne i64 -1, %.*" %t | count 1 &&
+ // RUN: grep "%.* = icmp ne i64 -1, %.*" %t | count 1
if (0 != a) { }
- // RUN: grep "%.* = icmp eq i64 %.*, -1" %t | count 1 &&
+ // RUN: grep "%.* = icmp eq i64 %.*, -1" %t | count 1
if (a == 0) { }
// RUN: grep "%.* = icmp eq i64 -1, %.*" %t | count 1
diff --git a/test/CodeGenCXX/new-operator-phi.cpp b/test/CodeGenCXX/new-operator-phi.cpp
new file mode 100644
index 0000000..a5eed28
--- /dev/null
+++ b/test/CodeGenCXX/new-operator-phi.cpp
@@ -0,0 +1,11 @@
+// RUN: clang-cc -emit-llvm-only -verify %s
+// PR5454
+#include <stddef.h>
+
+class X {static void * operator new(size_t size) throw(); X(int); };
+int a(), b();
+void b(int x)
+{
+ new X(x ? a() : b());
+}
+
diff --git a/test/CodeGenCXX/new.cpp b/test/CodeGenCXX/new.cpp
index c6cee18..3f191de 100644
--- a/test/CodeGenCXX/new.cpp
+++ b/test/CodeGenCXX/new.cpp
@@ -1,11 +1,12 @@
// RUN: clang-cc %s -emit-llvm -o - | FileCheck %s
+#include <stddef.h>
void t1() {
int* a = new int;
}
// Placement.
-void* operator new(unsigned long, void*) throw();
+void* operator new(size_t, void*) throw();
void t2(int* a) {
int* b = new (a) int;
diff --git a/test/CodeGenCXX/ptr-to-member-function.cpp b/test/CodeGenCXX/ptr-to-member-function.cpp
index 1501908..52190b9 100644
--- a/test/CodeGenCXX/ptr-to-member-function.cpp
+++ b/test/CodeGenCXX/ptr-to-member-function.cpp
@@ -1,8 +1,7 @@
-// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s &&
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s &&
-// RUN: clang-cc -triple i386-apple-darwin -std=c++0x -S %s -o %t-32.s &&
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s &&
-// RUN: true
+// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s
+// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: clang-cc -triple i386-apple-darwin -std=c++0x -S %s -o %t-32.s
+// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
// 13.3.3.2 Ranking implicit conversion sequences
extern "C" int printf(...);
diff --git a/test/CodeGenCXX/reinterpret-cast.cpp b/test/CodeGenCXX/reinterpret-cast.cpp
index ae3ab2f..58a980d 100644
--- a/test/CodeGenCXX/reinterpret-cast.cpp
+++ b/test/CodeGenCXX/reinterpret-cast.cpp
@@ -9,4 +9,9 @@ unsigned long f2() {
unsigned long f3(void *p) {
return reinterpret_cast<unsigned long>(p);
+}
+
+void f4(int*&);
+void f5(void*& u) {
+ f4(reinterpret_cast<int*&>(u));
} \ No newline at end of file
diff --git a/test/CodeGenCXX/rtti.cpp b/test/CodeGenCXX/rtti.cpp
new file mode 100644
index 0000000..a1ff1ff
--- /dev/null
+++ b/test/CodeGenCXX/rtti.cpp
@@ -0,0 +1,207 @@
+// RUN: clang-cc -I%S -triple x86_64-apple-darwin -std=c++0x -O0 -S %s -o %t.s
+// RUN: FileCheck --input-file=%t.s %s
+
+// RUN: clang-cc -I%S -triple x86_64-apple-darwin -std=c++0x -emit-llvm %s -o %t.ll
+// RUN: FileCheck -check-prefix LL --input-file=%t.ll %s
+
+#include <typeinfo>
+
+class test1_B1 {
+ virtual void foo() { }
+};
+class test1_B2 : public test1_B1 {
+ virtual void foo() { }
+};
+class test1_B3 : public test1_B2, public test1_B1 {
+ virtual void foo() { }
+};
+class test1_B4 : virtual public test1_B3 {
+ virtual void foo() { }
+};
+class test1_B5 : virtual test1_B3, test1_B4 {
+ virtual void foo() { }
+};
+class test1_B6 {
+ virtual void foo() { }
+};
+class test1_B7 : public test1_B6, public test1_B5 {
+ virtual void foo() { }
+};
+class test1_D : public test1_B7 {
+ virtual void foo() { }
+} d1;
+
+// CHECK: __ZTSPVi:
+// CHECK-NEXT: .asciz "PVi"
+
+// CHECK: __ZTIPVi:
+// CHECK-NEXT: .quad (__ZTVN10__cxxabiv119__pointer_type_infoE) + 16
+// CHECK-NEXT: .quad __ZTSPVi
+// CHECK-NEXT: .long 2
+// CHECK-NEXT: .space 4
+// CHECK-NEXT: .quad __ZTIi
+
+// CHECK: .globl __ZTS7test3_A
+// CHECK-NEXT: .weak_definition __ZTS7test3_A
+// CHECK: __ZTS7test3_A:
+// CHECK-NEXT: .asciz "7test3_A"
+
+// CHECK: __ZTIM7test3_Ai:
+// CHECK-NEXT: .quad (__ZTVN10__cxxabiv129__pointer_to_member_type_infoE) + 16
+// CHECK-NEXT: .quad __ZTSM7test3_Ai
+// CHECK-NEXT: .space 4
+// CHECK-NEXT: .space 4
+// CHECK-NEXT: .quad __ZTIi
+// CHECK-NEXT: .quad __ZTI7test3_A
+
+// CHECK: __ZTIM7test3_Ii:
+// CHECK-NEXT: .quad (__ZTVN10__cxxabiv129__pointer_to_member_type_infoE) + 16
+// CHECK-NEXT: .quad __ZTSM7test3_Ii
+// CHECK-NEXT: .long 16
+// CHECK-NEXT: .space 4
+// CHECK-NEXT: .quad __ZTIi
+// CHECK-NEXT: .quad __ZTI7test3_I
+
+// CHECK: .private_extern __ZTIFvvE
+// CHECK: .globl __ZTIFvvE
+// CHECK: .weak_definition __ZTIFvvE
+// CHECK: __ZTIFvvE:
+// CHECK-NEXT: .quad (__ZTVN10__cxxabiv120__function_type_infoE) + 16
+// CHECK-NEXT: .quad __ZTSFvvE
+
+// CHECK: __ZTIM7test3_AFvvE:
+// CHECK-NEXT: .quad (__ZTVN10__cxxabiv129__pointer_to_member_type_infoE) + 16
+// CHECK-NEXT: .quad __ZTSM7test3_AFvvE
+// CHECK-NEXT: .space 4
+// CHECK-NEXT: .space 4
+// CHECK-NEXT: .quad __ZTIFvvE
+// CHECK-NEXT: .quad __ZTI7test3_A
+
+
+
+// CHECK:__ZTI7test1_D:
+// CHECK-NEXT: .quad (__ZTVN10__cxxabiv120__si_class_type_infoE) + 16
+// CHECK-NEXT: .quad __ZTS7test1_D
+// CHECK-NEXT: .quad __ZTI8test1_B7
+
+// CHECK:__ZTI8test1_B7:
+// CHECK-NEXT: .quad (__ZTVN10__cxxabiv121__vmi_class_type_infoE) + 16
+// CHECK-NEXT: .quad __ZTS8test1_B7
+// CHECK-NEXT: .long 3
+// CHECK-NEXT: .long 2
+// CHECK-NEXT: .quad __ZTI8test1_B6
+// CHECK-NEXT: .quad 2
+// CHECK-NEXT: .quad __ZTI8test1_B5
+// CHECK-NEXT: .quad 2050
+
+// CHECK:__ZTI8test1_B5:
+// CHECK-NEXT: .quad (__ZTVN10__cxxabiv121__vmi_class_type_infoE) + 16
+// CHECK-NEXT: .quad __ZTS8test1_B5
+// CHECK-NEXT: .long 3
+// CHECK-NEXT: .long 2
+// CHECK-NEXT: .quad __ZTI8test1_B3
+// CHECK-NEXT: .quad 18446744073709545473
+// CHECK-NEXT: .quad __ZTI8test1_B4
+// CHECK-NEXT: .space 8
+
+// CHECK:__ZTI8test1_B4:
+// CHECK-NEXT: .quad (__ZTVN10__cxxabiv121__vmi_class_type_infoE) + 16
+// CHECK-NEXT: .quad __ZTS8test1_B4
+// CHECK-NEXT: .long 1
+// CHECK-NEXT: .long 1
+// CHECK-NEXT: .quad __ZTI8test1_B3
+// CHECK-NEXT: .quad 18446744073709545475
+
+// CHECK:__ZTI8test1_B6:
+// CHECK-NEXT: .quad (__ZTVN10__cxxabiv117__class_type_infoE) + 16
+// CHECK-NEXT: .quad __ZTS8test1_B6
+
+// CHECK:__ZTI8test1_B3:
+// CHECK-NEXT: .quad (__ZTVN10__cxxabiv121__vmi_class_type_infoE) + 16
+// CHECK-NEXT: .quad __ZTS8test1_B3
+// CHECK-NEXT: .long 1
+// CHECK-NEXT: .long 2
+// CHECK-NEXT: .quad __ZTI8test1_B2
+// CHECK-NEXT: .quad 2
+// CHECK-NEXT: .quad __ZTI8test1_B1
+// CHECK-NEXT: .quad 2050
+
+// CHECK:__ZTS8test1_B1:
+// CHECK-NEXT: .asciz "8test1_B1"
+
+// CHECK:__ZTI8test1_B1:
+// CHECK-NEXT: .quad (__ZTVN10__cxxabiv117__class_type_infoE) + 16
+// CHECK-NEXT:. quad __ZTS8test1_B1
+
+// CHECK:__ZTS8test1_B2:
+// CHECK-NEXT: .asciz "8test1_B2"
+
+// CHECK:__ZTI8test1_B2:
+// CHECK-NEXT: .quad (__ZTVN10__cxxabiv120__si_class_type_infoE) + 16
+// CHECK-NEXT: .quad __ZTS8test1_B2
+// CHECK-NEXT: .quad __ZTI8test1_B1
+
+
+class NP { };
+void test2_1();
+void test2_2(test1_D *dp) {
+ test1_D &d = *dp;
+ if (typeid(d) == typeid(test1_D))
+ test2_1();
+ if (typeid(NP) == typeid(test1_D))
+ test2_1();
+ if (typeid(((*(dp)))) == typeid(test1_D))
+ test2_1();
+ if (typeid(int) == typeid(float))
+ test2_1();
+ if (typeid(int*) == typeid(const int *))
+ test2_1();
+}
+
+// CHECK-LL:define void @_Z7test2_2P7test1_D(%class.test1_B7* %dp) nounwind {
+// CHECK-LL: %tmp1 = load %class.test1_B7** %d
+// CHECK-LL-NEXT: %0 = bitcast %class.test1_B7* %tmp1 to %"class.std::type_info"***
+// CHECK-LL-NEXT: %vtable = load %"class.std::type_info"*** %0
+// CHECK-LL-NEXT: %1 = getelementptr inbounds %"class.std::type_info"** %vtable, i64 -1
+// CHECK-LL-NEXT: %2 = load %"class.std::type_info"** %1
+// CHECK-LL-NEXT: %call = call zeroext i1 @_ZNKSt9type_infoeqERKS_(%"class.std::type_info"* %2, %"class.std::type_info"* bitcast (%{{[0-9]*}}* @_ZTI7test1_D to %"class.std::type_info"*))
+
+// CHECK-LL: %call2 = call zeroext i1 @_ZNKSt9type_infoeqERKS_(%"class.std::type_info"* bitcast (%0* @_ZTI2NP to %"class.std::type_info"*), %"class.std::type_info"* bitcast (%{{[0-9]*}}* @_ZTI7test1_D to %"class.std::type_info"*))
+
+// CHECK-LL: %3 = bitcast %class.test1_B7* %tmp5 to %"class.std::type_info"***
+// CHECK-LL-NEXT: %4 = icmp ne %"class.std::type_info"*** %3, null
+// CHECK-LL-NEXT: br i1 %4, label %6, label %5
+// CHECK-LL: ; <label>:5
+// CHECK-LL-NEXT: call void @__cxa_bad_typeid()
+// CHECK-LL-NEXT: unreachable
+// CHECK-LL: ; <label>:6
+// CHECK-LL-NEXT: %vtable6 = load %"class.std::type_info"*** %3
+// CHECK-LL-NEXT: %7 = getelementptr inbounds %"class.std::type_info"** %vtable6, i64 -1
+// CHECK-LL-NEXT: %8 = load %"class.std::type_info"** %7
+// CHECK-LL-NEXT: %call7 = call zeroext i1 @_ZNKSt9type_infoeqERKS_(%"class.std::type_info"* %8, %"class.std::type_info"* bitcast (%{{[0-9]*}}* @_ZTI7test1_D to %"class.std::type_info"*))
+
+// CHECK-LL: %call10 = call zeroext i1 @_ZNKSt9type_infoeqERKS_(%"class.std::type_info"* bitcast (i8** @_ZTIi to %"class.std::type_info"*), %"class.std::type_info"* bitcast (i8** @_ZTIf to %"class.std::type_info"*))
+
+// CHECK-LL: %call13 = call zeroext i1 @_ZNKSt9type_infoeqERKS_(%"class.std::type_info"* bitcast (i8** @_ZTIPi to %"class.std::type_info"*), %"class.std::type_info"* bitcast (i8** @_ZTIPKi to %"class.std::type_info"*))
+
+class test3_A { };
+class test3_I;
+int (test3_A::*pmd);
+int (test3_I::*i_pmd);
+void (test3_A::*pmf)();
+int test3() {
+ if (typeid(volatile int *) == typeid(int *))
+ return 1;
+ if (typeid(pmd) == typeid(i_pmd))
+ return 1;
+ if (typeid(pmd) == typeid(pmf))
+ return 1;
+ return 0;
+ enum a { };
+ if (typeid(int[5]) == typeid(enum a))
+ return 0;
+}
+
+bool test4(std::type_info* __pointee) {
+ return *__pointee == typeid (void);
+}
diff --git a/test/CodeGenCXX/static-init-1.cpp b/test/CodeGenCXX/static-init-1.cpp
new file mode 100644
index 0000000..2c45202
--- /dev/null
+++ b/test/CodeGenCXX/static-init-1.cpp
@@ -0,0 +1,23 @@
+// RUN: clang-cc -triple=x86_64-apple-darwin9 -emit-llvm %s -o %t
+// RUN: grep "call i32 @_Z5func1i" %t | count 3
+
+extern "C" int printf(...);
+
+static int count;
+
+int func2(int c) { return printf("loading the func2(%d)\n", c); };
+int func1(int c) { return printf("loading the func1(%d)\n", c); }
+
+static int loader_1 = func1(++count);
+
+int loader_2 = func2(++count);
+
+static int loader_3 = func1(++count);
+
+
+int main() {}
+
+int loader_4 = func2(++count);
+static int loader_5 = func1(++count);
+int loader_6 = func2(++count);
+
diff --git a/test/CodeGenCXX/static-init-2.cpp b/test/CodeGenCXX/static-init-2.cpp
new file mode 100644
index 0000000..e229dd4
--- /dev/null
+++ b/test/CodeGenCXX/static-init-2.cpp
@@ -0,0 +1,6 @@
+// RUN: clang-cc -emit-llvm-only -verify %s
+
+// Make sure we don't crash generating y; its value is constant, but the
+// initializer has side effects, so EmitConstantExpr should fail.
+int x();
+int y = x() && 0;
diff --git a/test/CodeGenCXX/static-init.cpp b/test/CodeGenCXX/static-init.cpp
index 44dd142..55877b2 100644
--- a/test/CodeGenCXX/static-init.cpp
+++ b/test/CodeGenCXX/static-init.cpp
@@ -1,5 +1,5 @@
-// RUN: clang-cc -triple=x86_64-apple-darwin9 -emit-llvm %s -o %t &&
-// RUN: grep "call void @_ZN1AC1Ev" %t | count 1 &&
+// RUN: clang-cc -triple=x86_64-apple-darwin9 -emit-llvm %s -o %t
+// RUN: grep "call void @_ZN1AC1Ev" %t | count 1
// RUN: grep "call i32 @__cxa_atexit(void (i8\*)\* bitcast (void (%.truct.A\*)\* @_ZN1AD1Ev to void (i8\*)\*), i8\* getelementptr inbounds (%.truct.A\* @_ZZ1fvE1a, i32 0, i32 0), i8\* bitcast (i8\*\* @__dso_handle to i8\*))" %t | count 1
struct A {
diff --git a/test/CodeGenCXX/temporaries.cpp b/test/CodeGenCXX/temporaries.cpp
index e9ed0f7..e550274 100644
--- a/test/CodeGenCXX/temporaries.cpp
+++ b/test/CodeGenCXX/temporaries.cpp
@@ -115,3 +115,90 @@ void f7() {
// CHECK: call void @_ZN1GD1Ev
a(G());
}
+
+namespace PR5077 {
+
+struct A {
+ A();
+ ~A();
+ int f();
+};
+
+void f();
+int g(const A&);
+
+struct B {
+ int a1;
+ int a2;
+ B();
+ ~B();
+};
+
+B::B()
+ // CHECK: call void @_ZN6PR50771AC1Ev
+ // CHECK: call i32 @_ZN6PR50771A1fEv
+ // CHECK: call void @_ZN6PR50771AD1Ev
+ : a1(A().f())
+ // CHECK: call void @_ZN6PR50771AC1Ev
+ // CHECK: call i32 @_ZN6PR50771gERKNS_1AE
+ // CHECK: call void @_ZN6PR50771AD1Ev
+ , a2(g(A()))
+{
+ // CHECK: call void @_ZN6PR50771fEv
+ f();
+}
+
+struct C {
+ C();
+
+ const B& b;
+};
+
+C::C()
+ // CHECK: call void @_ZN6PR50771BC1Ev
+ : b(B()) {
+ // CHECK: call void @_ZN6PR50771fEv
+ f();
+
+ // CHECK: call void @_ZN6PR50771BD1Ev
+}
+}
+
+A f8() {
+ // CHECK: call void @_ZN1AC1Ev
+ // CHECK-NOT: call void @_ZN1AD1Ev
+ return A();
+ // CHECK: ret void
+}
+
+struct H {
+ H();
+ ~H();
+ H(const H&);
+};
+
+void f9(H h) {
+ // CHECK: call void @_ZN1HC1Ev
+ // CHECK: call void @_Z2f91H
+ // CHECK: call void @_ZN1HD1Ev
+ f9(H());
+
+ // CHECK: call void @_ZN1HC1ERKS_
+ // CHECK: call void @_Z2f91H
+ // CHECK: call void @_ZN1HD1Ev
+ f9(h);
+}
+
+void f10(const H&);
+
+void f11(H h) {
+ // CHECK: call void @_ZN1HC1Ev
+ // CHECK: call void @_Z3f10RK1H
+ // CHECK: call void @_ZN1HD1Ev
+ f10(H());
+
+ // CHECK: call void @_Z3f10RK1H
+ // CHECK-NOT: call void @_ZN1HD1Ev
+ // CHECK: ret void
+ f10(h);
+} \ No newline at end of file
diff --git a/test/CodeGenCXX/trivial-constructor-init.cpp b/test/CodeGenCXX/trivial-constructor-init.cpp
index 183b31a..90d6e65 100644
--- a/test/CodeGenCXX/trivial-constructor-init.cpp
+++ b/test/CodeGenCXX/trivial-constructor-init.cpp
@@ -1,6 +1,5 @@
-// RUN: clang-cc -S %s -o %t-64.s &&
-// RUN: clang-cc -S %s -o %t-32.s &&
-// RUN: true
+// RUN: clang-cc -S %s -o %t-64.s
+// RUN: clang-cc -S %s -o %t-32.s
extern "C" int printf(...);
diff --git a/test/CodeGenCXX/typeinfo b/test/CodeGenCXX/typeinfo
new file mode 100644
index 0000000..7af23cf1
--- /dev/null
+++ b/test/CodeGenCXX/typeinfo
@@ -0,0 +1,16 @@
+namespace std {
+ class type_info {
+ public:
+ virtual ~type_info();
+ const char* name() const { return __name; }
+ bool operator==(const type_info& __arg) const {
+ return __name == __arg.__name;
+ }
+
+ bool operator!=(const type_info& __arg) const {
+ return !operator==(__arg);
+ }
+ protected:
+ const char *__name;
+ };
+}
diff --git a/test/CodeGenCXX/vararg-conversion-ctor.cpp b/test/CodeGenCXX/vararg-conversion-ctor.cpp
new file mode 100644
index 0000000..1306abf
--- /dev/null
+++ b/test/CodeGenCXX/vararg-conversion-ctor.cpp
@@ -0,0 +1,23 @@
+// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -emit-llvm %s -o %t-64.ll
+// RUN: FileCheck -check-prefix LPLL64 --input-file=%t-64.ll %s
+
+extern "C" int printf(...);
+
+struct A {
+ A(...) {
+ printf("A::A(...)\n");
+ }
+};
+
+A a(1.34);
+
+A b = 2.34;
+
+int main()
+{
+ A c[3];
+}
+
+// CHECK-LPLL64: call void (%struct.A*, ...)
+// CHECK-LPLL64: call void (%struct.A*, ...)
+// CHECK-LPLL64: call void (%struct.A*, ...)
diff --git a/test/CodeGenCXX/virt-dtor-gen.cpp b/test/CodeGenCXX/virt-dtor-gen.cpp
new file mode 100644
index 0000000..704d735
--- /dev/null
+++ b/test/CodeGenCXX/virt-dtor-gen.cpp
@@ -0,0 +1,10 @@
+// RUN: clang-cc -o - -emit-llvm %s | FileCheck %s
+// PR5483
+
+// Make sure we generate all three forms of the destructor when it is virtual.
+class Foo {
+ virtual ~Foo();
+};
+Foo::~Foo() {}
+
+// CHECK: define void @_ZN3FooD0Ev
diff --git a/test/CodeGenCXX/virt.cpp b/test/CodeGenCXX/virt.cpp
index 193a96d..b453ed5 100644
--- a/test/CodeGenCXX/virt.cpp
+++ b/test/CodeGenCXX/virt.cpp
@@ -1,14 +1,8 @@
-// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -O0 -S %s -o %t-64.s &&
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s &&
-// RUN: clang-cc -triple i386-apple-darwin -std=c++0x -O0 -S %s -o %t-32.s &&
-// RUN: FileCheck -check-prefix LP32 -input-file=%t-32.s %s &&
+// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -O0 -S %s -o %t-64.s
+// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
-// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -O3 -S %s -o %t-O3-64.s &&
-// RUN: FileCheck -check-prefix LPOPT64 --input-file=%t-O3-64.s %s &&
-// RUN: clang-cc -triple i386-apple-darwin -std=c++0x -O3 -S %s -o %t-O3-32.s &&
-// RUN: FileCheck -check-prefix LPOPT32 -input-file=%t-O3-32.s %s &&
-
-// RUN: true
+// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -emit-llvm %s -o %t-64.ll
+// RUN: FileCheck -check-prefix LPLL64 --input-file=%t-64.ll %s
struct B {
virtual void bar1();
@@ -56,8 +50,8 @@ void test2() {
j = sz;
// FIXME: These should result in a frontend constant a la fold, no run time
// initializer
- // CHECK-LPOPT32: movl $4, __ZZ5test2vE2sz
- // CHECK-LPOPT64: movl $8, __ZZ5test2vE2sz(%rip)
+ // CHECK-LPLL64: define void @_Z5test2v()
+ // CHECK-LPLL64: = getelementptr inbounds %class.F* %f, i32 0, i32 1
}
static_assert(sizeof(F) == sizeof(void*)*4, "invalid vbase size");
@@ -85,10 +79,6 @@ int main() {
ap->b = 2;
}
-// CHECK-LP32: main:
-// CHECK-LP32: movl $1, 8(%eax)
-// CHECK-LP32: movl $2, 4(%eax)
-
// CHECK-LP64: main:
// CHECK-LP64: movl $1, 12(%rax)
// CHECK-LP64: movl $2, 8(%rax)
@@ -114,56 +104,14 @@ void test12_foo() {
test12_pa->test12_A::foo();
}
-// CHECK-LPOPT32:__Z10test12_foov:
-// CHECK-LPOPT32: movl _test12_pa, %eax
-// CHECK-LPOPT32-NEXT: movl (%eax), %ecx
-// CHECK-LPOPT32-NEXT: movl %eax, (%esp)
-// CHECK-LPOPT32-NEXT: call *(%ecx)
-// CHECK-LPOPT32-NEXT: movl _test12_pb, %eax
-// CHECK-LPOPT32-NEXT: movl (%eax), %ecx
-// CHECK-LPOPT32-NEXT: movl %eax, (%esp)
-// CHECK-LPOPT32-NEXT: call *(%ecx)
-// CHECK-LPOPT32-NEXT: movl _test12_pd, %eax
-// CHECK-LPOPT32-NEXT: movl (%eax), %ecx
-// CHECK-LPOPT32-NEXT: movl %eax, (%esp)
-// CHECK-LPOPT32-NEXT: call *(%ecx)
-// CHECK-LPOPT32-NEXT: movl _test12_pa, %eax
-// CHECK-LPOPT32-NEXT: movl (%eax), %ecx
-// CHECK-LPOPT32-NEXT: movl %eax, (%esp)
-// CHECK-LPOPT32-NEXT: call *4(%ecx)
-// CHECK-LPOPT32-NEXT: movl _test12_pb, %eax
-// CHECK-LPOPT32-NEXT: movl (%eax), %ecx
-// CHECK-LPOPT32-NEXT: movl %eax, (%esp)
-// CHECK-LPOPT32-NEXT: call *4(%ecx)
-// CHECK-LPOPT32-NEXT: movl _test12_pd, %eax
-// CHECK-LPOPT32-NEXT: movl (%eax), %ecx
-// CHECK-LPOPT32-NEXT: movl %eax, (%esp)
-// CHECK-LPOPT32-NEXT: call *4(%ecx)
-// CHECK-LPOPT32-NEXT: movl _test12_pa, %eax
-// CHECK-LPOPT32-NEXT: movl %eax, (%esp)
-// CHECK-LPOPT32-NEXT: call L__ZN8test12_A3fooEv$stub
-
-// CHECK-LPOPT64:__Z10test12_foov:
-// CHECK-LPOPT64: movq _test12_pa(%rip), %rdi
-// CHECK-LPOPT64-NEXT: movq (%rdi), %rax
-// CHECK-LPOPT64-NEXT: call *(%rax)
-// CHECK-LPOPT64-NEXT: movq _test12_pb(%rip), %rdi
-// CHECK-LPOPT64-NEXT: movq (%rdi), %rax
-// CHECK-LPOPT64-NEXT: call *(%rax)
-// CHECK-LPOPT64-NEXT: movq _test12_pd(%rip), %rdi
-// CHECK-LPOPT64-NEXT: movq (%rdi), %rax
-// CHECK-LPOPT64-NEXT: call *(%rax)
-// CHECK-LPOPT64-NEXT: movq _test12_pa(%rip), %rdi
-// CHECK-LPOPT64-NEXT: movq (%rdi), %rax
-// CHECK-LPOPT64-NEXT: call *8(%rax)
-// CHECK-LPOPT64-NEXT: movq _test12_pb(%rip), %rdi
-// CHECK-LPOPT64-NEXT: movq (%rdi), %rax
-// CHECK-LPOPT64-NEXT: call *8(%rax)
-// CHECK-LPOPT64-NEXT: movq _test12_pd(%rip), %rdi
-// CHECK-LPOPT64-NEXT: movq (%rdi), %rax
-// CHECK-LPOPT64-NEXT: call *8(%rax)
-// CHECK-LPOPT64-NEXT: movq _test12_pa(%rip), %rdi
-// CHECK-LPOPT64-NEXT: call __ZN8test12_A3fooEv
+// CHECK-LPLL64:define void @_Z10test12_foov() nounwind {
+// CHECK-LPLL64: call void %2(%class.test14* %tmp)
+// CHECK-LPLL64: call void %5(%class.test14* %tmp1)
+// CHECK-LPLL64: call void %8(%class.test14* %tmp3)
+// CHECK-LPLL64: call void %11(%class.test14* %tmp5)
+// CHECK-LPLL64: call void %14(%class.test14* %tmp7)
+// CHECK-LPLL64: call void %17(%class.test14* %tmp9)
+// CHECK-LPLL64: call void @_ZN8test12_A3fooEv(%class.test14* %tmp11)
struct test6_B2 { virtual void funcB2(); char b[1000]; };
@@ -172,7 +120,6 @@ struct test6_B1 : virtual test6_B2 { virtual void funcB1(); };
struct test6_D : test6_B2, virtual test6_B1 {
};
-// CHECK-LP32: .zerofill __DATA, __common, _d6, 2012, 4
// CHECK-LP64: .zerofill __DATA, __common, _d6, 2024, 4
struct test7_B2 { virtual void funcB2(); };
@@ -181,7 +128,6 @@ struct test7_B1 : virtual test7_B2 { virtual void funcB1(); };
struct test7_D : test7_B2, virtual test7_B1 {
};
-// CHECK-LP32: .zerofill __DATA, __common, _d7, 8, 3
// CHECK-LP64: .zerofill __DATA, __common, _d7, 16, 3
@@ -193,20 +139,6 @@ struct test3_D : virtual test3_B1 {
virtual void funcD() { }
};
-// CHECK-LP32:__ZTV7test3_D:
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long __ZTI7test3_D
-// CHECK-LP32-NEXT: .long __ZN8test3_B36funcB3Ev
-// CHECK-LP32-NEXT: .long __ZN8test3_B26funcB2Ev
-// CHECK-LP32-NEXT: .long __ZN8test3_B16funcB1Ev
-// CHECK-LP32-NEXT: .long __ZN7test3_D5funcDEv
-
// CHECK-LP64:__ZTV7test3_D:
// CHECK-LP64-NEXT: .space 8
// CHECK-LP64-NEXT: .space 8
@@ -224,22 +156,6 @@ struct test3_D : virtual test3_B1 {
struct test4_D : virtual B, virtual C {
};
-// CHECK-LP32:__ZTV7test4_D:
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long __ZTI7test4_D
-// CHECK-LP32-NEXT: .long __ZN1C4bee1Ev
-// CHECK-LP32-NEXT: .long __ZN1C4bee2Ev
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 4294967292
-// CHECK-LP32-NEXT: .long __ZTI7test4_D
-// CHECK-LP32-NEXT: .long __ZN1B4bar1Ev
-// CHECK-LP32-NEXT: .long __ZN1B4bar2Ev
-
// CHECK-LP64:__ZTV7test4_D:
// CHECK-LP64-NEXT: .space 8
// CHECK-LP64-NEXT: .quad 8
@@ -277,58 +193,6 @@ struct test5_D : virtual test5_B1, virtual test5_B21, virtual test5_B31 {
virtual void funcD() { }
};
-// CHECK-LP32:__ZTV7test5_D:
-// CHECK-LP32-NEXT: .long 16
-// CHECK-LP32-NEXT: .long 12
-// CHECK-LP32-NEXT: .long 8
-// CHECK-LP32-NEXT: .long 8
-// CHECK-LP32-NEXT: .long 8
-// CHECK-LP32-NEXT: .long 4
-// CHECK-LP32-NEXT: .long 4
-// CHECK-LP32-NEXT: .long 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long __ZTI7test5_D
-// CHECK-LP32-NEXT: .long __ZN8test5_B36funcB3Ev
-// CHECK-LP32-NEXT: .long __ZN8test5_B26funcB2Ev
-// CHECK-LP32-NEXT: .long __ZN8test5_B16funcB1Ev
-// CHECK-LP32-NEXT: .long __ZN7test5_D5funcDEv
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 4294967292
-// CHECK-LP32-NEXT: .long __ZTI7test5_D
-// CHECK-LP32-NEXT: .long __ZN9test5_B237funcB23Ev
-// CHECK-LP32-NEXT: .long __ZN9test5_B227funcB22Ev
-// CHECK-LP32-NEXT: .long __ZN9test5_B217funcB21Ev
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 8
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 4294967288
-// CHECK-LP32-NEXT: .long __ZTI7test5_D
-// CHECK-LP32-NEXT: .long __ZN9test5_B337funcB33Ev
-// CHECK-LP32-NEXT: .long __ZN9test5_B327funcB32Ev
-// CHECK-LP32-NEXT: .long __ZN9test5_B317funcB31Ev
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 4294967284
-// CHECK-LP32-NEXT: .long __ZTI7test5_D
-// CHECK-LP32-NEXT: .long __ZN4B2328funcB232Ev
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 4294967280
-// CHECK-LP32-NEXT: .long __ZTI7test5_D
-// CHECK-LP32-NEXT: .long __ZN4B2318funcB231Ev
-
// CHECK-LP64:__ZTV7test5_D:
// CHECK-LP64-NEXT: .quad 32
// CHECK-LP64-NEXT: .quad 24
@@ -407,33 +271,6 @@ struct test8_B3 {
class test8_D : test8_B1, test8_B2, test8_B3 {
};
-// CHECK-LP32:__ZTV7test8_D:
-// CHECK-LP32-NEXT: .long 24
-// CHECK-LP32-NEXT: .long 16
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long __ZTI7test8_D
-// CHECK-LP32-NEXT: .long __ZN8test8_B19ftest8_B1Ev
-// CHECK-LP32-NEXT: .long 20
-// CHECK-LP32-NEXT: .long 12
-// CHECK-LP32-NEXT: .long 4294967292
-// CHECK-LP32-NEXT: .long __ZTI7test8_D
-// CHECK-LP32-NEXT: .long __ZN9test8_B2a10ftest8_B2aEv
-// CHECK-LP32-NEXT: .long __ZN8test8_B29ftest8_B2Ev
-// CHECK-LP32-NEXT: .long 4294967288
-// CHECK-LP32-NEXT: .long __ZTI7test8_D
-// CHECK-LP32-NEXT: .long __ZN9test8_B2b10ftest8_B2bEv
-// CHECK-LP32-NEXT: .long 4294967284
-// CHECK-LP32-NEXT: .long __ZTI7test8_D
-// CHECK-LP32-NEXT: .long __ZN8test8_B39ftest8_B3Ev
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 4294967280
-// CHECK-LP32-NEXT: .long __ZTI7test8_D
-// CHECK-LP32-NEXT: .long __ZN10test8_B2aa11ftest8_B2aaEv
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 4294967272
-// CHECK-LP32-NEXT: .long __ZTI7test8_D
-// CHECK-LP32-NEXT: .long __ZN10test8_B2ab11ftest8_B2abEv
-
// CHECK-LP64:__ZTV7test8_D:
// CHECK-LP64-NEXT: .quad 48
// CHECK-LP64-NEXT: .quad 32
@@ -461,6 +298,49 @@ class test8_D : test8_B1, test8_B2, test8_B3 {
// CHECK-LP64-NEXT: .quad __ZTI7test8_D
// CHECK-LP64-NEXT: .quad __ZN10test8_B2ab11ftest8_B2abEv
+// CHECK-LP64:__ZTC7test8_D8_8test8_B2:
+// CHECK-LP64-NEXT: .quad 40
+// CHECK-LP64-NEXT: .quad 24
+// CHECK-LP64-NEXT: .space 8
+// CHECK-LP64-NEXT: .quad __ZTI8test8_B2
+// CHECK-LP64-NEXT: .quad __ZN9test8_B2a10ftest8_B2aEv
+// CHECK-LP64-NEXT: .quad __ZN8test8_B29ftest8_B2Ev
+// CHECK-LP64-NEXT: .space 8
+// CHECK-LP64-NEXT: .quad 18446744073709551592
+// CHECK-LP64-NEXT: .quad __ZTI8test8_B2
+// CHECK-LP64-NEXT: .quad __ZN10test8_B2aa11ftest8_B2aaEv
+// CHECK-LP64-NEXT: .space 8
+// CHECK-LP64-NEXT: .quad 18446744073709551576
+// CHECK-LP64-NEXT: .quad __ZTI8test8_B2
+// CHECK-LP64-NEXT: .quad __ZN10test8_B2ab11ftest8_B2abEv
+
+// CHECK-LP64:__ZTC7test8_D8_9test8_B2a:
+// CHECK-LP64-NEXT: .quad 40
+// CHECK-LP64-NEXT: .quad 24
+// CHECK-LP64-NEXT: .space 8
+// CHECK-LP64-NEXT: .quad __ZTI9test8_B2a
+// CHECK-LP64-NEXT: .quad __ZN9test8_B2a10ftest8_B2aEv
+// CHECK-LP64-NEXT: .space 8
+// CHECK-LP64-NEXT: .quad 18446744073709551592
+// CHECK-LP64-NEXT: .quad __ZTI9test8_B2a
+// CHECK-LP64-NEXT: .quad __ZN10test8_B2aa11ftest8_B2aaEv
+// CHECK-LP64-NEXT: .space 8
+// CHECK-LP64-NEXT: .quad 18446744073709551576
+// CHECK-LP64-NEXT: .quad __ZTI9test8_B2a
+// CHECK-LP64-NEXT: .quad __ZN10test8_B2ab11ftest8_B2abEv
+
+// CHECK-LP64:__ZTT7test8_D:
+// CHECK-LP64-NEXT: .quad (__ZTV7test8_D) + 32
+// CHECK-LP64-NEXT: .quad (__ZTC7test8_D8_8test8_B2) + 32
+// CHECK-LP64-NEXT: .quad (__ZTC7test8_D8_9test8_B2a) + 32
+// CHECK-LP64-NEXT .quad (__ZTC7test8_D8_9test8_B2a) + 64
+// CHECK-LP64-NEXT .quad (__ZTC7test8_D8_9test8_B2a) + 96
+// CHECK-LP64-NEXT .quad (__ZTC7test8_D8_8test8_B2) + 72
+// CHECK-LP64-NEXT .quad (__ZTC7test8_D8_8test8_B2) + 104
+// CHECK-LP64-NEXT .quad (__ZTV7test8_D) + 72
+// CHECK-LP64: .quad (__ZTV7test8_D) + 160
+// CHECK-LP64: .quad (__ZTV7test8_D) + 192
+
struct test9_B3 { virtual void funcB3(); int i; };
struct test9_B2 : virtual test9_B3 { virtual void funcB2(); int i; };
@@ -554,77 +434,6 @@ struct test9_D : virtual test9_B1, virtual test9_B21, virtual test9_B31 {
// CHECK-LP64-NEXT: .quad __ZTI7test9_D
// CHECK-LP64-NEXT: .quad __ZN10test9_B2318funcB231Ev
-// CHECK-LP32: __ZTV7test9_D:
-// CHECK-LP32-NEXT: .long 84
-// CHECK-LP32-NEXT: .long 76
-// CHECK-LP32-NEXT: .long 68
-// CHECK-LP32-NEXT: .long 60
-// CHECK-LP32-NEXT: .long 52
-// CHECK-LP32-NEXT: .long 44
-// CHECK-LP32-NEXT: .long 36
-// CHECK-LP32-NEXT: .long 28
-// CHECK-LP32-NEXT: .long 20
-// CHECK-LP32-NEXT: .long 12
-// CHECK-LP32-NEXT: .long 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long __ZTI7test9_D
-// CHECK-LP32-NEXT: .long __ZN7test9_D5funcDEv
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 16
-// CHECK-LP32-NEXT: .long 8
-// CHECK-LP32-NEXT: .long 4294967292
-// CHECK-LP32-NEXT: .long __ZTI7test9_D
-// CHECK-LP32-NEXT: .long __ZN8test9_B16funcB1Ev
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 8
-// CHECK-LP32-NEXT: .long 4294967284
-// CHECK-LP32-NEXT: .long __ZTI7test9_D
-// CHECK-LP32-NEXT: .long __ZN8test9_B26funcB2Ev
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 4294967276
-// CHECK-LP32-NEXT: .long __ZTI7test9_D
-// CHECK-LP32-NEXT: .long __ZN8test9_B36funcB3Ev
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 16
-// CHECK-LP32-NEXT: .long 8
-// CHECK-LP32-NEXT: .long 4294967268
-// CHECK-LP32-NEXT: .long __ZTI7test9_D
-// CHECK-LP32-NEXT: .long __ZN9test9_B217funcB21Ev
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 8
-// CHECK-LP32-NEXT: .long 4294967260
-// CHECK-LP32-NEXT: .long __ZTI7test9_D
-// CHECK-LP32-NEXT: .long __ZN9test9_B227funcB22Ev
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 4294967252
-// CHECK-LP32-NEXT: .long __ZTI7test9_D
-// CHECK-LP32-NEXT: .long __ZN9test9_B237funcB23Ev
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 32
-// CHECK-LP32-NEXT: .long 24
-// CHECK-LP32-NEXT: .long 16
-// CHECK-LP32-NEXT: .long 8
-// CHECK-LP32-NEXT: .long 4294967244
-// CHECK-LP32-NEXT: .long __ZTI7test9_D
-// CHECK-LP32-NEXT: .long __ZN9test9_B317funcB31Ev
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 16
-// CHECK-LP32-NEXT: .long 8
-// CHECK-LP32-NEXT: .long 4294967236
-// CHECK-LP32-NEXT: .long __ZTI7test9_D
-// CHECK-LP32-NEXT: .long __ZN9test9_B327funcB32Ev
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 4294967228
-// CHECK-LP32-NEXT: .long __ZTI7test9_D
-// CHECK-LP32-NEXT: .long __ZN9test9_B337funcB33Ev
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 4294967220
-// CHECK-LP32-NEXT: .long __ZTI7test9_D
-// CHECK-LP32-NEXT: .long __ZN10test9_B2328funcB232Ev
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 4294967212
-// CHECK-LP32-NEXT: .long __ZTI7test9_D
-// CHECK-LP32-NEXT: .long __ZN10test9_B2318funcB231Ev
struct test10_O { int i; };
@@ -673,26 +482,6 @@ class test10_D : test10_B1, test10_B2 {
// CHECK-LP64-NEXT: .quad 18446744073709551576
// CHECK-LP64-NEXT: .quad __ZTI8test10_D
-// CHECK-LP32: __ZTV8test10_D:
-// CHECK-LP32-NEXT: .long 20
-// CHECK-LP32-NEXT: .long 12
-// CHECK-LP32-NEXT: .long 8
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long __ZTI8test10_D
-// CHECK-LP32-NEXT: .long __ZN9test10_B110ftest10_B1Ev
-// CHECK-LP32-NEXT: .long 16
-// CHECK-LP32-NEXT: .long 4
-// CHECK-LP32-NEXT: .long 8
-// CHECK-LP32-NEXT: .long 4294967292
-// CHECK-LP32-NEXT: .long __ZTI8test10_D
-// CHECK-LP32-NEXT: .long __ZN10test10_B2a11ftest10_B2aEv
-// CHECK-LP32-NEXT: .long __ZN9test10_B210ftest10_B2Ev
-// CHECK-LP32-NEXT: .long 4294967292
-// CHECK-LP32-NEXT: .long 4294967284
-// CHECK-LP32-NEXT: .long __ZTI8test10_D
-// CHECK-LP32-NEXT: .long 4294967284
-// CHECK-LP32-NEXT: .long 4294967276
-// CHECK-LP32-NEXT: .long __ZTI8test10_D
struct test11_B {
virtual void B1() { }
@@ -706,16 +495,6 @@ struct test11_D : test11_B {
virtual void D2() { }
};
-// CHECK-LP32:__ZTV8test11_D:
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long __ZTI8test11_D
-// CHECK-LP32-NEXT: .long __ZN8test11_B2B1Ev
-// CHECK-LP32-NEXT: .long __ZN8test11_D1DEv
-// CHECK-LP32-NEXT: .long __ZN8test11_B2B2Ev
-// CHECK-LP32-NEXT: .long __ZN8test11_D2D1Ev
-// CHECK-LP32-NEXT: .long __ZN8test11_D2D2Ev
-
-
// CHECK-LP64:__ZTV8test11_D:
// CHECK-LP64-NEXT: .space 8
// CHECK-LP64-NEXT: .quad __ZTI8test11_D
@@ -803,47 +582,6 @@ struct test13_D : test13_NV1, virtual test13_B2 {
// CHECK-LP64-NEXT: .quad __ZN8test13_B2DcEv
// CHECK-LP64-NEXT: .quad __ZTv0_n64_N9test13_B22B2Ev
-// CHECK-LP32:__ZTV8test13_D:
-// CHECK-LP32-NEXT: .long 12
-// CHECK-LP32-NEXT: .long 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long __ZTI8test13_D
-// CHECK-LP32-NEXT: .long __ZN8test13_D6fooNV1Ev
-// CHECK-LP32-NEXT: .long __ZN8test13_D1DEv
-// CHECK-LP32-NEXT: .long __ZN8test13_D2D1Ev
-// CHECK-LP32-NEXT: .long __ZN8test13_D2DbEv
-// CHECK-LP32-NEXT: .long __ZN8test13_D2DdEv
-// CHECK-LP32-NEXT: .long __ZN8test13_D2D2Ev
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 4294967292
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 4294967292
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 8
-// CHECK-LP32-NEXT: .long 4294967292
-// CHECK-LP32-NEXT: .long __ZTI8test13_D
-// CHECK-LP32-NEXT: .long __ZN9test13_B23B2aEv
-// CHECK-LP32-NEXT: .long __ZN9test13_B22B2Ev
-// CHECK-LP32-NEXT: .long __ZTv0_n24_N8test13_D1DEv
-// CHECK-LP32-NEXT: .long __ZN9test13_B22DaEv
-// CHECK-LP32-NEXT: .long __ZTv0_n32_N8test13_D2DdEv
-// CHECK-LP32-NEXT: .long __ZN9test13_B23B2bEv
-// CHECK-LP32-NEXT: .long 4294967288
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 4294967284
-// CHECK-LP32-NEXT: .long 4294967288
-// CHECK-LP32-NEXT: .long 4294967284
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 4294967284
-// CHECK-LP32-NEXT: .long __ZTI8test13_D
-// CHECK-LP32-NEXT: .long __ZN8test13_B2B1Ev
-// CHECK-LP32-NEXT: .long __ZTv0_n16_N8test13_D1DEv
-// CHECK-LP32-NEXT: .long __ZTv0_n20_N9test13_B22DaEv
-// CHECK-LP32-NEXT: .long __ZTv0_n24_N8test13_D2DbEv
-// CHECK-LP32-NEXT: .long __ZN8test13_B2DcEv
-// CHECK-LP32-NEXT: .long __ZTv0_n32_N9test13_B22B2Ev
-
class test14 {
public:
@@ -907,31 +645,6 @@ struct test15_D : test15_NV1, virtual test15_B2 {
// CHECK-LP64-NEXT: .quad __ZTcv0_n32_v0_n24_N9test15_B24foo2Ev
// CHECK-LP64-NEXT: .quad __ZN8test15_B4foo3Ev
-// CHECK-LP32:__ZTV8test15_D:
-// CHECK-LP32-NEXT: .long 20
-// CHECK-LP32-NEXT: .long 8
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long __ZTI8test15_D
-// CHECK-LP32-NEXT: .long __ZN10test15_NV16fooNV1Ev
-// CHECK-LP32-NEXT: .long __ZN8test15_D4foo1Ev
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 4294967288
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 12
-// CHECK-LP32-NEXT: .long 4294967288
-// CHECK-LP32-NEXT: .long __ZTI8test15_D
-// CHECK-LP32-NEXT: .long __ZN10test15_NV16fooNV1Ev
-// CHECK-LP32-NEXT: .long __ZTcv0_n20_v0_n12_N8test15_D4foo1Ev
-// CHECK-LP32-NEXT: .long __ZN9test15_B24foo2Ev
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 4294967284
-// CHECK-LP32-NEXT: .long 4294967276
-// CHECK-LP32-NEXT: .long 4294967276
-// CHECK-LP32-NEXT: .long __ZTI8test15_D
-// CHECK-LP32-NEXT: .long __ZTcv0_n12_v0_n16_N8test15_D4foo1Ev
-// CHECK-LP32-NEXT: .long __ZTcv0_n16_v0_n12_N9test15_B24foo2Ev
-// CHECK-LP32-NEXT: .long __ZN8test15_B4foo3Ev
-
struct test16_NV1 {
virtual void fooNV1() { }
@@ -995,7 +708,7 @@ void test16_D::bar() { }
// CHECK-LP64-NEXT: .space 8
// CHECK-LP64-NEXT: .space 8
// CHECK-LP64: .quad 18446744073709551600
-// CHECK-LP64: .quad 18446744073709551584
+// CHECK-LP64-NEXT: .quad 18446744073709551584
// CHECK-LP64-NEXT: .space 8
// CHECK-LP64-NEXT: .space 8
// CHECK-LP64-NEXT: .quad 18446744073709551584
@@ -1012,80 +725,60 @@ void test16_D::bar() { }
// CHECK-LP64: .quad __ZN10test16_NV27foo_NV2Ev
// CHECK-LP64-NEXT: .quad __ZN10test16_NV28foo_NV2bEv
-// CHECK-LP32: __ZTV8test16_D:
-// CHECK-LP32-NEXT: .long 20
-// CHECK-LP32-NEXT: .long 8
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long __ZTI8test16_D
-// CHECK-LP32-NEXT: .long __ZN10test16_NV16fooNV1Ev
-// CHECK-LP32-NEXT: .long __ZN10test16_NV17foo_NV1Ev
-// CHECK-LP32-NEXT: .long __ZN8test16_D3barEv
-// CHECK-LP32-NEXT: .long __ZN8test16_D4foo1Ev
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 4294967288
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 12
-// CHECK-LP32-NEXT: .long 4294967288
-// CHECK-LP32-NEXT: .long __ZTI8test16_D
-// CHECK-LP32-NEXT: .long __ZN10test16_NV16fooNV1Ev
-// CHECK-LP32-NEXT: .long __ZN10test16_NV17foo_NV1Ev
-// CHECK-LP32-NEXT: .long __ZTcv0_n24_v0_n12_N8test16_D4foo1Ev
-// CHECK-LP32-NEXT: .long __ZN9test16_B24foo2Ev
-// CHECK-LP32-NEXT: .long __ZN9test16_B26foo_B2Ev
-// CHECK-LP32-NEXT .long 8
-// CHECK-LP32-NEXT .long 8
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32: .long 4294967284
-// CHECK-LP32-NEXT: .long 4294967276
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 4294967276
-// CHECK-LP32-NEXT: .long __ZTI8test16_D
-// CHECK-LP32-NEXT: .long __ZN10test16_NV16fooNV1Ev
-// CHECK-LP32-NEXT: .long __ZN10test16_NV17foo_NV1Ev
-// CHECK-LP32-NEXT: .long __ZTcv0_n20_v0_n16_N8test16_D4foo1Ev
-// CHECK-LP32-NEXT: .long __ZTcv0_n24_v0_n12_N9test16_B24foo2Ev
-// CHECK-LP32-NEXT: .long __ZN8test16_B4foo3Ev
-// CHECK-LP32-NEXT: .long __ZN8test16_B5foo_BEv
-// CHECK-LP32-NEXT: .long 4294967268
-// CHECK-LP32-NEXT: .long __ZTI8test16_D
-// CHECK-LP32-NEXT .long __ZTcvn8_n20_v8_n16_N8test16_D4foo1Ev
-// CHECK-LP32: .long __ZN10test16_NV27foo_NV2Ev
-// CHECK-LP32-NEXT: .long __ZN10test16_NV28foo_NV2bEv
-
// FIXME: This is the wrong thunk, but until these issues are fixed, better
// than nothing.
-// CHECK-LPOPT64: __ZTcvn16_n72_v16_n32_N8test16_D4foo1Ev:
-// CHECK-LPOPT64-NEXT:Leh_func_begin
-// CHECK-LPOPT64-NEXT: subq $8, %rsp
-// CHECK-LPOPT64-NEXT:Llabel
-// CHECK-LPOPT64-NEXT: movq -16(%rdi), %rax
-// CHECK-LPOPT64-NEXT: movq -72(%rax), %rax
-// CHECK-LPOPT64-NEXT: leaq -16(%rax,%rdi), %rdi
-// FIXME: We want a tail call here
-// CHECK-LPOPT64-NEXT: call __ZTch0_v16_n32_N8test16_D4foo1Ev
-// CHECK-LPOPT64-NEXT: addq $8, %rsp
-// CHECK-LPOPT64-NEXT: ret
-
-// CHECK-LPOPT64: __ZTch0_v16_n32_N8test16_D4foo1Ev:
-// CHECK-LPOPT64-NEXT:Leh_func_begin
-// CHECK-LPOPT64-NEXT: subq $8, %rsp
-// CHECK-LPOPT64-NEXT:Llabel
-// CHECK-LPOPT64-NEXT: call __ZN8test16_D4foo1Ev
-// CHECK-LPOPT64-NEXT: testq %rax, %rax
-// CHECK-LPOPT64-NEXT: je LBB102_2
-// CHECK-LPOPT64-NEXT: movq 16(%rax), %rcx
-// CHECK-LPOPT64-NEXT: movq -32(%rcx), %rcx
-// CHECK-LPOPT64-NEXT: leaq 16(%rcx,%rax), %rax
-// CHECK-LPOPT64-NEXT: addq $8, %rsp
-// CHECK-LPOPT64-NEXT: ret
-// CHECK-LPOPT64-NEXT:LBB102_2:
-// CHECK-LPOPT64-NEXT: addq $8, %rsp
-// CHECK-LPOPT64-NEXT: ret
+// CHECK-LPLL64:define weak %class.test8_D* @_ZTcvn16_n72_v16_n32_N8test16_D4foo1Ev(%class.test8_D*) {
+// CHECK-LPLL64:entry:
+// CHECK-LPLL64: %retval = alloca %class.test8_D*
+// CHECK-LPLL64: %.addr = alloca %class.test8_D*
+// CHECK-LPLL64: store %class.test8_D* %0, %class.test8_D** %.addr
+// CHECK-LPLL64: %this = load %class.test8_D** %.addr
+// CHECK-LPLL64: %1 = bitcast %class.test8_D* %this to i8*
+// CHECK-LPLL64: %2 = getelementptr inbounds i8* %1, i64 -16
+// CHECK-LPLL64: %3 = bitcast i8* %2 to %class.test8_D*
+// CHECK-LPLL64: %4 = bitcast %class.test8_D* %3 to i8*
+// CHECK-LPLL64: %5 = bitcast %class.test8_D* %3 to i64**
+// CHECK-LPLL64: %vtable = load i64** %5
+// CHECK-LPLL64: %6 = getelementptr inbounds i64* %vtable, i64 -9
+// CHECK-LPLL64: %7 = load i64* %6
+// CHECK-LPLL64: %8 = getelementptr i8* %4, i64 %7
+// CHECK-LPLL64: %9 = bitcast i8* %8 to %class.test8_D*
+// CHECK-LPLL64: %call = call %class.test8_D* @_ZTch0_v16_n32_N8test16_D4foo1Ev(%class.test8_D* %9)
+// CHECK-LPLL64: store %class.test8_D* %call, %class.test8_D** %retval
+// CHECK-LPLL64: %10 = load %class.test8_D** %retval
+// CHECK-LPLL64: ret %class.test8_D* %10
+// CHECK-LPLL64:}
+
+// CHECK-LPLL64:define weak %class.test8_D* @_ZTch0_v16_n32_N8test16_D4foo1Ev(%class.test8_D*) {
+// CHECK-LPLL64:entry:
+// CHECK-LPLL64: %retval = alloca %class.test8_D*
+// CHECK-LPLL64: %.addr = alloca %class.test8_D*
+// CHECK-LPLL64: store %class.test8_D* %0, %class.test8_D** %.addr
+// CHECK-LPLL64: %this = load %class.test8_D** %.addr
+// CHECK-LPLL64: %call = call %class.test8_D* @_ZN8test16_D4foo1Ev(%class.test8_D* %this)
+// CHECK-LPLL64: %1 = icmp ne %class.test8_D* %call, null
+// CHECK-LPLL64: br i1 %1, label %2, label %12
+// CHECK-LPLL64:; <label>:2
+// CHECK-LPLL64: %3 = bitcast %class.test8_D* %call to i8*
+// CHECK-LPLL64: %4 = getelementptr inbounds i8* %3, i64 16
+// CHECK-LPLL64: %5 = bitcast i8* %4 to %class.test8_D*
+// CHECK-LPLL64: %6 = bitcast %class.test8_D* %5 to i8*
+// CHECK-LPLL64: %7 = bitcast %class.test8_D* %5 to i64**
+// CHECK-LPLL64: %vtable = load i64** %7
+// CHECK-LPLL64: %8 = getelementptr inbounds i64* %vtable, i64 -4
+// CHECK-LPLL64: %9 = load i64* %8
+// CHECK-LPLL64: %10 = getelementptr i8* %6, i64 %9
+// CHECK-LPLL64: %11 = bitcast i8* %10 to %class.test8_D*
+// CHECK-LPLL64: br label %13
+// CHECK-LPLL64:; <label>:12
+// CHECK-LPLL64: br label %13
+// CHECK-LPLL64:; <label>:13
+// CHECK-LPLL64: %14 = phi %class.test8_D* [ %11, %2 ], [ %call, %12 ]
+// CHECK-LPLL64: store %class.test8_D* %14, %class.test8_D** %retval
+// CHECK-LPLL64: %15 = load %class.test8_D** %retval
+// CHECK-LPLL64: ret %class.test8_D* %15
+// CHECK-LPLL64:}
class test17_B1 {
@@ -1220,16 +913,27 @@ struct test19_D : virtual test19_B4 {
// CHECK-LP64-NEXT: .space 8
// CHECK-LP64-NEXT: .space 8
// CHECK-LP64-NEXT: .quad __ZTI8test19_D
-// CHECK-LP64-NEXT .quad __ZN9test19_B13fB1Ev
-// CHECK-LP64-NEXT .quad __ZN9test19_B26foB1B2Ev
-// CHECK-LP64-NEXT .quad __ZN9test19_B36foB1B3Ev
-// CHECK-LP64-NEXT .quad __ZN9test19_B46foB1B4Ev
-// CHECK-LP64-NEXT .quad __ZN9test19_B23fB2Ev
-// CHECK-LP64-NEXT .quad __ZN9test19_B36foB2B3Ev
-// CHECK-LP64-NEXT .quad __ZN9test19_B46foB2B4Ev
-// CHECK-LP64-NEXT .quad __ZN9test19_B33fB3Ev
-// CHECK-LP64-NEXT .quad __ZN9test19_B46foB3B4Ev
-// CHECK-LP64-NEXT .quad __ZN9test19_B43fB4Ev
+// CHECK-LP64-NEXT: .quad __ZN9test19_B13fB1Ev
+// CHECK-LP64-NEXT: .quad __ZN9test19_B26foB1B2Ev
+// CHECK-LP64-NEXT: .quad __ZN9test19_B36foB1B3Ev
+// CHECK-LP64-NEXT: .quad __ZN9test19_B46foB1B4Ev
+// CHECK-LP64-NEXT: .quad __ZN9test19_B23fB2Ev
+// CHECK-LP64-NEXT: .quad __ZN9test19_B36foB2B3Ev
+// CHECK-LP64-NEXT: .quad __ZN9test19_B46foB2B4Ev
+// CHECK-LP64-NEXT: .quad __ZN9test19_B33fB3Ev
+// CHECK-LP64-NEXT: .quad __ZN9test19_B46foB3B4Ev
+// CHECK-LP64-NEXT: .quad __ZN9test19_B43fB4Ev
+
+// CHECK-LP64: __ZTT8test19_D:
+// CHECK-LP64-NEXT: .quad (__ZTV8test19_D) + 144
+// CHECK-LP64-NEXT: .quad (__ZTV8test19_D) + 144
+// CHECK-LP64-NEXT .quad (__ZTV8test19_D) + 144
+// CHECK-LP64-NEXT .quad (__ZTC8test19_D0_9test19_B4) + 136
+// CHECK-LP64-NEXT .quad (__ZTC8test19_D0_9test19_B3) + 104
+// CHECK-LP64-NEXT .quad (__ZTC8test19_D0_9test19_B3) + 104
+// CHECK-LP64-NEXT .quad (__ZTC8test19_D0_9test19_B4) + 136
+// CHECK-LP64-NEXT .quad (__ZTC8test19_D0_9test19_B2) + 88
+// CHECK-LP64-NEXT .quad (__ZTC8test19_D0_9test19_B1) + 24
class test20_V {
@@ -1243,7 +947,7 @@ class test20_B : virtual test20_V {
class test20_B1 : virtual test20_V1 {
};
class test20_D : public test20_B, public test20_B1 {
-} d;
+};
// CHECK-LP64: __ZTV8test20_D:
// CHECK-LP64-NEXT: .quad 8
@@ -1258,6 +962,82 @@ class test20_D : public test20_B, public test20_B1 {
// CHECK-LP64-NEXT: .quad __ZTI8test20_D
// CHECK-LP64-NEXT: .quad __ZN9test20_V14foo2Ev
+// CHECK-LP64: __ZTC8test20_D0_8test20_B:
+// CHECK-LP64-NEXT: .space 8
+// CHECK-LP64-NEXT: .space 8
+// CHECK-LP64-NEXT: .space 8
+// CHECK-LP64-NEXT: .quad __ZTI8test20_B
+// CHECK-LP64-NEXT: .quad __ZN8test20_V4foo1Ev
+
+// CHECK-LP64: __ZTC8test20_D8_9test20_B1:
+// CHECK-LP64-NEXT: .space 8
+// CHECK-LP64-NEXT: .space 8
+// CHECK-LP64-NEXT: .space 8
+// CHECK-LP64-NEXT: .quad __ZTI9test20_B1
+// CHECK-LP64-NEXT: .quad __ZN9test20_V14foo2Ev
+
+// CHECK-LP64: __ZTT8test20_D:
+// CHECK-LP64-NEXT: .quad (__ZTV8test20_D) + 40
+// CHECK-LP64-NEXT: .quad (__ZTC8test20_D0_8test20_B) + 32
+// CHECK-LP64-NEXT: .quad (__ZTC8test20_D0_8test20_B) + 32
+// CHECK-LP64-NEXT: .quad (__ZTC8test20_D8_9test20_B1) + 32
+// CHECK-LP64-NEXT: .quad (__ZTC8test20_D8_9test20_B1) + 32
+// CHECK-LP64-NEXT .quad (__ZTV8test20_D) + 40
+// CHECK-LP64-NEXT .quad (__ZTV8test20_D) + 80
+// CHECK-LP64-NEXT .quad (__ZTV8test20_D) + 80
+
+
+class test21_V {
+ virtual void foo() { }
+};
+class test21_V1 {
+ virtual void foo() { }
+};
+class test21_B : virtual test21_V {
+};
+class test21_B1 : virtual test21_V1 {
+};
+class test21_D : public test21_B, public test21_B1 {
+ void foo() { }
+};
+
+// CHECK-LP64: __ZTV8test21_D:
+// CHECK-LP64-NEXT: .quad 8
+// CHECK-LP64-NEXT: .space 8
+// CHECK-LP64-NEXT: .space 8
+// CHECK-LP64-NEXT: .space 8
+// CHECK-LP64-NEXT: .quad __ZTI8test21_D
+// CHECK-LP64-NEXT: .quad __ZN8test21_D3fooEv
+// CHECK-LP64-NEXT: .space 8
+// CHECK-LP64-NEXT: .quad 18446744073709551608
+// CHECK-LP64-NEXT: .quad 18446744073709551608
+// CHECK-LP64-NEXT: .quad __ZTI8test21_D
+// CHECK-LP64-NEXT: .quad __ZTv0_n24_N8test21_D3fooEv
+
+// CHECK-LP64: __ZTC8test21_D0_8test21_B:
+// CHECK-LP64-NEXT: .space 8
+// CHECK-LP64-NEXT: .space 8
+// CHECK-LP64-NEXT: .space 8
+// CHECK-LP64-NEXT: .quad __ZTI8test21_B
+// CHECK-LP64-NEXT: .quad __ZN8test21_V3fooEv
+
+// CHECK-LP64: __ZTC8test21_D8_9test21_B1:
+// CHECK-LP64-NEXT: .space 8
+// CHECK-LP64-NEXT: .space 8
+// CHECK-LP64-NEXT: .space 8
+// CHECK-LP64-NEXT: .quad __ZTI9test21_B1
+// CHECK-LP64-NEXT: .quad __ZN9test21_V13fooEv
+
+// CHECK-LP64: __ZTT8test21_D:
+// CHECK-LP64-NEXT: .quad (__ZTV8test21_D) + 40
+// CHECK-LP64-NEXT: .quad (__ZTC8test21_D0_8test21_B) + 32
+// CHECK-LP64-NEXT: .quad (__ZTC8test21_D0_8test21_B) + 32
+// CHECK-LP64-NEXT: .quad (__ZTC8test21_D8_9test21_B1) + 32
+// CHECK-LP64-NEXT: .quad (__ZTC8test21_D8_9test21_B1) + 32
+// CHECK-LP64-NEXT .quad (__ZTV8test21_D) + 40
+// CHECK-LP64-NEXT .quad (__ZTV8test21_D) + 80
+// CHECK-LP64-NEXT .quad (__ZTV8test21_D) + 80
+
// CHECK-LP64: __ZTV1B:
@@ -1266,12 +1046,6 @@ class test20_D : public test20_B, public test20_B1 {
// CHECK-LP64-NEXT: .quad __ZN1B4bar1Ev
// CHECK-LP64-NEXT: .quad __ZN1B4bar2Ev
-// CHECK-LP32: __ZTV1B:
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long __ZTI1B
-// CHECK-LP32-NEXT: .long __ZN1B4bar1Ev
-// CHECK-LP32-NEXT: .long __ZN1B4bar2Ev
-
// CHECK-LP64: __ZTV1A:
// CHECK-LP64-NEXT: .space 8
// CHECK-LP64-NEXT: .quad __ZTI1A
@@ -1284,39 +1058,6 @@ class test20_D : public test20_B, public test20_B1 {
// CHECK-LP64-NEXT: .quad __ZN1C4bee1Ev
// CHECK-LP64-NEXT: .quad __ZN1C4bee2Ev
-// CHECK-LP32: __ZTV1A:
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long __ZTI1A
-// CHECK-LP32-NEXT: .long __ZN1B4bar1Ev
-// CHECK-LP32-NEXT: .long __ZN1B4bar2Ev
-// CHECK-LP32-NEXT: .long __ZN1A4foo1Ev
-// CHECK-LP32-NEXT: .long __ZN1A4foo2Ev
-// CHECK-LP32-NEXT: .long 4294967284
-// CHECK-LP32-NEXT: .long __ZTI1A
-// CHECK-LP32-NEXT: .long __ZN1C4bee1Ev
-// CHECK-LP32-NEXT: .long __ZN1C4bee2Ev
-
-// CHECK-LP32:__ZTV1F:
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 8
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long __ZTI1F
-// CHECK-LP32-NEXT: .long __ZN1D3booEv
-// CHECK-LP32-NEXT: .long __ZN1F3fooEv
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .space 4
-// CHECK-LP32-NEXT: .long 4294967288
-// CHECK-LP32-NEXT: .long __ZTI1F
-// CHECK-LP32-NEXT: .long __ZN2D13barEv
-// CHECK-LP32-NEXT: .long __ZN2D14bar2Ev
-// CHECK-LP32-NEXT: .long __ZN2D14bar3Ev
-// CHECK-LP32-NEXT: .long __ZN2D14bar4Ev
-// CHECK-LP32-NEXT: .long __ZN2D14bar5Ev
-
// CHECK-LP64: __ZTV1F:
// CHECK-LP64-NEXT: .space 8
// CHECK-LP64-NEXT: .quad 16
@@ -1338,6 +1079,8 @@ class test20_D : public test20_B, public test20_B1 {
// CHECK-LP64-NEXT: .quad __ZN2D14bar4Ev
// CHECK-LP64-NEXT: .quad __ZN2D14bar5Ev
+test21_D d21;
+test20_D d20;
test19_D d19;
test18_D d18;
test17_D d17;
diff --git a/test/CodeGenCXX/virtual-operator-call.cpp b/test/CodeGenCXX/virtual-operator-call.cpp
new file mode 100644
index 0000000..018052b
--- /dev/null
+++ b/test/CodeGenCXX/virtual-operator-call.cpp
@@ -0,0 +1,10 @@
+// RUN: clang-cc %s -emit-llvm -o - | FileCheck %s
+
+struct A {
+ virtual int operator-() = 0;
+};
+
+void f(A *a) {
+ // CHECK: call i32 %
+ -*a;
+}
diff --git a/test/CodeGenCXX/virtual-pseudo-destructor-call.cpp b/test/CodeGenCXX/virtual-pseudo-destructor-call.cpp
new file mode 100644
index 0000000..3d99a02
--- /dev/null
+++ b/test/CodeGenCXX/virtual-pseudo-destructor-call.cpp
@@ -0,0 +1,10 @@
+// RUN: clang-cc %s -emit-llvm -o - | FileCheck %s
+
+struct A {
+ virtual ~A();
+};
+
+void f(A *a) {
+ // CHECK: call void %
+ a->~A();
+}
diff --git a/test/CodeGenCXX/x86_64-arguments.cpp b/test/CodeGenCXX/x86_64-arguments.cpp
index 426c867..6b5e7a7 100644
--- a/test/CodeGenCXX/x86_64-arguments.cpp
+++ b/test/CodeGenCXX/x86_64-arguments.cpp
@@ -1,10 +1,9 @@
-// RUN: clang-cc -triple x86_64-unknown-unknown -emit-llvm -o %t %s &&
+// RUN: clang-cc -triple x86_64-unknown-unknown -emit-llvm -o %t %s
struct A { ~A(); };
-// RUN: grep 'define void @_Z2f11A(.struct.A\* .a)' %t &&
+// RUN: grep 'define void @_Z2f11A(.struct.A\* .a)' %t
void f1(A a) { }
-// RUN: grep 'define void @_Z2f2v(.struct.A\* noalias sret .agg.result)' %t &&
+// RUN: grep 'define void @_Z2f2v(.struct.A\* noalias sret .agg.result)' %t
A f2() { return A(); }
-// RUN: true
diff --git a/test/CodeGenObjC/bitfield-1.m b/test/CodeGenObjC/bitfield-1.m
index 06ea911..3f605eb 100644
--- a/test/CodeGenObjC/bitfield-1.m
+++ b/test/CodeGenObjC/bitfield-1.m
@@ -1,5 +1,5 @@
-// RUN: clang-cc -triple x86_64-apple-darwin9 -fnext-runtime -emit-llvm -o %t %s &&
-// RUN: clang-cc -triple i386-apple-darwin9 -fnext-runtime -emit-llvm -o %t %s &&
+// RUN: clang-cc -triple x86_64-apple-darwin9 -emit-llvm -o %t %s
+// RUN: clang-cc -triple i386-apple-darwin9 -emit-llvm -o %t %s
// RUN: clang-cc -triple i386-pc-linux-gnu -emit-llvm -o %t %s
@interface Object
diff --git a/test/CodeGenObjC/bitfield-ivar-metadata.m b/test/CodeGenObjC/bitfield-ivar-metadata.m
index 542a242..f720bcc 100644
--- a/test/CodeGenObjC/bitfield-ivar-metadata.m
+++ b/test/CodeGenObjC/bitfield-ivar-metadata.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -emit-llvm -o %t %s
@interface INTF
{
diff --git a/test/CodeGenObjC/bitfield-ivar-offsets.m b/test/CodeGenObjC/bitfield-ivar-offsets.m
index 23a09a3..f4bc39d 100644
--- a/test/CodeGenObjC/bitfield-ivar-offsets.m
+++ b/test/CodeGenObjC/bitfield-ivar-offsets.m
@@ -1,14 +1,13 @@
// RUNX: llvm-gcc -m64 -emit-llvm -S -o %t %s &&
-// RUN: clang-cc -triple x86_64-apple-darwin10 -emit-llvm -o %t %s &&
-// RUN: grep -F '@"OBJC_IVAR_$_I0._b0" = global i64 0, section "__DATA, __objc_const", align 8' %t &&
-// RUN: grep -F '@"OBJC_IVAR_$_I0._b1" = global i64 0, section "__DATA, __objc_const", align 8' %t &&
-// RUN: grep -F '@"OBJC_IVAR_$_I0._b2" = global i64 1, section "__DATA, __objc_const", align 8' %t &&
-// RUN: grep -F '@"OBJC_IVAR_$_I0._x" = global i64 2, section "__DATA, __objc_const", align 8' %t &&
-// RUN: grep -F '@"OBJC_IVAR_$_I0._b3" = global i64 4, section "__DATA, __objc_const", align 8' %t &&
-// RUN: grep -F '@"OBJC_IVAR_$_I0._y" = global i64 6, section "__DATA, __objc_const", align 8' %t &&
-// RUN: grep -F '@"OBJC_IVAR_$_I0._b4" = global i64 7, section "__DATA, __objc_const", align 8' %t &&
-// RUN: grep -F '@"OBJC_IVAR_$_I0." = global' %t | count 0 &&
-// RUN: true
+// RUN: clang-cc -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -emit-llvm -o %t %s
+// RUN: grep -F '@"OBJC_IVAR_$_I0._b0" = global i64 0, section "__DATA, __objc_const", align 8' %t
+// RUN: grep -F '@"OBJC_IVAR_$_I0._b1" = global i64 0, section "__DATA, __objc_const", align 8' %t
+// RUN: grep -F '@"OBJC_IVAR_$_I0._b2" = global i64 1, section "__DATA, __objc_const", align 8' %t
+// RUN: grep -F '@"OBJC_IVAR_$_I0._x" = global i64 2, section "__DATA, __objc_const", align 8' %t
+// RUN: grep -F '@"OBJC_IVAR_$_I0._b3" = global i64 4, section "__DATA, __objc_const", align 8' %t
+// RUN: grep -F '@"OBJC_IVAR_$_I0._y" = global i64 6, section "__DATA, __objc_const", align 8' %t
+// RUN: grep -F '@"OBJC_IVAR_$_I0._b4" = global i64 7, section "__DATA, __objc_const", align 8' %t
+// RUN: grep -F '@"OBJC_IVAR_$_I0." = global' %t | count 0
@interface I0 {
unsigned _b0:4;
diff --git a/test/CodeGenObjC/blocks-1.m b/test/CodeGenObjC/blocks-1.m
index 2b4f8fa..ee1b978 100644
--- a/test/CodeGenObjC/blocks-1.m
+++ b/test/CodeGenObjC/blocks-1.m
@@ -1,12 +1,12 @@
-// RUN: clang-cc %s -emit-llvm -o %t -fobjc-gc -fblocks -triple i386-apple-darwin10 &&
-// RUN: grep "_Block_object_dispose" %t | count 6 &&
-// RUN: grep "__copy_helper_block_" %t | count 4 &&
-// RUN: grep "__destroy_helper_block_" %t | count 4 &&
-// RUN: grep "__Block_byref_id_object_copy_" %t | count 2 &&
-// RUN: grep "__Block_byref_id_object_dispose_" %t | count 2 &&
-// RUN: grep "i32 135)" %t | count 0 &&
-// RUN: grep "_Block_object_assign" %t | count 4 &&
-// RUN: grep "objc_read_weak" %t | count 2 &&
+// RUN: clang-cc %s -emit-llvm -o %t -fobjc-gc -fblocks -triple i386-apple-darwin10
+// RUN: grep "_Block_object_dispose" %t | count 6
+// RUN: grep "__copy_helper_block_" %t | count 4
+// RUN: grep "__destroy_helper_block_" %t | count 4
+// RUN: grep "__Block_byref_id_object_copy_" %t | count 2
+// RUN: grep "__Block_byref_id_object_dispose_" %t | count 2
+// RUN: grep "i32 135)" %t | count 0
+// RUN: grep "_Block_object_assign" %t | count 4
+// RUN: grep "objc_read_weak" %t | count 2
// RUN: grep "objc_assign_weak" %t | count 3
@interface NSDictionary @end
diff --git a/test/CodeGenObjC/blocks-2.m b/test/CodeGenObjC/blocks-2.m
index a4d8bfa..bb7af99 100644
--- a/test/CodeGenObjC/blocks-2.m
+++ b/test/CodeGenObjC/blocks-2.m
@@ -1,6 +1,5 @@
-// RUN: clang-cc %s -emit-llvm -o %t -fobjc-gc -fblocks -triple i386-apple-darwin10 &&
-// RUN: grep "objc_assign_strongCast" %t | count 2 &&
-// RUN: true
+// RUN: clang-cc %s -emit-llvm -o %t -fobjc-gc -fblocks -triple i386-apple-darwin10
+// RUN: grep "objc_assign_strongCast" %t | count 2
// This should generate a strong cast.
diff --git a/test/CodeGenObjC/blocks-3.m b/test/CodeGenObjC/blocks-3.m
index 96e436b..16da55e 100644
--- a/test/CodeGenObjC/blocks-3.m
+++ b/test/CodeGenObjC/blocks-3.m
@@ -1,5 +1,5 @@
-// RUN: clang-cc -triple x86_64-apple-darwin9 -emit-llvm -fblocks -o %t %s &&
-// RUN: grep 'object_assign' %t | count 11 &&
+// RUN: clang-cc -triple x86_64-apple-darwin9 -emit-llvm -fblocks -o %t %s
+// RUN: grep 'object_assign' %t | count 11
// RUN: grep 'object_dispose' %t | count 29
int main() {
diff --git a/test/CodeGenObjC/blocks.m b/test/CodeGenObjC/blocks.m
index 18c455a..def4c9d 100644
--- a/test/CodeGenObjC/blocks.m
+++ b/test/CodeGenObjC/blocks.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-apple-darwin9 -emit-llvm -fblocks -o %t %s &&
+// RUN: clang-cc -triple i386-apple-darwin9 -emit-llvm -fblocks -o %t %s
// rdar://6676764
struct S {
@@ -19,7 +19,7 @@ void foo(T *P) {
-(void) im0;
@end
-// RUN: grep 'define internal i32 @"__-\[A im0\]_block_invoke_"' %t &&
+// RUN: grep 'define internal i32 @"__-\[A im0\]_block_invoke_"' %t
@implementation A
-(void) im0 {
(void) ^{ return 1; }();
@@ -33,4 +33,3 @@ void foo(T *P) {
}
@end
-// RUN: true
diff --git a/test/CodeGenObjC/category-super-class-meth.m b/test/CodeGenObjC/category-super-class-meth.m
index 95d8b31..ce27e87 100644
--- a/test/CodeGenObjC/category-super-class-meth.m
+++ b/test/CodeGenObjC/category-super-class-meth.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -emit-llvm -o %t %s
@interface BASE
+ (int) BaseMeth;
diff --git a/test/CodeGenObjC/class-getter-dotsyntax.m b/test/CodeGenObjC/class-getter-dotsyntax.m
index 3c82f78..1e1a759 100644
--- a/test/CodeGenObjC/class-getter-dotsyntax.m
+++ b/test/CodeGenObjC/class-getter-dotsyntax.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -emit-llvm -o %t %s
@interface Test { }
+ (Test *)crash;
diff --git a/test/CodeGenObjC/class-type.m b/test/CodeGenObjC/class-type.m
index 794d9a3..d63f842 100644
--- a/test/CodeGenObjC/class-type.m
+++ b/test/CodeGenObjC/class-type.m
@@ -1,5 +1,5 @@
-// RUN: clang-cc -triple x86_64-unknown-unknown -emit-llvm -o - %s &&
-// RUN: clang-cc -triple i386-apple-darwin9 -emit-llvm -o - %s &&
+// RUN: clang-cc -triple x86_64-unknown-unknown -emit-llvm -o - %s
+// RUN: clang-cc -triple i386-apple-darwin9 -emit-llvm -o - %s
// RUN: clang-cc -triple x86_64-apple-darwin9 -emit-llvm -o - %s
diff --git a/test/CodeGenObjC/constant-strings.m b/test/CodeGenObjC/constant-strings.m
index 82cd916..8482376 100644
--- a/test/CodeGenObjC/constant-strings.m
+++ b/test/CodeGenObjC/constant-strings.m
@@ -1,5 +1,5 @@
-// RUN: clang-cc -fnext-runtime -emit-llvm -o %t %s &&
-// RUN: clang-cc -fgnu-runtime -emit-llvm -o %t %s && grep NXConstantString %t | count 1 &&
+// RUN: clang-cc -emit-llvm -o %t %s
+// RUN: clang-cc -fgnu-runtime -emit-llvm -o %t %s && grep NXConstantString %t | count 1
// RUN: clang-cc -fgnu-runtime -fconstant-string-class=NSConstantString -emit-llvm -o %t %s && grep NSConstantString %t | count 1
id a = @"Hello World!";
diff --git a/test/CodeGenObjC/continuation-class.m b/test/CodeGenObjC/continuation-class.m
index 925f3cd..305d6c7 100644
--- a/test/CodeGenObjC/continuation-class.m
+++ b/test/CodeGenObjC/continuation-class.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fnext-runtime --emit-llvm -o %t %s
+// RUN: clang-cc --emit-llvm -o %t %s
@interface Object
- (id)new;
diff --git a/test/CodeGenObjC/deadcode_strip_used_var.m b/test/CodeGenObjC/deadcode_strip_used_var.m
index 444cf76..d2548fd 100644
--- a/test/CodeGenObjC/deadcode_strip_used_var.m
+++ b/test/CodeGenObjC/deadcode_strip_used_var.m
@@ -1,6 +1,6 @@
-// RUN: clang-cc %s -emit-llvm -o %t -triple i386-apple-darwin10 &&
-// RUN: grep "llvm.used" %t | count 1 &&
-// RUN: clang-cc %s -emit-llvm -o %t -triple x86_64-apple-darwin10 &&
+// RUN: clang-cc %s -emit-llvm -o %t -triple i386-apple-darwin10
+// RUN: grep "llvm.used" %t | count 1
+// RUN: clang-cc %s -emit-llvm -o %t -triple x86_64-apple-darwin10
// RUN: grep "llvm.used" %t | count 1
diff --git a/test/CodeGenObjC/debug-info-linkagename.m b/test/CodeGenObjC/debug-info-linkagename.m
index 7305689..bda98ee 100644
--- a/test/CodeGenObjC/debug-info-linkagename.m
+++ b/test/CodeGenObjC/debug-info-linkagename.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -g -S -o %t %s &&
+// RUN: clang-cc -g -S -o %t %s
// RUN: not grep 001 %t
@interface F
diff --git a/test/CodeGenObjC/dot-syntax-1.m b/test/CodeGenObjC/dot-syntax-1.m
index 6c4dcbb..6fab039 100644
--- a/test/CodeGenObjC/dot-syntax-1.m
+++ b/test/CodeGenObjC/dot-syntax-1.m
@@ -1,6 +1,6 @@
-// RUN: clang-cc -fnext-runtime --emit-llvm -o %t %s
+// RUN: clang-cc --emit-llvm -o %t %s
-#include <stdio.h>
+int printf(const char *, ...);
@interface Root
-(id) alloc;
diff --git a/test/CodeGenObjC/dot-syntax.m b/test/CodeGenObjC/dot-syntax.m
index 68c8ad0..348346b 100644
--- a/test/CodeGenObjC/dot-syntax.m
+++ b/test/CodeGenObjC/dot-syntax.m
@@ -1,6 +1,6 @@
-// RUN: clang-cc -fnext-runtime --emit-llvm -o %t %s
+// RUN: clang-cc --emit-llvm -o %t %s
-#include <stdio.h>
+int printf(const char *, ...);
@interface Root
-(id) alloc;
diff --git a/test/CodeGenObjC/encode-test-1.m b/test/CodeGenObjC/encode-test-1.m
index b4f3b0f..8e6fd86 100644
--- a/test/CodeGenObjC/encode-test-1.m
+++ b/test/CodeGenObjC/encode-test-1.m
@@ -1,5 +1,5 @@
-// RUN: clang-cc -triple=i686-apple-darwin9 -fnext-runtime -emit-llvm -o %t %s &&
-// RUN: grep -e "{Base=b2b3b4b5}" %t | count 1 &&
+// RUN: clang-cc -triple=i686-apple-darwin9 -emit-llvm -o %t %s
+// RUN: grep -e "{Base=b2b3b4b5}" %t | count 1
// RUN: grep -e "{Derived=b2b3b4b5b5b4b3}" %t | count 1
enum Enum { one, two, three, four };
diff --git a/test/CodeGenObjC/encode-test-2.m b/test/CodeGenObjC/encode-test-2.m
index 07a5336..b53ea66 100644
--- a/test/CodeGenObjC/encode-test-2.m
+++ b/test/CodeGenObjC/encode-test-2.m
@@ -1,8 +1,8 @@
-// RUN: clang-cc -triple=i686-apple-darwin9 -fnext-runtime -emit-llvm -o %t %s &&
-// RUN: grep -e "@\\\22<X>\\\22" %t &&
-// RUN: grep -e "@\\\22<X><Y>\\\22" %t &&
-// RUN: grep -e "@\\\22<X><Y><Z>\\\22" %t &&
-// RUN: grep -e "@\\\22Foo<X><Y><Z>\\\22" %t &&
+// RUN: clang-cc -triple=i686-apple-darwin9 -emit-llvm -o %t %s
+// RUN: grep -e "@\\\22<X>\\\22" %t
+// RUN: grep -e "@\\\22<X><Y>\\\22" %t
+// RUN: grep -e "@\\\22<X><Y><Z>\\\22" %t
+// RUN: grep -e "@\\\22Foo<X><Y><Z>\\\22" %t
// RUN: grep -e "{Intf=@@@@#}" %t
@protocol X, Y, Z;
diff --git a/test/CodeGenObjC/encode-test-3.m b/test/CodeGenObjC/encode-test-3.m
index 116e825..79a024f 100644
--- a/test/CodeGenObjC/encode-test-3.m
+++ b/test/CodeGenObjC/encode-test-3.m
@@ -1,5 +1,5 @@
-// RUN: clang-cc -triple=i686-apple-darwin9 -fnext-runtime -emit-llvm -o %t %s &&
-// RUN: grep -e "\^i" %t | count 1 &&
+// RUN: clang-cc -triple=i686-apple-darwin9 -emit-llvm -o %t %s
+// RUN: grep -e "\^i" %t | count 1
// RUN: grep -e "\[0i\]" %t | count 1
int main() {
diff --git a/test/CodeGenObjC/encode-test-5.m b/test/CodeGenObjC/encode-test-5.m
index 9820b41..d5ec9b3 100644
--- a/test/CodeGenObjC/encode-test-5.m
+++ b/test/CodeGenObjC/encode-test-5.m
@@ -1,15 +1,15 @@
-// RUN: clang-cc -triple=x86_64-apple-darwin9 -fnext-runtime -emit-llvm -o %t %s &&
+// RUN: clang-cc -triple=x86_64-apple-darwin9 -emit-llvm -o %t %s
-// RUN: grep ji.00 %t | count 1 &&
+// RUN: grep ji.00 %t | count 1
char *a = @encode(_Complex int);
-// RUN: grep jf.00 %t | count 1 &&
+// RUN: grep jf.00 %t | count 1
char *b = @encode(_Complex float);
-// RUN: grep jd.00 %t | count 1 &&
+// RUN: grep jd.00 %t | count 1
char *c = @encode(_Complex double);
-// RUN: grep "t.00" %t | count 1 &&
+// RUN: grep "t.00" %t | count 1
char *e = @encode(__int128_t);
// RUN: grep "T.00" %t | count 1
diff --git a/test/CodeGenObjC/encode-test.m b/test/CodeGenObjC/encode-test.m
index ca54a51..6665cb9 100644
--- a/test/CodeGenObjC/encode-test.m
+++ b/test/CodeGenObjC/encode-test.m
@@ -1,9 +1,9 @@
-// RUN: clang-cc -triple=i686-apple-darwin9 -fnext-runtime -emit-llvm -o %t %s &&
-// RUN: grep -e "\^{Innermost=CC}" %t | count 1 &&
-// RUN: grep -e "{Derived=#ib32b8b3b8sb16b8b8b2b8ccb6}" %t | count 1 &&
-// RUN: grep -e "{B1=#@c}" %t | count 1 &&
-// RUN: grep -e "v12@0:4\[3\[4@]]8" %t | count 1 &&
-// RUN: grep -e "r\^{S=i}" %t | count 1 &&
+// RUN: clang-cc -triple=i686-apple-darwin9 -emit-llvm -o %t %s
+// RUN: grep -e "\^{Innermost=CC}" %t | count 1
+// RUN: grep -e "{Derived=#ib32b8b3b8sb16b8b8b2b8ccb6}" %t | count 1
+// RUN: grep -e "{B1=#@c}" %t | count 1
+// RUN: grep -e "v12@0:4\[3\[4@]]8" %t | count 1
+// RUN: grep -e "r\^{S=i}" %t | count 1
// RUN: grep -e "\^{Object=#}" %t | count 1
@class Int1;
diff --git a/test/CodeGenObjC/forward-class-impl-metadata.m b/test/CodeGenObjC/forward-class-impl-metadata.m
index b8ce10a..5dfddde 100644
--- a/test/CodeGenObjC/forward-class-impl-metadata.m
+++ b/test/CodeGenObjC/forward-class-impl-metadata.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple x86_64-apple-darwin10 -emit-llvm -o %t %s
+// RUN: clang-cc -fobjc-nonfragile-abi -emit-llvm -o %t %s
@interface BASE {
@private
diff --git a/test/CodeGenObjC/hidden-visibility.m b/test/CodeGenObjC/hidden-visibility.m
new file mode 100644
index 0000000..082ee7a
--- /dev/null
+++ b/test/CodeGenObjC/hidden-visibility.m
@@ -0,0 +1,25 @@
+// RUN: clang-cc -fvisibility=hidden -fobjc-nonfragile-abi -emit-llvm -o - %s | FileCheck %s
+// CHECK: @"OBJC_IVAR_$_I.P" = hidden
+// CHECK: @"OBJC_CLASS_$_I" = hidden
+// CHECK: @"OBJC_METACLASS_$_I" = hidden
+// CHECK: @"\01l_OBJC_PROTOCOL_$_Prot0" = weak hidden
+
+@interface I {
+ int P;
+}
+
+@property int P;
+@end
+
+@implementation I
+@synthesize P;
+@end
+
+
+@protocol Prot0;
+
+id f0() {
+ return @protocol(Prot0);
+}
+
+
diff --git a/test/CodeGenObjC/hidden.m b/test/CodeGenObjC/hidden.m
index 6b86ca0..fd87d99 100644
--- a/test/CodeGenObjC/hidden.m
+++ b/test/CodeGenObjC/hidden.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fnext-runtime --emit-llvm -o %t %s
+// RUN: clang-cc --emit-llvm -o %t %s
__attribute__((visibility("hidden")))
@interface Hidden
diff --git a/test/CodeGenObjC/image-info.m b/test/CodeGenObjC/image-info.m
index e865012..c16f11d 100644
--- a/test/CodeGenObjC/image-info.m
+++ b/test/CodeGenObjC/image-info.m
@@ -1,2 +1,2 @@
-// RUN: clang-cc -triple x86_64-apple-darwin-10 -emit-llvm -o %t %s &&
+// RUN: clang-cc -triple x86_64-apple-darwin-10 -emit-llvm -o %t %s
// RUN: grep -F '@"\01L_OBJC_IMAGE_INFO" = internal constant [2 x i32] [i32 0, i32 16], section "__OBJC, __image_info,regular"' %t
diff --git a/test/CodeGenObjC/implicit-objc_msgSend.m b/test/CodeGenObjC/implicit-objc_msgSend.m
index 4511cca..f2fba58 100644
--- a/test/CodeGenObjC/implicit-objc_msgSend.m
+++ b/test/CodeGenObjC/implicit-objc_msgSend.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple x86_64-apple-darwin9 -emit-llvm -o %t %s &&
+// RUN: clang-cc -triple x86_64-apple-darwin9 -emit-llvm -o %t %s
// RUN: grep -F 'declare i8* @objc_msgSend(...)' %t
typedef struct objc_selector *SEL;
diff --git a/test/CodeGenObjC/interface-layout-64.m b/test/CodeGenObjC/interface-layout-64.m
index 13d6a87..ac29839 100644
--- a/test/CodeGenObjC/interface-layout-64.m
+++ b/test/CodeGenObjC/interface-layout-64.m
@@ -1,28 +1,27 @@
-// RUN: clang-cc -triple x86_64-apple-darwin9 -emit-llvm -o %t %s &&
+// RUN: clang-cc -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -emit-llvm -o %t %s
// RUNX: llvm-gcc -m64 -emit-llvm -S -o %t %s &&
-// RUN: grep '@"OBJC_IVAR_$_I3._iv2" = global i64 8, section "__DATA, __objc_const", align 8' %t &&
-// RUN: grep '@"OBJC_IVAR_$_I3._iv3" = global i64 12, section "__DATA, __objc_const", align 8' %t &&
-// RUN: grep '@"OBJC_IVAR_$_I4._iv4" = global i64 13, section "__DATA, __objc_const", align 8' %t &&
-// RUN: grep '@"OBJC_IVAR_$_I5._iv5" = global i64 14, section "__DATA, __objc_const", align 8' %t &&
-// RUN: grep '@"OBJC_IVAR_$_I5._iv6_synth" = global i64 16, section "__DATA, __objc_const", align 8' %t &&
-// RUN: grep '@"OBJC_IVAR_$_I5._iv7_synth" = global i64 20, section "__DATA, __objc_const", align 8' %t &&
-// RUN: grep '@"OBJC_IVAR_$_I6.iv0" = global i64 0, section "__DATA, __objc_const", align 8' %t &&
-// RUN: grep '@"OBJC_IVAR_$_I8.b" = global i64 8, section "__DATA, __objc_const", align 8' %t &&
-// RUN: grep '@"OBJC_IVAR_$_I9.iv0" = global i64 0, section "__DATA, __objc_const", align 8' %t &&
-// RUN: grep '@"OBJC_IVAR_$_I10.iv1" = global i64 4, section "__DATA, __objc_const", align 8' %t &&
-// RUN: grep '@"OBJC_IVAR_$_I12.iv2" = global i64 8, section "__DATA, __objc_const", align 8' %t &&
-// RUN: grep '_OBJC_CLASS_RO_$_I3" = internal global .* { i32 0, i32 8, i32 13, .*' %t &&
-// RUN: grep '_OBJC_CLASS_RO_$_I4" = internal global .* { i32 0, i32 13, i32 14, .*' %t &&
-// RUN: grep '_OBJC_CLASS_RO_$_I5" = internal global .* { i32 0, i32 14, i32 24, .*' %t &&
-// RUN: grep '_OBJC_CLASS_RO_$_I6" = internal global .* { i32 2, i32 0, i32 1, .*' %t &&
-// RUN: grep '_OBJC_CLASS_RO_$_I8" = internal global .* { i32 0, i32 8, i32 16, .*' %t &&
-// RUN: grep '_OBJC_CLASS_RO_$_I9" = internal global .* { i32 2, i32 0, i32 4, .*' %t &&
-// RUN: grep '_OBJC_CLASS_RO_$_I10" = internal global .* { i32 0, i32 4, i32 5, .*' %t &&
-// RUN: grep '_OBJC_CLASS_RO_$_I11" = internal global .* { i32 0, i32 5, i32 5, .*' %t &&
-// RUN: grep '_OBJC_CLASS_RO_$_I12" = internal global .* { i32 0, i32 8, i32 12, .*' %t &&
-
-// RUN: true
+// RUN: grep '@"OBJC_IVAR_$_I3._iv2" = global i64 8, section "__DATA, __objc_const", align 8' %t
+// RUN: grep '@"OBJC_IVAR_$_I3._iv3" = global i64 12, section "__DATA, __objc_const", align 8' %t
+// RUN: grep '@"OBJC_IVAR_$_I4._iv4" = global i64 13, section "__DATA, __objc_const", align 8' %t
+// RUN: grep '@"OBJC_IVAR_$_I5._iv5" = global i64 14, section "__DATA, __objc_const", align 8' %t
+// RUN: grep '@"OBJC_IVAR_$_I5._iv6_synth" = global i64 16, section "__DATA, __objc_const", align 8' %t
+// RUN: grep '@"OBJC_IVAR_$_I5._iv7_synth" = global i64 20, section "__DATA, __objc_const", align 8' %t
+// RUN: grep '@"OBJC_IVAR_$_I6.iv0" = global i64 0, section "__DATA, __objc_const", align 8' %t
+// RUN: grep '@"OBJC_IVAR_$_I8.b" = global i64 8, section "__DATA, __objc_const", align 8' %t
+// RUN: grep '@"OBJC_IVAR_$_I9.iv0" = global i64 0, section "__DATA, __objc_const", align 8' %t
+// RUN: grep '@"OBJC_IVAR_$_I10.iv1" = global i64 4, section "__DATA, __objc_const", align 8' %t
+// RUN: grep '@"OBJC_IVAR_$_I12.iv2" = global i64 8, section "__DATA, __objc_const", align 8' %t
+// RUN: grep '_OBJC_CLASS_RO_$_I3" = internal global .* { i32 0, i32 8, i32 13, .*' %t
+// RUN: grep '_OBJC_CLASS_RO_$_I4" = internal global .* { i32 0, i32 13, i32 14, .*' %t
+// RUN: grep '_OBJC_CLASS_RO_$_I5" = internal global .* { i32 0, i32 14, i32 24, .*' %t
+// RUN: grep '_OBJC_CLASS_RO_$_I6" = internal global .* { i32 2, i32 0, i32 1, .*' %t
+// RUN: grep '_OBJC_CLASS_RO_$_I8" = internal global .* { i32 0, i32 8, i32 16, .*' %t
+// RUN: grep '_OBJC_CLASS_RO_$_I9" = internal global .* { i32 2, i32 0, i32 4, .*' %t
+// RUN: grep '_OBJC_CLASS_RO_$_I10" = internal global .* { i32 0, i32 4, i32 5, .*' %t
+// RUN: grep '_OBJC_CLASS_RO_$_I11" = internal global .* { i32 0, i32 5, i32 5, .*' %t
+// RUN: grep '_OBJC_CLASS_RO_$_I12" = internal global .* { i32 0, i32 8, i32 12, .*' %t
+
/*
Compare to:
diff --git a/test/CodeGenObjC/interface.m b/test/CodeGenObjC/interface.m
index d506e88..543c535 100644
--- a/test/CodeGenObjC/interface.m
+++ b/test/CodeGenObjC/interface.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-apple-darwin9 -O3 -emit-llvm -o %t %s &&
+// RUN: clang-cc -triple i386-apple-darwin9 -O3 -emit-llvm -o %t %s
// RUN: grep 'ret i32 385' %t
void *alloca();
diff --git a/test/CodeGenObjC/ivar-layout-64.m b/test/CodeGenObjC/ivar-layout-64.m
index 7301e16..1905753 100644
--- a/test/CodeGenObjC/ivar-layout-64.m
+++ b/test/CodeGenObjC/ivar-layout-64.m
@@ -1,10 +1,9 @@
// RUNX: llvm-gcc -m64 -fobjc-gc -emit-llvm -S -o %t %s &&
-// RUN: clang-cc -triple x86_64-apple-darwin9 -fobjc-gc -emit-llvm -o %t %s &&
-// RUN: grep '@"\\01L_OBJC_CLASS_NAME_.*" = internal global .* c"A\\00"' %t &&
-// RUN: grep '@"\\01L_OBJC_CLASS_NAME_.*" = internal global .* c"\\11q\\10\\00"' %t &&
-// RUN: grep '@"\\01L_OBJC_CLASS_NAME_.*" = internal global .* c"!q\\00"' %t &&
-// RUN: grep '@"\\01L_OBJC_CLASS_NAME_.*" = internal global .* c"\\01\\14\\00"' %t &&
-// RUN: true
+// RUN: clang-cc -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fobjc-gc -emit-llvm -o %t %s
+// RUN: grep '@"\\01L_OBJC_CLASS_NAME_.*" = internal global .* c"A\\00"' %t
+// RUN: grep '@"\\01L_OBJC_CLASS_NAME_.*" = internal global .* c"\\11q\\10\\00"' %t
+// RUN: grep '@"\\01L_OBJC_CLASS_NAME_.*" = internal global .* c"!q\\00"' %t
+// RUN: grep '@"\\01L_OBJC_CLASS_NAME_.*" = internal global .* c"\\01\\14\\00"' %t
/*
diff --git a/test/CodeGenObjC/ivar-layout-no-optimize.m b/test/CodeGenObjC/ivar-layout-no-optimize.m
index d7796bc..2e04d7e 100644
--- a/test/CodeGenObjC/ivar-layout-no-optimize.m
+++ b/test/CodeGenObjC/ivar-layout-no-optimize.m
@@ -1,6 +1,5 @@
-// RUN: clang-cc -fobjc-gc -triple x86_64-apple-darwin -O0 -S %s -o %t-64.s &&
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s &&
-// RUN: true
+// RUN: clang-cc -fobjc-gc -triple x86_64-apple-darwin -O0 -S %s -o %t-64.s
+// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
@interface NSObject {
id isa;
diff --git a/test/CodeGenObjC/ivars.m b/test/CodeGenObjC/ivars.m
index 327b628..c7fcafd5 100644
--- a/test/CodeGenObjC/ivars.m
+++ b/test/CodeGenObjC/ivars.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple x86_64-apple-darwin9 -emit-llvm -o - %s &&
+// RUN: clang-cc -triple x86_64-apple-darwin9 -emit-llvm -o - %s
// RUN: clang-cc -triple i386-apple-darwin9 -emit-llvm -o - %s
// rdar://6800926
diff --git a/test/CodeGenObjC/link-errors.m b/test/CodeGenObjC/link-errors.m
index b50d939..4944f1b 100644
--- a/test/CodeGenObjC/link-errors.m
+++ b/test/CodeGenObjC/link-errors.m
@@ -1,8 +1,8 @@
-// RUN: clang-cc -triple i386-apple-darwin9 -fnext-runtime -emit-llvm -o %t %s &&
-// RUN: grep '.lazy_reference .objc_class_name_A' %t | count 1 &&
-// RUN: grep '.lazy_reference .objc_class_name_Unknown' %t | count 1 &&
-// RUN: grep '.lazy_reference .objc_class_name_Protocol' %t | count 1 &&
-// RUN: clang-cc -triple i386-apple-darwin9 -DWITH_IMPL -fnext-runtime -emit-llvm -o %t %s &&
+// RUN: clang-cc -triple i386-apple-darwin9 -emit-llvm -o %t %s
+// RUN: grep '.lazy_reference .objc_class_name_A' %t | count 1
+// RUN: grep '.lazy_reference .objc_class_name_Unknown' %t | count 1
+// RUN: grep '.lazy_reference .objc_class_name_Protocol' %t | count 1
+// RUN: clang-cc -triple i386-apple-darwin9 -DWITH_IMPL -emit-llvm -o %t %s
// RUN: grep '.lazy_reference .objc_class_name_Root' %t | count 1
@interface Root
diff --git a/test/CodeGenObjC/message-arrays.m b/test/CodeGenObjC/message-arrays.m
index c618672..1ae6bf6 100644
--- a/test/CodeGenObjC/message-arrays.m
+++ b/test/CodeGenObjC/message-arrays.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -emit-llvm -o %t %s
void f0(id a) {
// This should have an implicit cast
diff --git a/test/CodeGenObjC/messages-2.m b/test/CodeGenObjC/messages-2.m
index ca0eb94..5cf4d2d 100644
--- a/test/CodeGenObjC/messages-2.m
+++ b/test/CodeGenObjC/messages-2.m
@@ -1,6 +1,6 @@
-// RUN: clang-cc -fnext-runtime --emit-llvm -o %t %s
+// RUN: clang-cc --emit-llvm -o %t %s
-#include <stdio.h>
+int printf(const char *, ...);
@interface Root
@end
diff --git a/test/CodeGenObjC/messages.m b/test/CodeGenObjC/messages.m
index b7f42d1..ea8809f 100644
--- a/test/CodeGenObjC/messages.m
+++ b/test/CodeGenObjC/messages.m
@@ -1,10 +1,9 @@
-// RUN: clang-cc -fnext-runtime --emit-llvm -o %t %s &&
-// RUN: grep "objc_msgSend" %t | count 6 &&
-// RUN: clang-cc -fgnu-runtime --emit-llvm -o %t %s &&
-// RUN: grep "objc_msg_lookup" %t | count 6 &&
-// RUN: clang-cc -fgnu-runtime -fobjc-nonfragile-abi --emit-llvm -o %t %s &&
-// RUN: grep "objc_msg_lookup_sender" %t | count 6 &&
-// RUN: true
+// RUN: clang-cc --emit-llvm -o %t %s
+// RUN: grep "objc_msgSend" %t | count 6
+// RUN: clang-cc -fgnu-runtime --emit-llvm -o %t %s
+// RUN: grep "objc_msg_lookup" %t | count 6
+// RUN: clang-cc -fgnu-runtime -fobjc-nonfragile-abi --emit-llvm -o %t %s
+// RUN: grep "objc_msg_lookup_sender" %t | count 6
typedef struct {
int x;
diff --git a/test/CodeGenObjC/metadata-symbols-32.m b/test/CodeGenObjC/metadata-symbols-32.m
index 8cebe49..288fa8c 100644
--- a/test/CodeGenObjC/metadata-symbols-32.m
+++ b/test/CodeGenObjC/metadata-symbols-32.m
@@ -1,35 +1,34 @@
-// RUN: clang-cc -triple i386-apple-darwin9 -emit-llvm -o %t %s &&
+// RUN: clang-cc -triple i386-apple-darwin9 -emit-llvm -o %t %s
// RUNX: llvm-gcc -m32 -emit-llvm -S -o %t %s &&
-// RUN: grep '@"\\01L_OBJC_CATEGORY_A_Cat" = internal global .*section "__OBJC,__category,regular,no_dead_strip", align 4' %t &&
-// RUN: grep '@"\\01L_OBJC_CATEGORY_CLASS_METHODS_A_Cat" = internal global .*section "__OBJC,__cat_cls_meth,regular,no_dead_strip", align 4' %t &&
-// RUN: grep '@"\\01L_OBJC_CATEGORY_INSTANCE_METHODS_A_Cat" = internal global .*section "__OBJC,__cat_inst_meth,regular,no_dead_strip", align 4' %t &&
-// RUN: grep '@"\\01L_OBJC_CLASSEXT_A" = internal global .*section "__OBJC,__class_ext,regular,no_dead_strip", align 4' %t &&
-// RUN: grep '@"\\01L_OBJC_CLASS_A" = internal global .*section "__OBJC,__class,regular,no_dead_strip", align 4' %t &&
-// RUN: grep '@"\\01L_OBJC_CLASS_METHODS_A" = internal global .*section "__OBJC,__cls_meth,regular,no_dead_strip", align 4' %t &&
-// RUN: grep '@"\\01L_OBJC_CLASS_NAME_[0-9]*" = internal global .*section "__TEXT,__cstring,cstring_literals", align 1' %t &&
-// RUN: grep '@"\\01L_OBJC_CLASS_PROTOCOLS_A" = internal global .*section "__OBJC,__cat_cls_meth,regular,no_dead_strip", align 4' %t &&
-// RUN: grep '@"\\01L_OBJC_CLASS_REFERENCES_[0-9]*" = internal global .*section "__OBJC,__cls_refs,literal_pointers,no_dead_strip", align 4' %t &&
+// RUN: grep '@"\\01L_OBJC_CATEGORY_A_Cat" = internal global .*section "__OBJC,__category,regular,no_dead_strip", align 4' %t
+// RUN: grep '@"\\01L_OBJC_CATEGORY_CLASS_METHODS_A_Cat" = internal global .*section "__OBJC,__cat_cls_meth,regular,no_dead_strip", align 4' %t
+// RUN: grep '@"\\01L_OBJC_CATEGORY_INSTANCE_METHODS_A_Cat" = internal global .*section "__OBJC,__cat_inst_meth,regular,no_dead_strip", align 4' %t
+// RUN: grep '@"\\01L_OBJC_CLASSEXT_A" = internal global .*section "__OBJC,__class_ext,regular,no_dead_strip", align 4' %t
+// RUN: grep '@"\\01L_OBJC_CLASS_A" = internal global .*section "__OBJC,__class,regular,no_dead_strip", align 4' %t
+// RUN: grep '@"\\01L_OBJC_CLASS_METHODS_A" = internal global .*section "__OBJC,__cls_meth,regular,no_dead_strip", align 4' %t
+// RUN: grep '@"\\01L_OBJC_CLASS_NAME_[0-9]*" = internal global .*section "__TEXT,__cstring,cstring_literals", align 1' %t
+// RUN: grep '@"\\01L_OBJC_CLASS_PROTOCOLS_A" = internal global .*section "__OBJC,__cat_cls_meth,regular,no_dead_strip", align 4' %t
+// RUN: grep '@"\\01L_OBJC_CLASS_REFERENCES_[0-9]*" = internal global .*section "__OBJC,__cls_refs,literal_pointers,no_dead_strip", align 4' %t
// Clang's Obj-C 32-bit doesn't emit ivars for the root class.
// RUNX: grep '@"\\01L_OBJC_CLASS_VARIABLES_A" = internal global .*section "__OBJC,__class_vars,regular,no_dead_strip", align 4' %t &&
-// RUN: grep '@"\\01L_OBJC_INSTANCE_METHODS_A" = internal global .*section "__OBJC,__inst_meth,regular,no_dead_strip", align 4' %t &&
-// RUN: grep '@"\\01L_OBJC_INSTANCE_VARIABLES_A" = internal global .*section "__OBJC,__instance_vars,regular,no_dead_strip", align 4' %t &&
-// RUN: grep '@"\\01L_OBJC_METACLASS_A" = internal global .*section "__OBJC,__meta_class,regular,no_dead_strip", align 4' %t &&
-// RUN: grep '@"\\01L_OBJC_METH_VAR_NAME_[0-9]*" = internal global .*section "__TEXT,__cstring,cstring_literals", align 1' %t &&
-// RUN: grep '@"\\01L_OBJC_METH_VAR_TYPE_[0-9]*" = internal global .*section "__TEXT,__cstring,cstring_literals", align 1' %t &&
-// RUN: grep '@"\\01L_OBJC_MODULES" = internal global .*section "__OBJC,__module_info,regular,no_dead_strip", align 4' %t &&
-// RUN: grep '@"\\01L_OBJC_PROP_NAME_ATTR_[0-9]*" = internal global .*section "__TEXT,__cstring,cstring_literals", align 1' %t &&
-// RUN: grep '@"\\01L_OBJC_PROTOCOL_CLASS_METHODS_P" = internal global .*section "__OBJC,__cat_cls_meth,regular,no_dead_strip", align 4' %t &&
-// RUN: grep '@"\\01L_OBJC_PROTOCOL_INSTANCE_METHODS_P" = internal global .*section "__OBJC,__cat_inst_meth,regular,no_dead_strip", align 4' %t &&
-// RUN: grep '@"\\01L_OBJC_PROTOCOL_P" = internal global .*section "__OBJC,__protocol,regular,no_dead_strip", align 4' %t &&
-// RUN: grep '@"\\01L_OBJC_SELECTOR_REFERENCES_[0-9]*" = internal global .*section "__OBJC,__message_refs,literal_pointers,no_dead_strip", align 4' %t &&
-// RUN: grep '@"\\01L_OBJC_SYMBOLS" = internal global .*section "__OBJC,__symbols,regular,no_dead_strip", align 4' %t &&
-// RUN: grep '@"\\01l_OBJC_$_PROP_LIST_A" = internal global .*section "__OBJC,__property,regular,no_dead_strip", align 4' %t &&
-// RUN: grep "\.lazy_reference \.objc_class_name_J0" %t &&
-
-// RUN: true
+// RUN: grep '@"\\01L_OBJC_INSTANCE_METHODS_A" = internal global .*section "__OBJC,__inst_meth,regular,no_dead_strip", align 4' %t
+// RUN: grep '@"\\01L_OBJC_INSTANCE_VARIABLES_A" = internal global .*section "__OBJC,__instance_vars,regular,no_dead_strip", align 4' %t
+// RUN: grep '@"\\01L_OBJC_METACLASS_A" = internal global .*section "__OBJC,__meta_class,regular,no_dead_strip", align 4' %t
+// RUN: grep '@"\\01L_OBJC_METH_VAR_NAME_[0-9]*" = internal global .*section "__TEXT,__cstring,cstring_literals", align 1' %t
+// RUN: grep '@"\\01L_OBJC_METH_VAR_TYPE_[0-9]*" = internal global .*section "__TEXT,__cstring,cstring_literals", align 1' %t
+// RUN: grep '@"\\01L_OBJC_MODULES" = internal global .*section "__OBJC,__module_info,regular,no_dead_strip", align 4' %t
+// RUN: grep '@"\\01L_OBJC_PROP_NAME_ATTR_[0-9]*" = internal global .*section "__TEXT,__cstring,cstring_literals", align 1' %t
+// RUN: grep '@"\\01L_OBJC_PROTOCOL_CLASS_METHODS_P" = internal global .*section "__OBJC,__cat_cls_meth,regular,no_dead_strip", align 4' %t
+// RUN: grep '@"\\01L_OBJC_PROTOCOL_INSTANCE_METHODS_P" = internal global .*section "__OBJC,__cat_inst_meth,regular,no_dead_strip", align 4' %t
+// RUN: grep '@"\\01L_OBJC_PROTOCOL_P" = internal global .*section "__OBJC,__protocol,regular,no_dead_strip", align 4' %t
+// RUN: grep '@"\\01L_OBJC_SELECTOR_REFERENCES_[0-9]*" = internal global .*section "__OBJC,__message_refs,literal_pointers,no_dead_strip", align 4' %t
+// RUN: grep '@"\\01L_OBJC_SYMBOLS" = internal global .*section "__OBJC,__symbols,regular,no_dead_strip", align 4' %t
+// RUN: grep '@"\\01l_OBJC_$_PROP_LIST_A" = internal global .*section "__OBJC,__property,regular,no_dead_strip", align 4' %t
+// RUN: grep "\.lazy_reference \.objc_class_name_J0" %t
+
/*
diff --git a/test/CodeGenObjC/metadata-symbols-64.m b/test/CodeGenObjC/metadata-symbols-64.m
index bfc4ae9..1bc8be8 100644
--- a/test/CodeGenObjC/metadata-symbols-64.m
+++ b/test/CodeGenObjC/metadata-symbols-64.m
@@ -1,40 +1,39 @@
-// RUN: clang-cc -triple x86_64-apple-darwin9 -emit-llvm -o %t %s &&
+// RUN: clang-cc -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -emit-llvm -o %t %s
// RUNX: llvm-gcc -m64 -emit-llvm -S -o %t %s &&
-// RUN: grep '@"OBJC_CLASS_$_A" = global' %t &&
-// RUN: grep '@"OBJC_CLASS_$_B" = external global' %t &&
-// RUN: grep '@"OBJC_IVAR_$_A._ivar" = global .* section "__DATA, __objc_const", align 8' %t &&
-// RUN: grep '@"OBJC_METACLASS_$_A" = global .* section "__DATA, __objc_data", align 8' %t &&
-// RUN: grep '@"\\01L_OBJC_CLASSLIST_REFERENCES_$_[0-9]*" = internal global .* section "__DATA, __objc_classrefs, regular, no_dead_strip", align 8' %t &&
-// RUN: grep '@"\\01L_OBJC_CLASSLIST_SUP_REFS_$_[0-9]*" = internal global .* section "__DATA, __objc_superrefs, regular, no_dead_strip", align 8' %t | count 2 &&
-// RUN: grep '@"\\01L_OBJC_CLASS_NAME_[0-9]*" = internal global .* section "__TEXT,__cstring,cstring_literals", align 1' %t &&
-// RUN: grep '@"\\01L_OBJC_LABEL_CATEGORY_$" = internal global .* section "__DATA, __objc_catlist, regular, no_dead_strip", align 8' %t &&
-// RUN: grep '@"\\01L_OBJC_LABEL_CLASS_$" = internal global .* section "__DATA, __objc_classlist, regular, no_dead_strip", align 8' %t &&
-// RUN: grep '@"\\01L_OBJC_METH_VAR_NAME_[0-9]*" = internal global .* section "__TEXT,__cstring,cstring_literals", align 1' %t &&
-// RUN: grep '@"\\01L_OBJC_METH_VAR_TYPE_[0-9]*" = internal global .* section "__TEXT,__cstring,cstring_literals", align 1' %t &&
-// RUN: grep '@"\\01L_OBJC_PROP_NAME_ATTR_[0-9]*" = internal global .* section "__TEXT,__cstring,cstring_literals", align 1' %t &&
-// RUN: grep '@"\\01L_OBJC_SELECTOR_REFERENCES_*" = internal global .* section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip"' %t &&
-// RUN: grep '@"\\01l_OBJC_$_CATEGORY_A_$_Cat" = internal global .* section "__DATA, __objc_const", align 8' %t &&
-// RUN: grep '@"\\01l_OBJC_$_CATEGORY_CLASS_METHODS_A_$_Cat" = internal global .* section "__DATA, __objc_const", align 8' %t &&
-// RUN: grep '@"\\01l_OBJC_$_CATEGORY_INSTANCE_METHODS_A_$_Cat" = internal global .* section "__DATA, __objc_const", align 8' %t &&
-// RUN: grep '@"\\01l_OBJC_$_CLASS_METHODS_A" = internal global .* section "__DATA, __objc_const", align 8' %t &&
-// RUN: grep '@"\\01l_OBJC_$_INSTANCE_METHODS_A" = internal global .* section "__DATA, __objc_const", align 8' %t &&
-// RUN: grep '@"\\01l_OBJC_$_INSTANCE_VARIABLES_A" = internal global .* section "__DATA, __objc_const", align 8' %t &&
-// RUN: grep '@"\\01l_OBJC_$_PROP_LIST_A" = internal global .* section "__DATA, __objc_const", align 8' %t &&
-// RUN: grep '@"\\01l_OBJC_$_PROTOCOL_CLASS_METHODS_P" = internal global .* section "__DATA, __objc_const", align 8' %t &&
-// RUN: grep '@"\\01l_OBJC_$_PROTOCOL_INSTANCE_METHODS_P" = internal global .* section "__DATA, __objc_const", align 8' %t &&
-// RUN: grep '@"\\01l_OBJC_CLASS_PROTOCOLS_$_A" = internal global .* section "__DATA, __objc_const", align 8' %t &&
-// RUN: grep '@"\\01l_OBJC_CLASS_RO_$_A" = internal global .* section "__DATA, __objc_const", align 8' %t &&
-// RUN: grep '@"\\01l_OBJC_LABEL_PROTOCOL_$_P" = weak hidden global .* section "__DATA, __objc_protolist, coalesced, no_dead_strip", align 8' %t &&
-// RUN: grep '@"\\01l_OBJC_METACLASS_RO_$_A" = internal global .* section "__DATA, __objc_const", align 8' %t &&
-// RUN: grep '@"\\01l_OBJC_PROTOCOL_$_P" = weak hidden global .* section "__DATA,__datacoal_nt,coalesced", align 8' %t &&
-// RUN: grep '@"\\01l_objc_msgSend_fixup_alloc" = weak hidden global .* section "__DATA, __objc_msgrefs, coalesced", align 16' %t &&
-// RUN: grep '@_objc_empty_cache = external global' %t &&
-// RUN: grep '@_objc_empty_vtable = external global' %t &&
-// RUN: grep '@objc_msgSend_fixup(' %t &&
-// RUN: grep '@objc_msgSend_fpret(' %t &&
-
-// RUN: true
+// RUN: grep '@"OBJC_CLASS_$_A" = global' %t
+// RUN: grep '@"OBJC_CLASS_$_B" = external global' %t
+// RUN: grep '@"OBJC_IVAR_$_A._ivar" = global .* section "__DATA, __objc_const", align 8' %t
+// RUN: grep '@"OBJC_METACLASS_$_A" = global .* section "__DATA, __objc_data", align 8' %t
+// RUN: grep '@"\\01L_OBJC_CLASSLIST_REFERENCES_$_[0-9]*" = internal global .* section "__DATA, __objc_classrefs, regular, no_dead_strip", align 8' %t
+// RUN: grep '@"\\01L_OBJC_CLASSLIST_SUP_REFS_$_[0-9]*" = internal global .* section "__DATA, __objc_superrefs, regular, no_dead_strip", align 8' %t | count 2
+// RUN: grep '@"\\01L_OBJC_CLASS_NAME_[0-9]*" = internal global .* section "__TEXT,__cstring,cstring_literals", align 1' %t
+// RUN: grep '@"\\01L_OBJC_LABEL_CATEGORY_$" = internal global .* section "__DATA, __objc_catlist, regular, no_dead_strip", align 8' %t
+// RUN: grep '@"\\01L_OBJC_LABEL_CLASS_$" = internal global .* section "__DATA, __objc_classlist, regular, no_dead_strip", align 8' %t
+// RUN: grep '@"\\01L_OBJC_METH_VAR_NAME_[0-9]*" = internal global .* section "__TEXT,__cstring,cstring_literals", align 1' %t
+// RUN: grep '@"\\01L_OBJC_METH_VAR_TYPE_[0-9]*" = internal global .* section "__TEXT,__cstring,cstring_literals", align 1' %t
+// RUN: grep '@"\\01L_OBJC_PROP_NAME_ATTR_[0-9]*" = internal global .* section "__TEXT,__cstring,cstring_literals", align 1' %t
+// RUN: grep '@"\\01L_OBJC_SELECTOR_REFERENCES_*" = internal global .* section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip"' %t
+// RUN: grep '@"\\01l_OBJC_$_CATEGORY_A_$_Cat" = internal global .* section "__DATA, __objc_const", align 8' %t
+// RUN: grep '@"\\01l_OBJC_$_CATEGORY_CLASS_METHODS_A_$_Cat" = internal global .* section "__DATA, __objc_const", align 8' %t
+// RUN: grep '@"\\01l_OBJC_$_CATEGORY_INSTANCE_METHODS_A_$_Cat" = internal global .* section "__DATA, __objc_const", align 8' %t
+// RUN: grep '@"\\01l_OBJC_$_CLASS_METHODS_A" = internal global .* section "__DATA, __objc_const", align 8' %t
+// RUN: grep '@"\\01l_OBJC_$_INSTANCE_METHODS_A" = internal global .* section "__DATA, __objc_const", align 8' %t
+// RUN: grep '@"\\01l_OBJC_$_INSTANCE_VARIABLES_A" = internal global .* section "__DATA, __objc_const", align 8' %t
+// RUN: grep '@"\\01l_OBJC_$_PROP_LIST_A" = internal global .* section "__DATA, __objc_const", align 8' %t
+// RUN: grep '@"\\01l_OBJC_$_PROTOCOL_CLASS_METHODS_P" = internal global .* section "__DATA, __objc_const", align 8' %t
+// RUN: grep '@"\\01l_OBJC_$_PROTOCOL_INSTANCE_METHODS_P" = internal global .* section "__DATA, __objc_const", align 8' %t
+// RUN: grep '@"\\01l_OBJC_CLASS_PROTOCOLS_$_A" = internal global .* section "__DATA, __objc_const", align 8' %t
+// RUN: grep '@"\\01l_OBJC_CLASS_RO_$_A" = internal global .* section "__DATA, __objc_const", align 8' %t
+// RUN: grep '@"\\01l_OBJC_LABEL_PROTOCOL_$_P" = weak hidden global .* section "__DATA, __objc_protolist, coalesced, no_dead_strip", align 8' %t
+// RUN: grep '@"\\01l_OBJC_METACLASS_RO_$_A" = internal global .* section "__DATA, __objc_const", align 8' %t
+// RUN: grep '@"\\01l_OBJC_PROTOCOL_$_P" = weak hidden global .* section "__DATA,__datacoal_nt,coalesced", align 8' %t
+// RUN: grep '@"\\01l_objc_msgSend_fixup_alloc" = weak hidden global .* section "__DATA, __objc_msgrefs, coalesced", align 16' %t
+// RUN: grep '@_objc_empty_cache = external global' %t
+// RUN: grep '@_objc_empty_vtable = external global' %t
+// RUN: grep '@objc_msgSend_fixup(' %t
+// RUN: grep '@objc_msgSend_fpret(' %t
+
/*
diff --git a/test/CodeGenObjC/metadata_symbols.m b/test/CodeGenObjC/metadata_symbols.m
index 1a1d1e1..c608cd4 100644
--- a/test/CodeGenObjC/metadata_symbols.m
+++ b/test/CodeGenObjC/metadata_symbols.m
@@ -1,26 +1,25 @@
-// RUN: clang-cc -triple x86_64-apple-darwin9 -emit-llvm -o %t %s &&
-
-// RUN: grep '@"OBJC_METACLASS_$_A" = global .*section "__DATA, __objc_data", align 8' %t &&
-// RUN: grep '@"OBJC_CLASS_$_A" = global .*section "__DATA, __objc_data", align 8' %t &&
-// RUN: grep '@"OBJC_EHTYPE_$_EH1" = weak global .*section "__DATA,__datacoal_nt,coalesced", align 8' %t &&
-// RUN: grep '@"OBJC_EHTYPE_$_EH2" = external global' %t &&
-// RUN: grep '@"OBJC_EHTYPE_$_EH3" = global .*section "__DATA,__objc_const", align 8' %t &&
-// RUN: grep '@"OBJC_EHTYPE_$_EH3"' %t | count 3 &&
-// RUN: grep '@"\\01L_OBJC_CLASS_NAME_" =.*section "__TEXT,__cstring,cstring_literals", align 1' %t | count 1 &&
-// RUN: grep -F 'define internal void @"\01-[A im0]"' %t &&
-// RUN: grep -F 'define internal void @"\01-[A(Cat) im1]"' %t &&
-
-// RUN: clang-cc -fvisibility=hidden -triple x86_64-apple-darwin9 -emit-llvm -o %t %s &&
-
-// RUN: grep '@"OBJC_METACLASS_$_A" = hidden global .*section "__DATA, __objc_data", align 8' %t &&
-// RUN: grep '@"OBJC_CLASS_$_A" = hidden global .*section "__DATA, __objc_data", align 8' %t &&
-// RUN: grep '@"OBJC_EHTYPE_$_EH1" = weak hidden global .*section "__DATA,__datacoal_nt,coalesced"' %t &&
-// RUN: grep '@"OBJC_EHTYPE_$_EH2" = external global' %t &&
-// RUN: grep '@"OBJC_EHTYPE_$_EH3" = hidden global .*section "__DATA,__objc_const", align 8' %t &&
-// RUN: grep -F 'define internal void @"\01-[A im0]"' %t &&
-// RUN: grep -F 'define internal void @"\01-[A(Cat) im1]"' %t &&
-
-// RUN: true
+// RUN: clang-cc -fobjc-nonfragile-abi -emit-llvm -o %t %s
+
+// RUN: grep '@"OBJC_METACLASS_$_A" = global .*section "__DATA, __objc_data", align 8' %t
+// RUN: grep '@"OBJC_CLASS_$_A" = global .*section "__DATA, __objc_data", align 8' %t
+// RUN: grep '@"OBJC_EHTYPE_$_EH1" = weak global .*section "__DATA,__datacoal_nt,coalesced", align 8' %t
+// RUN: grep '@"OBJC_EHTYPE_$_EH2" = external global' %t
+// RUN: grep '@"OBJC_EHTYPE_$_EH3" = global .*section "__DATA,__objc_const", align 8' %t
+// RUN: grep '@"OBJC_EHTYPE_$_EH3"' %t | count 3
+// RUN: grep '@"\\01L_OBJC_CLASS_NAME_" =.*section "__TEXT,__cstring,cstring_literals", align 1' %t | count 1
+// RUN: grep -F 'define internal void @"\01-[A im0]"' %t
+// RUN: grep -F 'define internal void @"\01-[A(Cat) im1]"' %t
+
+// RUN: clang-cc -fobjc-nonfragile-abi -fvisibility=hidden -emit-llvm -o %t %s
+
+// RUN: grep '@"OBJC_METACLASS_$_A" = hidden global .*section "__DATA, __objc_data", align 8' %t
+// RUN: grep '@"OBJC_CLASS_$_A" = hidden global .*section "__DATA, __objc_data", align 8' %t
+// RUN: grep '@"OBJC_EHTYPE_$_EH1" = weak hidden global .*section "__DATA,__datacoal_nt,coalesced"' %t
+// RUN: grep '@"OBJC_EHTYPE_$_EH2" = external global' %t
+// RUN: grep '@"OBJC_EHTYPE_$_EH3" = hidden global .*section "__DATA,__objc_const", align 8' %t
+// RUN: grep -F 'define internal void @"\01-[A im0]"' %t
+// RUN: grep -F 'define internal void @"\01-[A(Cat) im1]"' %t
+
@interface A
@end
diff --git a/test/CodeGenObjC/missing-atend-metadata.m b/test/CodeGenObjC/missing-atend-metadata.m
new file mode 100644
index 0000000..664b6f0
--- /dev/null
+++ b/test/CodeGenObjC/missing-atend-metadata.m
@@ -0,0 +1,24 @@
+// RUN: clang-cc -triple i386-apple-darwin9 -emit-llvm %s -o - | FileCheck %s
+
+@interface I0
+@end
+
+@implementation I0 // expected-warning {{'@end' is missing in implementation context}}
+- meth { return 0; }
+
+@interface I1 : I0
+@end
+
+@implementation I1 // expected-warning {{'@end' is missing in implementation context}}
+-(void) im0 { self = [super init]; }
+
+@interface I2 : I0
+- I2meth;
+@end
+
+@implementation I2 // expected-warning {{'@end' is missing in implementation context}}
+- I2meth { return 0; }
+
+@implementation I2(CAT) // expected-warning {{'@end' is missing in implementation context}}
+
+// CHECK: @"\01L_OBJC_CLASS_I1" = internal global
diff --git a/test/CodeGenObjC/newproperty-nested-synthesis-1.m b/test/CodeGenObjC/newproperty-nested-synthesis-1.m
index 5196b82..4d93198 100644
--- a/test/CodeGenObjC/newproperty-nested-synthesis-1.m
+++ b/test/CodeGenObjC/newproperty-nested-synthesis-1.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fnext-runtime --emit-llvm -o %t %s
+// RUN: clang-cc --emit-llvm -o %t %s
@interface Object
- (id) new;
diff --git a/test/CodeGenObjC/non-lazy-classes.m b/test/CodeGenObjC/non-lazy-classes.m
index 079cc40..367705f 100644
--- a/test/CodeGenObjC/non-lazy-classes.m
+++ b/test/CodeGenObjC/non-lazy-classes.m
@@ -1,8 +1,7 @@
// RUNX: llvm-gcc -m64 -emit-llvm -S -o %t %s &&
-// RUN: clang-cc -triple x86_64-apple-darwin10 -emit-llvm -o %t %s &&
-// RUN: grep '@".01L_OBJC_LABEL_NONLAZY_CLASS_$" = internal global \[1 x .*\] .*@"OBJC_CLASS_$_A".*, section "__DATA, __objc_nlclslist, regular, no_dead_strip", align 8' %t &&
-// RUN: grep '@".01L_OBJC_LABEL_NONLAZY_CATEGORY_$" = internal global \[1 x .*\] .*@".01l_OBJC_$_CATEGORY_A_$_Cat".*, section "__DATA, __objc_nlcatlist, regular, no_dead_strip", align 8' %t &&
-// RUN: true
+// RUN: clang-cc -fobjc-nonfragile-abi -emit-llvm -o %t %s
+// RUN: grep '@".01L_OBJC_LABEL_NONLAZY_CLASS_$" = internal global \[1 x .*\] .*@"OBJC_CLASS_$_A".*, section "__DATA, __objc_nlclslist, regular, no_dead_strip", align 8' %t
+// RUN: grep '@".01L_OBJC_LABEL_NONLAZY_CATEGORY_$" = internal global \[1 x .*\] .*@".01l_OBJC_$_CATEGORY_A_$_Cat".*, section "__DATA, __objc_nlcatlist, regular, no_dead_strip", align 8' %t
@interface A @end
@implementation A
diff --git a/test/CodeGenObjC/objc-align.m b/test/CodeGenObjC/objc-align.m
index eca5959..c029d48 100644
--- a/test/CodeGenObjC/objc-align.m
+++ b/test/CodeGenObjC/objc-align.m
@@ -1,16 +1,16 @@
// 32-bit
// RUNX: llvm-gcc -m32 -emit-llvm -S -o %t %s &&
-// RUN: clang-cc -triple i386-apple-darwin9 -emit-llvm -o %t %s &&
-// RUN: grep '@"\\01L_OBJC_CATEGORY_A_Cat" = internal global .*, section "__OBJC,__category,regular,no_dead_strip", align 4' %t &&
-// RUN: grep '@"\\01L_OBJC_CLASS_A" = internal global .*, section "__OBJC,__class,regular,no_dead_strip", align 4' %t &&
-// RUN: grep '@"\\01L_OBJC_CLASS_C" = internal global .*, section "__OBJC,__class,regular,no_dead_strip", align 4' %t &&
-// RUN: grep '@"\\01L_OBJC_CLASS_PROTOCOLS_C" = internal global .*, section "__OBJC,__cat_cls_meth,regular,no_dead_strip", align 4' %t &&
-// RUN: grep '@"\\01L_OBJC_IMAGE_INFO" = internal constant .*, section "__OBJC, __image_info,regular"' %t &&
-// RUN: grep '@"\\01L_OBJC_METACLASS_A" = internal global .*, section "__OBJC,__meta_class,regular,no_dead_strip", align 4' %t &&
-// RUN: grep '@"\\01L_OBJC_METACLASS_C" = internal global .*, section "__OBJC,__meta_class,regular,no_dead_strip", align 4' %t &&
-// RUN: grep '@"\\01L_OBJC_MODULES" = internal global .*, section "__OBJC,__module_info,regular,no_dead_strip", align 4' %t &&
-// RUN: grep '@"\\01L_OBJC_PROTOCOL_P" = internal global .*, section "__OBJC,__protocol,regular,no_dead_strip", align 4' %t &&
+// RUN: clang-cc -triple i386-apple-darwin9 -emit-llvm -o %t %s
+// RUN: grep '@"\\01L_OBJC_CATEGORY_A_Cat" = internal global .*, section "__OBJC,__category,regular,no_dead_strip", align 4' %t
+// RUN: grep '@"\\01L_OBJC_CLASS_A" = internal global .*, section "__OBJC,__class,regular,no_dead_strip", align 4' %t
+// RUN: grep '@"\\01L_OBJC_CLASS_C" = internal global .*, section "__OBJC,__class,regular,no_dead_strip", align 4' %t
+// RUN: grep '@"\\01L_OBJC_CLASS_PROTOCOLS_C" = internal global .*, section "__OBJC,__cat_cls_meth,regular,no_dead_strip", align 4' %t
+// RUN: grep '@"\\01L_OBJC_IMAGE_INFO" = internal constant .*, section "__OBJC, __image_info,regular"' %t
+// RUN: grep '@"\\01L_OBJC_METACLASS_A" = internal global .*, section "__OBJC,__meta_class,regular,no_dead_strip", align 4' %t
+// RUN: grep '@"\\01L_OBJC_METACLASS_C" = internal global .*, section "__OBJC,__meta_class,regular,no_dead_strip", align 4' %t
+// RUN: grep '@"\\01L_OBJC_MODULES" = internal global .*, section "__OBJC,__module_info,regular,no_dead_strip", align 4' %t
+// RUN: grep '@"\\01L_OBJC_PROTOCOL_P" = internal global .*, section "__OBJC,__protocol,regular,no_dead_strip", align 4' %t
// 64-bit
@@ -32,7 +32,6 @@
// RUNX: grep '@"\\01l_OBJC_METACLASS_RO_$_C" = internal global .*, section "__DATA, __objc_const", align 8' %t &&
// RUNX: grep '@"\\01l_OBJC_PROTOCOL_$_P" = weak hidden global .*, section "__DATA,__datacoal_nt,coalesced", align 8' %t &&
-// RUN: true
@interface A @end
@implementation A
diff --git a/test/CodeGenObjC/objc-assign-ivar.m b/test/CodeGenObjC/objc-assign-ivar.m
index f79faaf..795dec0 100644
--- a/test/CodeGenObjC/objc-assign-ivar.m
+++ b/test/CodeGenObjC/objc-assign-ivar.m
@@ -1,6 +1,5 @@
-// RUN: clang-cc -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s &&
-// RUN: grep -F '@objc_assign_ivar' %t | count 14 &&
-// RUN: true
+// RUN: clang-cc -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s
+// RUN: grep -F '@objc_assign_ivar' %t | count 14
typedef struct {
id element;
diff --git a/test/CodeGenObjC/objc-gc-aggr-assign.m b/test/CodeGenObjC/objc-gc-aggr-assign.m
index 96a9fdf..1646cde 100644
--- a/test/CodeGenObjC/objc-gc-aggr-assign.m
+++ b/test/CodeGenObjC/objc-gc-aggr-assign.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fnext-runtime -fobjc-gc -emit-llvm -o %t %s &&
+// RUN: clang-cc -fobjc-gc -emit-llvm -o %t %s
// RUN: grep objc_memmove_collectable %t | grep call | count 3
static int count;
diff --git a/test/CodeGenObjC/objc-read-weak-byref.m b/test/CodeGenObjC/objc-read-weak-byref.m
index 7c297be..3edaf4c 100644
--- a/test/CodeGenObjC/objc-read-weak-byref.m
+++ b/test/CodeGenObjC/objc-read-weak-byref.m
@@ -1,8 +1,7 @@
-// RUN: clang-cc -fblocks -fobjc-gc -triple x86_64-apple-darwin -S %s -o %t-64.s &&
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s &&
-// RUN: clang-cc -fblocks -fobjc-gc -triple i386-apple-darwin -S %s -o %t-32.s &&
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s &&
-// RUN: true
+// RUN: clang-cc -fblocks -fobjc-gc -triple x86_64-apple-darwin -S %s -o %t-64.s
+// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: clang-cc -fblocks -fobjc-gc -triple i386-apple-darwin -S %s -o %t-32.s
+// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
@interface NSObject
- copy;
diff --git a/test/CodeGenObjC/objc2-assign-global.m b/test/CodeGenObjC/objc2-assign-global.m
index 9b6b415..6b34796 100644
--- a/test/CodeGenObjC/objc2-assign-global.m
+++ b/test/CodeGenObjC/objc2-assign-global.m
@@ -1,6 +1,5 @@
-// RUN: clang-cc -triple x86_64-apple-darwin10 -fnext-runtime -fobjc-gc -emit-llvm -o %t %s &&
-// RUN: grep -F '@objc_assign_global' %t | count 26 &&
-// RUN: true
+// RUN: clang-cc -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s
+// RUN: grep -F '@objc_assign_global' %t | count 26
@class NSObject;
typedef const struct __CFDictionary * CFDictionaryRef;
diff --git a/test/CodeGenObjC/objc2-ivar-assign.m b/test/CodeGenObjC/objc2-ivar-assign.m
index cfdf87f2..8e9a872 100644
--- a/test/CodeGenObjC/objc2-ivar-assign.m
+++ b/test/CodeGenObjC/objc2-ivar-assign.m
@@ -1,6 +1,5 @@
-// RUN: clang-cc -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s &&
-// RUN: grep objc_assign_ivar %t | count 6 &&
-// RUN: true
+// RUN: clang-cc -fobjc-nonfragile-abi -fobjc-gc -emit-llvm -o %t %s
+// RUN: grep objc_assign_ivar %t | count 6
@interface I @end
diff --git a/test/CodeGenObjC/objc2-new-gc-api-strongcast.m b/test/CodeGenObjC/objc2-new-gc-api-strongcast.m
index 6a1aea6..b6a0c03 100644
--- a/test/CodeGenObjC/objc2-new-gc-api-strongcast.m
+++ b/test/CodeGenObjC/objc2-new-gc-api-strongcast.m
@@ -1,6 +1,5 @@
-// RUN: clang-cc -triple x86_64-apple-darwin10 -fblocks -fnext-runtime -fobjc-gc -emit-llvm -o %t %s &&
-// RUN: grep -F '@objc_assign_strongCast' %t | count 4 &&
-// RUN: true
+// RUN: clang-cc -triple x86_64-apple-darwin10 -fblocks -fobjc-gc -emit-llvm -o %t %s
+// RUN: grep -F '@objc_assign_strongCast' %t | count 4
@interface DSATextSearch @end
diff --git a/test/CodeGenObjC/objc2-no-write-barrier.m b/test/CodeGenObjC/objc2-no-write-barrier.m
index 2c53509..b41f63f 100644
--- a/test/CodeGenObjC/objc2-no-write-barrier.m
+++ b/test/CodeGenObjC/objc2-no-write-barrier.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple x86_64-apple-darwin9 -fobjc-gc -emit-llvm -o %t %s &&
+// RUN: clang-cc -triple x86_64-apple-darwin9 -fobjc-gc -emit-llvm -o %t %s
// RUN: grep 'objc_assign' %t | count 0
typedef struct {
diff --git a/test/CodeGenObjC/objc2-property-encode.m b/test/CodeGenObjC/objc2-property-encode.m
index 2bff2fc..f1c1024 100644
--- a/test/CodeGenObjC/objc2-property-encode.m
+++ b/test/CodeGenObjC/objc2-property-encode.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple=i686-apple-darwin9 -fnext-runtime -emit-llvm -o %t %s &&
+// RUN: clang-cc -triple=i686-apple-darwin9 -emit-llvm -o %t %s
// RUN: grep -e "T@\\\\22NSString\\\\22" %t
@interface NSString @end
diff --git a/test/CodeGenObjC/objc2-protocol-enc.m b/test/CodeGenObjC/objc2-protocol-enc.m
index 559b0b8..2174792 100644
--- a/test/CodeGenObjC/objc2-protocol-enc.m
+++ b/test/CodeGenObjC/objc2-protocol-enc.m
@@ -1,7 +1,7 @@
-// RUN: clang-cc -triple=i686-apple-darwin9 -fnext-runtime -emit-llvm -o %t %s &&
-// RUN: grep -e "T@\\\22<X>\\\22" %t &&
-// RUN: grep -e "T@\\\22<X><Y>\\\22" %t &&
-// RUN: grep -e "T@\\\22<X><Y><Z>\\\22" %t &&
+// RUN: clang-cc -triple=i686-apple-darwin9 -emit-llvm -o %t %s
+// RUN: grep -e "T@\\\22<X>\\\22" %t
+// RUN: grep -e "T@\\\22<X><Y>\\\22" %t
+// RUN: grep -e "T@\\\22<X><Y><Z>\\\22" %t
// RUN: grep -e "T@\\\22Foo<X><Y><Z>\\\22" %t
@protocol X, Y, Z;
diff --git a/test/CodeGenObjC/objc2-strong-cast.m b/test/CodeGenObjC/objc2-strong-cast.m
index d0fcb6c..73fe16a 100644
--- a/test/CodeGenObjC/objc2-strong-cast.m
+++ b/test/CodeGenObjC/objc2-strong-cast.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fnext-runtime -fobjc-gc -emit-llvm -o %t %s
+// RUN: clang-cc -fobjc-gc -emit-llvm -o %t %s
@interface I {
__attribute__((objc_gc(strong))) signed long *_documentIDs;
diff --git a/test/CodeGenObjC/objc2-weak-assign.m b/test/CodeGenObjC/objc2-weak-assign.m
index 635ca38..ea53b02 100644
--- a/test/CodeGenObjC/objc2-weak-assign.m
+++ b/test/CodeGenObjC/objc2-weak-assign.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple x86_64-apple-darwin9 -fobjc-gc -emit-llvm -o %t %s &&
+// RUN: clang-cc -triple x86_64-apple-darwin9 -fobjc-gc -emit-llvm -o %t %s
// RUN: grep -e "objc_assign_weak" %t | grep -e "call" | count 6
__weak id* x;
diff --git a/test/CodeGenObjC/objc2-weak-compare.m b/test/CodeGenObjC/objc2-weak-compare.m
index be76989..82cc558 100644
--- a/test/CodeGenObjC/objc2-weak-compare.m
+++ b/test/CodeGenObjC/objc2-weak-compare.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-apple-darwin9 -fnext-runtime -fobjc-gc -emit-llvm -o %t %s
+// RUN: clang-cc -triple i386-apple-darwin9 -fobjc-gc -emit-llvm -o %t %s
@interface PBXTarget
{
diff --git a/test/CodeGenObjC/objc2-weak-import-attribute.m b/test/CodeGenObjC/objc2-weak-import-attribute.m
new file mode 100644
index 0000000..4a5f14e
--- /dev/null
+++ b/test/CodeGenObjC/objc2-weak-import-attribute.m
@@ -0,0 +1,34 @@
+// RUN: clang-cc -fobjc-nonfragile-abi -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-X86-64 %s
+
+__attribute__((weak_import)) @interface WeakClass
+@end
+
+@interface MySubclass : WeakClass @end
+
+@implementation MySubclass @end
+
+@implementation WeakClass(MyCategory) @end
+
+
+__attribute__((weak_import))
+@interface WeakClass1 @end
+
+@implementation WeakClass1(MyCategory) @end
+
+@implementation WeakClass1(YourCategory) @end
+
+ __attribute__((weak_import))
+@interface WeakClass3
++ message;
+@end
+
+int main() {
+ [WeakClass3 message];
+}
+
+// CHECK-X86-64: OBJC_METACLASS_$_WeakClass" = extern_weak global
+// CHECK-X86-64: OBJC_CLASS_$_WeakClass" = extern_weak global
+// CHECK-X86-64: OBJC_CLASS_$_WeakClass1" = extern_weak global
+// CHECK-X86-64: OBJC_CLASS_$_WeakClass3" = extern_weak global
+
+
diff --git a/test/CodeGenObjC/objc2-weak-ivar-debug.m b/test/CodeGenObjC/objc2-weak-ivar-debug.m
index 24a7757..3930989 100644
--- a/test/CodeGenObjC/objc2-weak-ivar-debug.m
+++ b/test/CodeGenObjC/objc2-weak-ivar-debug.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple x86_64-apple-darwin9 -fobjc-gc -g -emit-llvm -o - %s &&
+// RUN: clang-cc -triple x86_64-apple-darwin9 -fobjc-gc -g -emit-llvm -o - %s
// RUN: clang-cc -triple i386-apple-darwin9 -fobjc-gc -g -emit-llvm -o - %s
// rdar://7252252
diff --git a/test/CodeGenObjC/objc2-write-barrier-2.m b/test/CodeGenObjC/objc2-write-barrier-2.m
index c47224f..cdb135f 100644
--- a/test/CodeGenObjC/objc2-write-barrier-2.m
+++ b/test/CodeGenObjC/objc2-write-barrier-2.m
@@ -1,8 +1,7 @@
-// RUN: clang-cc -triple x86_64-apple-darwin10 -fnext-runtime -fobjc-gc -emit-llvm -o %t %s &&
-// RUN: grep -F '@objc_assign_global' %t | count 7 &&
-// RUN: grep -F '@objc_assign_ivar' %t | count 5 &&
-// RUN: grep -F '@objc_assign_strongCast' %t | count 8 &&
-// RUN: true
+// RUN: clang-cc -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s
+// RUN: grep -F '@objc_assign_global' %t | count 7
+// RUN: grep -F '@objc_assign_ivar' %t | count 5
+// RUN: grep -F '@objc_assign_strongCast' %t | count 8
extern id **somefunc(void);
extern id *somefunc2(void);
diff --git a/test/CodeGenObjC/objc2-write-barrier-3.m b/test/CodeGenObjC/objc2-write-barrier-3.m
index 2fb416b..7058302 100644
--- a/test/CodeGenObjC/objc2-write-barrier-3.m
+++ b/test/CodeGenObjC/objc2-write-barrier-3.m
@@ -1,7 +1,6 @@
-// RUN: clang-cc -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s &&
-// RUN: grep objc_assign_ivar %t | count 3 &&
-// RUN: grep objc_assign_strongCast %t | count 6 &&
-// RUN: true
+// RUN: clang-cc -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fblocks -fobjc-gc -emit-llvm -o %t %s
+// RUN: grep objc_assign_ivar %t | count 3
+// RUN: grep objc_assign_strongCast %t | count 6
struct Slice {
void *__strong * items;
diff --git a/test/CodeGenObjC/objc2-write-barrier-4.m b/test/CodeGenObjC/objc2-write-barrier-4.m
index f96a233..4c863f4 100644
--- a/test/CodeGenObjC/objc2-write-barrier-4.m
+++ b/test/CodeGenObjC/objc2-write-barrier-4.m
@@ -1,7 +1,6 @@
-// RUN: clang-cc -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s &&
-// RUN: grep objc_assign_global %t | count 3 &&
-// RUN: grep objc_assign_strongCast %t | count 2 &&
-// RUN: true
+// RUN: clang-cc -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s
+// RUN: grep objc_assign_global %t | count 3
+// RUN: grep objc_assign_strongCast %t | count 2
@interface A
@end
diff --git a/test/CodeGenObjC/objc2-write-barrier-5.m b/test/CodeGenObjC/objc2-write-barrier-5.m
index 5b8f02c..2e51b44 100644
--- a/test/CodeGenObjC/objc2-write-barrier-5.m
+++ b/test/CodeGenObjC/objc2-write-barrier-5.m
@@ -1,7 +1,6 @@
-// RUN: clang-cc -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s &&
-// RUN: grep objc_assign_ivar %t | count 0 &&
-// RUN: grep objc_assign_strongCast %t | count 5 &&
-// RUN: true
+// RUN: clang-cc -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s
+// RUN: grep objc_assign_ivar %t | count 0
+// RUN: grep objc_assign_strongCast %t | count 5
@interface TestUnarchiver
{
diff --git a/test/CodeGenObjC/objc2-write-barrier.m b/test/CodeGenObjC/objc2-write-barrier.m
index 53fa10a..bff6d8f 100644
--- a/test/CodeGenObjC/objc2-write-barrier.m
+++ b/test/CodeGenObjC/objc2-write-barrier.m
@@ -1,7 +1,6 @@
-// RUN: clang-cc -triple x86_64-apple-darwin10 -fnext-runtime -fobjc-gc -emit-llvm -o %t %s &&
-// RUN: grep -F '@objc_assign_global' %t | count 21 &&
-// RUN: grep -F '@objc_assign_ivar' %t | count 11 &&
-// RUN: true
+// RUN: clang-cc -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s
+// RUN: grep -F '@objc_assign_global' %t | count 21
+// RUN: grep -F '@objc_assign_ivar' %t | count 11
typedef const struct __CFDictionary * CFDictionaryRef;
diff --git a/test/CodeGenObjC/object-incr-decr-1.m b/test/CodeGenObjC/object-incr-decr-1.m
index 53311f7..25b9698 100644
--- a/test/CodeGenObjC/object-incr-decr-1.m
+++ b/test/CodeGenObjC/object-incr-decr-1.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-apple-darwin9 -fnext-runtime -emit-llvm %s -o %t
+// RUN: clang-cc -triple i386-apple-darwin9 -emit-llvm %s -o %t
@interface Foo
{
diff --git a/test/CodeGenObjC/overloadable.m b/test/CodeGenObjC/overloadable.m
index 7e9cc3d..bd3aff8 100644
--- a/test/CodeGenObjC/overloadable.m
+++ b/test/CodeGenObjC/overloadable.m
@@ -1,9 +1,9 @@
// rdar://6657613
-// RUN: clang-cc -emit-llvm %s -o %t &&
+// RUN: clang-cc -emit-llvm %s -o %t
@class C;
-// RUN: grep _Z1fP11objc_object %t | count 1 &&
+// RUN: grep _Z1fP11objc_object %t | count 1
void __attribute__((overloadable)) f(id c) { }
// RUN: grep _Z1fP1C %t | count 1
diff --git a/test/CodeGenObjC/property-aggr-type.m b/test/CodeGenObjC/property-aggr-type.m
index 0cb7a5e..e2890b6 100644
--- a/test/CodeGenObjC/property-aggr-type.m
+++ b/test/CodeGenObjC/property-aggr-type.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -emit-llvm -o %t %s
@interface Object
- (id) new;
diff --git a/test/CodeGenObjC/property-agrr-getter.m b/test/CodeGenObjC/property-agrr-getter.m
index 4620579..e25429e 100644
--- a/test/CodeGenObjC/property-agrr-getter.m
+++ b/test/CodeGenObjC/property-agrr-getter.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -emit-llvm -o %t %s
typedef struct {
unsigned f0;
diff --git a/test/CodeGenObjC/property-complex.m b/test/CodeGenObjC/property-complex.m
index 2e23ca4..aedb1fa 100644
--- a/test/CodeGenObjC/property-complex.m
+++ b/test/CodeGenObjC/property-complex.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-apple-darwin9 -emit-llvm -S -o - %s &&
+// RUN: clang-cc -triple i386-apple-darwin9 -emit-llvm -S -o - %s
// RUN: clang-cc -triple x86_64-apple-darwin9 -emit-llvm -S -o - %s
@interface I0 {
diff --git a/test/CodeGenObjC/property-getter-dot-syntax.m b/test/CodeGenObjC/property-getter-dot-syntax.m
index d98e9ba..c1cc5e9 100644
--- a/test/CodeGenObjC/property-getter-dot-syntax.m
+++ b/test/CodeGenObjC/property-getter-dot-syntax.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fnext-runtime --emit-llvm -o %t %s
+// RUN: clang-cc --emit-llvm -o %t %s
@protocol NSObject
- (void *)description;
diff --git a/test/CodeGenObjC/property-incr-decr-1.m b/test/CodeGenObjC/property-incr-decr-1.m
index 772e872a..eb227dd 100644
--- a/test/CodeGenObjC/property-incr-decr-1.m
+++ b/test/CodeGenObjC/property-incr-decr-1.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -emit-llvm -o %t %s
@interface Object
- (id) new;
diff --git a/test/CodeGenObjC/property-setter-attr.m b/test/CodeGenObjC/property-setter-attr.m
index 5f0edf8..3903924 100644
--- a/test/CodeGenObjC/property-setter-attr.m
+++ b/test/CodeGenObjC/property-setter-attr.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -emit-llvm -triple=i686-apple-darwin8 -o %t %s &&
+// RUN: clang-cc -emit-llvm -triple=i686-apple-darwin8 -o %t %s
// RUN: grep -e "SiSetOtherThings:" %t
@interface A
diff --git a/test/CodeGenObjC/property.m b/test/CodeGenObjC/property.m
index 264adf1..59f096f 100644
--- a/test/CodeGenObjC/property.m
+++ b/test/CodeGenObjC/property.m
@@ -1,6 +1,6 @@
-// RUN: clang-cc -fnext-runtime --emit-llvm -o %t %s
+// RUN: clang-cc --emit-llvm -o %t %s
-#include <stdio.h>
+int printf(const char *, ...);
@interface Root
-(id) alloc;
diff --git a/test/CodeGenObjC/protocol-in-extended-class.m b/test/CodeGenObjC/protocol-in-extended-class.m
index 87bda46..cad59b0 100644
--- a/test/CodeGenObjC/protocol-in-extended-class.m
+++ b/test/CodeGenObjC/protocol-in-extended-class.m
@@ -1,8 +1,7 @@
-// RUN: clang-cc -triple x86_64-apple-darwin10 -S %s -o %t-64.s &&
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s &&
-// RUN: clang-cc -triple i386-apple-darwin -S %s -o %t-32.s &&
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s &&
-// RUN: true
+// RUN: clang-cc -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -S %s -o %t-64.s
+// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: clang-cc -triple i386-apple-darwin -S %s -o %t-32.s
+// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
@protocol MyProtocol
@end
diff --git a/test/CodeGenObjC/protocol-property-synth.m b/test/CodeGenObjC/protocol-property-synth.m
index e91f355..ab230af 100644
--- a/test/CodeGenObjC/protocol-property-synth.m
+++ b/test/CodeGenObjC/protocol-property-synth.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple x86_64-apple-darwin10 -emit-llvm -o %t %s
+// RUN: clang-cc -fobjc-nonfragile-abi -emit-llvm -o %t %s
@interface BaseClass {
id _delegate;
diff --git a/test/CodeGenObjC/protocols-lazy.m b/test/CodeGenObjC/protocols-lazy.m
index a8f7902..54ca19c 100644
--- a/test/CodeGenObjC/protocols-lazy.m
+++ b/test/CodeGenObjC/protocols-lazy.m
@@ -1,36 +1,36 @@
-// RUN: clang-cc -emit-llvm -triple=i686-apple-darwin8 -o %t %s &&
+// RUN: clang-cc -emit-llvm -triple=i686-apple-darwin8 -o %t %s
// RUNX: llvm-gcc -S -emit-llvm -o %t %s &&
// No object generated
-// RUN: grep OBJC_PROTOCOL_P0 %t | count 0 &&
+// RUN: grep OBJC_PROTOCOL_P0 %t | count 0
@protocol P0;
// No object generated
-// RUN: grep OBJC_PROTOCOL_P1 %t | count 0 &&
+// RUN: grep OBJC_PROTOCOL_P1 %t | count 0
@protocol P1 -im1; @end
// Definition triggered by protocol reference.
-// RUN: grep OBJC_PROTOCOL_P2 %t | count 3 &&
-// RUN: grep OBJC_PROTOCOL_INSTANCE_METHODS_P2 %t | count 3 &&
+// RUN: grep OBJC_PROTOCOL_P2 %t | count 3
+// RUN: grep OBJC_PROTOCOL_INSTANCE_METHODS_P2 %t | count 3
@protocol P2 -im1; @end
void f0() { id x = @protocol(P2); }
// Forward definition triggered by protocol reference.
-// RUN: grep OBJC_PROTOCOL_P3 %t | count 3 &&
-// RUN: grep OBJC_PROTOCOL_INSTANCE_METHODS_P3 %t | count 0 &&
+// RUN: grep OBJC_PROTOCOL_P3 %t | count 3
+// RUN: grep OBJC_PROTOCOL_INSTANCE_METHODS_P3 %t | count 0
@protocol P3;
void f1() { id x = @protocol(P3); }
// Definition triggered by class reference.
-// RUN: grep OBJC_PROTOCOL_P4 %t | count 3 &&
-// RUN: grep OBJC_PROTOCOL_INSTANCE_METHODS_P4 %t | count 3 &&
+// RUN: grep OBJC_PROTOCOL_P4 %t | count 3
+// RUN: grep OBJC_PROTOCOL_INSTANCE_METHODS_P4 %t | count 3
@protocol P4 -im1; @end
@interface I0<P4> @end
@implementation I0 -im1 { return 0; }; @end
// Definition following forward reference.
-// RUN: grep OBJC_PROTOCOL_P5 %t | count 3 &&
-// RUN: grep OBJC_PROTOCOL_INSTANCE_METHODS_P5 %t | count 3 &&
+// RUN: grep OBJC_PROTOCOL_P5 %t | count 3
+// RUN: grep OBJC_PROTOCOL_INSTANCE_METHODS_P5 %t | count 3
@protocol P5;
void f2() { id x = @protocol(P5); } // This generates a forward
// reference, which has to be
@@ -38,11 +38,10 @@ void f2() { id x = @protocol(P5); } // This generates a forward
@protocol P5 -im1; @end
// Protocol reference following definition.
-// RUN: grep OBJC_PROTOCOL_P6 %t | count 4 &&
-// RUN: grep OBJC_PROTOCOL_INSTANCE_METHODS_P6 %t | count 3 &&
+// RUN: grep OBJC_PROTOCOL_P6 %t | count 4
+// RUN: grep OBJC_PROTOCOL_INSTANCE_METHODS_P6 %t | count 3
@protocol P6 -im1; @end
@interface I1<P6> @end
@implementation I1 -im1 { return 0; }; @end
void f3() { id x = @protocol(P6); }
-// RUN: true
diff --git a/test/CodeGenObjC/protocols.m b/test/CodeGenObjC/protocols.m
index 4cfb83b..c510685 100644
--- a/test/CodeGenObjC/protocols.m
+++ b/test/CodeGenObjC/protocols.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fnext-runtime -emit-llvm %s -o %t
+// RUN: clang-cc -emit-llvm %s -o %t
void p(const char*, ...);
diff --git a/test/CodeGenObjC/runtime-fns.m b/test/CodeGenObjC/runtime-fns.m
index 0d85707..3c6894d 100644
--- a/test/CodeGenObjC/runtime-fns.m
+++ b/test/CodeGenObjC/runtime-fns.m
@@ -1,6 +1,6 @@
-// RUN: clang-cc -fnext-runtime -emit-llvm -o %t %s &&
-// RUN: grep -e "^de.*objc_msgSend[0-9]*(" %t | count 1 &&
-// RUN: clang-cc -DWITHDEF -fnext-runtime -emit-llvm -o %t %s &&
+// RUN: clang-cc -emit-llvm -o %t %s
+// RUN: grep -e "^de.*objc_msgSend[0-9]*(" %t | count 1
+// RUN: clang-cc -DWITHDEF -emit-llvm -o %t %s
// RUN: grep -e "^de.*objc_msgSend[0-9]*(" %t | count 1
id objc_msgSend(int x);
diff --git a/test/CodeGenObjC/super-classmethod-category.m b/test/CodeGenObjC/super-classmethod-category.m
index 27cdbf6..033bc97 100644
--- a/test/CodeGenObjC/super-classmethod-category.m
+++ b/test/CodeGenObjC/super-classmethod-category.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -emit-llvm -o %t %s
@interface SUPER
+ (void)Meth;
diff --git a/test/CodeGenObjC/super-message-fragileabi.m b/test/CodeGenObjC/super-message-fragileabi.m
new file mode 100644
index 0000000..edc26a1
--- /dev/null
+++ b/test/CodeGenObjC/super-message-fragileabi.m
@@ -0,0 +1,32 @@
+// RUN: clang-cc -triple i386-apple-darwin9 -emit-llvm %s -o - | FileCheck %s
+
+@class Some;
+
+@protocol Proto
+- (id)initSome:(Some *)anArg;
+@end
+
+
+@interface Table <Proto>
+@end
+
+@interface BetterTable: Table
+
+- (id)initSome:(Some *)arg;
+
+@end
+
+@implementation BetterTable
+
+- (id)initSome:(Some *)arg {
+
+ if(self=[super initSome:arg])
+ {
+ ;
+ }
+// CHECK: load %struct._objc_class** getelementptr inbounds (%struct._objc_class* @"\01L_OBJC_CLASS_BetterTable", i32 0, i32 1)
+
+ return self;
+}
+@end
+
diff --git a/test/CodeGenObjC/synchronized.m b/test/CodeGenObjC/synchronized.m
index b398ca6..8147cd1 100644
--- a/test/CodeGenObjC/synchronized.m
+++ b/test/CodeGenObjC/synchronized.m
@@ -1,5 +1,5 @@
-// RUN: clang-cc -emit-llvm -triple=i686-apple-darwin9 -o %t %s -O2 &&
-// RUN: grep 'ret i32' %t | count 1 &&
+// RUN: clang-cc -emit-llvm -triple=i686-apple-darwin9 -o %t %s -O2
+// RUN: grep 'ret i32' %t | count 1
// RUN: grep 'ret i32 1' %t | count 1
@interface MyClass
diff --git a/test/CodeGenObjC/synthesize_ivar-cont-class.m b/test/CodeGenObjC/synthesize_ivar-cont-class.m
index b1a7d0e..dd444c3 100644
--- a/test/CodeGenObjC/synthesize_ivar-cont-class.m
+++ b/test/CodeGenObjC/synthesize_ivar-cont-class.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple x86_64-apple-darwin10 -emit-llvm -o %t %s &&
+// RUN: clang-cc -fobjc-nonfragile-abi -emit-llvm -o %t %s
// RUN: grep '@"OBJC_IVAR_$_XCOrganizerDeviceNodeInfo.viewController"' %t
@interface XCOrganizerNodeInfo
diff --git a/test/CodeGenObjC/synthesize_ivar.m b/test/CodeGenObjC/synthesize_ivar.m
index e1746f1..9ed08d9 100644
--- a/test/CodeGenObjC/synthesize_ivar.m
+++ b/test/CodeGenObjC/synthesize_ivar.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple x86_64-apple-darwin10 -emit-llvm -o %t %s
+// RUN: clang-cc -fobjc-nonfragile-abi -emit-llvm -o %t %s
@interface I
@property int IP;
diff --git a/test/CodeGenObjC/try.m b/test/CodeGenObjC/try.m
index 7701b23..eebc482 100644
--- a/test/CodeGenObjC/try.m
+++ b/test/CodeGenObjC/try.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc %s -S -o - -triple=i686-apple-darwin9 &&
+// RUN: clang-cc %s -S -o - -triple=i686-apple-darwin9
// RUN: clang-cc %s -S -o - -triple=x86_64-apple-darwin9
// rdar://6757213 - Don't crash if the internal proto for
diff --git a/test/CodeGenObjC/unname-bf-metadata.m b/test/CodeGenObjC/unname-bf-metadata.m
index a7636e4..605d09b 100644
--- a/test/CodeGenObjC/unname-bf-metadata.m
+++ b/test/CodeGenObjC/unname-bf-metadata.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -emit-llvm -o %t %s
// Test that meta-data for ivar lists with unnamed bitfield are generated.
//
@interface Foo {
diff --git a/test/CodeGenObjC/variadic-sends.m b/test/CodeGenObjC/variadic-sends.m
index 8697fee..e2d13e3 100644
--- a/test/CodeGenObjC/variadic-sends.m
+++ b/test/CodeGenObjC/variadic-sends.m
@@ -1,5 +1,5 @@
-// RUN: clang-cc -triple i386-unknown-unknown -fnext-runtime -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-X86-32 %s &&
-// RUN: clang-cc -triple x86_64-unknown-unknown -fnext-runtime -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-X86-64 %s
+// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-X86-32 %s
+// RUN: clang-cc -triple x86_64-unknown-unknown -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-X86-64 %s
@interface A
-(void) im0;
diff --git a/test/Coverage/ast-printing.c b/test/Coverage/ast-printing.c
index efa9509..2bed12e 100644
--- a/test/Coverage/ast-printing.c
+++ b/test/Coverage/ast-printing.c
@@ -1,6 +1,6 @@
-// RUN: clang-cc --fsyntax-only %s &&
-// RUN: clang-cc --ast-print %s &&
-// RUN: clang-cc --ast-dump %s &&
+// RUN: clang-cc --fsyntax-only %s
+// RUN: clang-cc --ast-print %s
+// RUN: clang-cc --ast-dump %s
// RUN: clang-cc --ast-print-xml -o %t %s
#include "c-language-features.inc"
diff --git a/test/Coverage/ast-printing.cpp b/test/Coverage/ast-printing.cpp
index 10d01c7..93c7191 100644
--- a/test/Coverage/ast-printing.cpp
+++ b/test/Coverage/ast-printing.cpp
@@ -1,5 +1,5 @@
-// RUN: clang-cc --fsyntax-only %s &&
-// RUN: clang-cc --ast-print %s &&
+// RUN: clang-cc --fsyntax-only %s
+// RUN: clang-cc --ast-print %s
// RUN: clang-cc --ast-dump %s
// FIXME: clang-cc --ast-print-xml -o %t %s
diff --git a/test/Coverage/ast-printing.m b/test/Coverage/ast-printing.m
index 85bbd43..e7589b8 100644
--- a/test/Coverage/ast-printing.m
+++ b/test/Coverage/ast-printing.m
@@ -1,5 +1,5 @@
-// RUN: clang-cc --fsyntax-only %s &&
-// RUN: clang-cc --ast-print %s &&
+// RUN: clang-cc --fsyntax-only %s
+// RUN: clang-cc --ast-print %s
// RUN: clang-cc --ast-dump %s
#include "objc-language-features.inc"
diff --git a/test/Coverage/codegen-next.m b/test/Coverage/codegen-next.m
index bca83cb..f211a59 100644
--- a/test/Coverage/codegen-next.m
+++ b/test/Coverage/codegen-next.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fnext-runtime -emit-llvm -o %t %s &&
-// RUN: clang-cc -g -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -emit-llvm -o %t %s
+// RUN: clang-cc -g -emit-llvm -o %t %s
#include "objc-language-features.inc"
diff --git a/test/Coverage/codegen.c b/test/Coverage/codegen.c
index 543c361..f1d7fcc 100644
--- a/test/Coverage/codegen.c
+++ b/test/Coverage/codegen.c
@@ -1,7 +1,7 @@
-// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm -o %t %s &&
-// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm-bc -o %t %s &&
-// RUN: clang-cc -triple i386-unknown-unknown -g -emit-llvm-bc -o %t %s &&
-// RUN: clang-cc -triple x86_64-unknown-unknown -emit-llvm-bc -o %t %s &&
+// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm -o %t %s
+// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm-bc -o %t %s
+// RUN: clang-cc -triple i386-unknown-unknown -g -emit-llvm-bc -o %t %s
+// RUN: clang-cc -triple x86_64-unknown-unknown -emit-llvm-bc -o %t %s
// RUN: clang-cc -triple x86_64-unknown-unknown -g -emit-llvm-bc -o %t %s
#include "c-language-features.inc"
diff --git a/test/Coverage/html-diagnostics.c b/test/Coverage/html-diagnostics.c
index 55376d0..3079632 100644
--- a/test/Coverage/html-diagnostics.c
+++ b/test/Coverage/html-diagnostics.c
@@ -1,5 +1,5 @@
-// RUN: rm -rf %t &&
-// RUN: clang-cc -analyze -analyzer-output=html -checker-cfref -o %t %s &&
+// RUN: rm -rf %t
+// RUN: clang-cc -analyze -analyzer-output=html -checker-cfref -o %t %s
// RUN: cat %t/*.html | FileCheck %s
// CHECK: <h3>Annotated Source Code</h3>
diff --git a/test/Coverage/parse-callbacks.c b/test/Coverage/parse-callbacks.c
index 309074d..537d630 100644
--- a/test/Coverage/parse-callbacks.c
+++ b/test/Coverage/parse-callbacks.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc --parse-noop %s &&
+// RUN: clang-cc --parse-noop %s
// RUN: clang-cc --parse-print-callbacks %s
#include "c-language-features.inc"
diff --git a/test/Coverage/parse-callbacks.m b/test/Coverage/parse-callbacks.m
index dc1dcfc..fc240cf 100644
--- a/test/Coverage/parse-callbacks.m
+++ b/test/Coverage/parse-callbacks.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc --parse-noop %s &&
+// RUN: clang-cc --parse-noop %s
// RUN: clang-cc --parse-print-callbacks %s
#include "objc-language-features.inc"
diff --git a/test/Coverage/targets.c b/test/Coverage/targets.c
index c4f030f..23990e0 100644
--- a/test/Coverage/targets.c
+++ b/test/Coverage/targets.c
@@ -1,23 +1,22 @@
-// RUN: clang-cc -g -triple armv6-apple-darwin9 -emit-llvm -o %t %s &&
-// RUN: clang-cc -g -triple armv6-unknown-unknown -emit-llvm -o %t %s &&
-// RUN: clang-cc -g -triple bfin-unknown-unknown -emit-llvm -o %t %s &&
-// RUN: clang-cc -g -triple i686-apple-darwin9 -emit-llvm -o %t %s &&
-// RUN: clang-cc -g -triple i686-pc-linux-gnu -emit-llvm -o %t %s &&
-// RUN: clang-cc -g -triple i686-unknown-dragonfly -emit-llvm -o %t %s &&
-// RUN: clang-cc -g -triple i686-unknown-unknown -emit-llvm -o %t %s &&
-// RUN: clang-cc -g -triple i686-unknown-win32 -emit-llvm -o %t %s &&
-// RUN: clang-cc -g -triple pic16-unknown-unknown -emit-llvm -o %t %s &&
-// RUN: clang-cc -g -triple powerpc-apple-darwin9 -emit-llvm -o %t %s &&
-// RUN: clang-cc -g -triple powerpc-unknown-unknown -emit-llvm -o %t %s &&
-// RUN: clang-cc -g -triple powerpc64-apple-darwin9 -emit-llvm -o %t %s &&
-// RUN: clang-cc -g -triple powerpc64-unknown-unknown -emit-llvm -o %t %s &&
-// RUN: clang-cc -g -triple sparc-unknown-solaris -emit-llvm -o %t %s &&
-// RUN: clang-cc -g -triple sparc-unknown-unknown -emit-llvm -o %t %s &&
-// RUN: clang-cc -g -triple x86_64-apple-darwin9 -emit-llvm -o %t %s &&
-// RUN: clang-cc -g -triple x86_64-pc-linux-gnu -emit-llvm -o %t %s &&
-// RUN: clang-cc -g -triple x86_64-unknown-unknown -emit-llvm -o %t %s &&
+// RUN: clang-cc -g -triple armv6-apple-darwin9 -emit-llvm -o %t %s
+// RUN: clang-cc -g -triple armv6-unknown-unknown -emit-llvm -o %t %s
+// RUN: clang-cc -g -triple bfin-unknown-unknown -emit-llvm -o %t %s
+// RUN: clang-cc -g -triple i686-apple-darwin9 -emit-llvm -o %t %s
+// RUN: clang-cc -g -triple i686-pc-linux-gnu -emit-llvm -o %t %s
+// RUN: clang-cc -g -triple i686-unknown-dragonfly -emit-llvm -o %t %s
+// RUN: clang-cc -g -triple i686-unknown-unknown -emit-llvm -o %t %s
+// RUN: clang-cc -g -triple i686-unknown-win32 -emit-llvm -o %t %s
+// RUN: clang-cc -g -triple pic16-unknown-unknown -emit-llvm -o %t %s
+// RUN: clang-cc -g -triple powerpc-apple-darwin9 -emit-llvm -o %t %s
+// RUN: clang-cc -g -triple powerpc-unknown-unknown -emit-llvm -o %t %s
+// RUN: clang-cc -g -triple powerpc64-apple-darwin9 -emit-llvm -o %t %s
+// RUN: clang-cc -g -triple powerpc64-unknown-unknown -emit-llvm -o %t %s
+// RUN: clang-cc -g -triple sparc-unknown-solaris -emit-llvm -o %t %s
+// RUN: clang-cc -g -triple sparc-unknown-unknown -emit-llvm -o %t %s
+// RUN: clang-cc -g -triple x86_64-apple-darwin9 -emit-llvm -o %t %s
+// RUN: clang-cc -g -triple x86_64-pc-linux-gnu -emit-llvm -o %t %s
+// RUN: clang-cc -g -triple x86_64-unknown-unknown -emit-llvm -o %t %s
// <rdar://problem/7181838> clang 1.0 fails to compile Python 2.6
-// RUN: clang -ccc-host-triple x86_64-apple-darwin9 -### -S %s -mmacosx-version-min=10.4 &&
+// RUN: clang -ccc-host-triple x86_64-apple-darwin9 -### -S %s -mmacosx-version-min=10.4
-// RUN: true
diff --git a/test/Driver/Xarch.c b/test/Driver/Xarch.c
index a2a3fde..ba6f5c6 100644
--- a/test/Driver/Xarch.c
+++ b/test/Driver/Xarch.c
@@ -1,10 +1,9 @@
-// RUN: clang -ccc-host-triple i386-apple-darwin9 -m32 -Xarch_i386 -O2 %s -S -### 2> %t.log &&
-// RUN: grep ' "-O2" ' %t.log | count 1 &&
-// RUN: clang -ccc-host-triple i386-apple-darwin9 -m64 -Xarch_i386 -O2 %s -S -### 2> %t.log &&
-// RUN: grep ' "-O2" ' %t.log | count 0 &&
-// RUN: grep "argument unused during compilation: '-Xarch_i386 -O2'" %t.log &&
-// RUN: not clang -ccc-host-triple i386-apple-darwin9 -m32 -Xarch_i386 -o -Xarch_i386 -S %s -S -Xarch_i386 -o 2> %t.log &&
-// RUN: grep "error: invalid Xarch argument: '-Xarch_i386 -o'" %t.log | count 2 &&
-// RUN: grep "error: invalid Xarch argument: '-Xarch_i386 -S'" %t.log &&
-// RUN: true
+// RUN: clang -ccc-host-triple i386-apple-darwin9 -m32 -Xarch_i386 -O2 %s -S -### 2> %t.log
+// RUN: grep ' "-O2" ' %t.log | count 1
+// RUN: clang -ccc-host-triple i386-apple-darwin9 -m64 -Xarch_i386 -O2 %s -S -### 2> %t.log
+// RUN: grep ' "-O2" ' %t.log | count 0
+// RUN: grep "argument unused during compilation: '-Xarch_i386 -O2'" %t.log
+// RUN: not clang -ccc-host-triple i386-apple-darwin9 -m32 -Xarch_i386 -o -Xarch_i386 -S %s -S -Xarch_i386 -o 2> %t.log
+// RUN: grep "error: invalid Xarch argument: '-Xarch_i386 -o'" %t.log | count 2
+// RUN: grep "error: invalid Xarch argument: '-Xarch_i386 -S'" %t.log
diff --git a/test/Driver/analyze.c b/test/Driver/analyze.c
index 0381068..ff35cc5 100644
--- a/test/Driver/analyze.c
+++ b/test/Driver/analyze.c
@@ -1,7 +1,7 @@
// Verify that the analyzer gets the same flags as normal compilation
// (at least for a few key ones).
-// RUN: env MACOSX_DEPLOYMENT_TARGET=10.5 clang -ccc-host-triple i386-apple-darwin9 -### --analyze -o /dev/null %s -msse 2> %t.log &&
+// RUN: env MACOSX_DEPLOYMENT_TARGET=10.5 clang -ccc-host-triple i386-apple-darwin9 -### --analyze -o /dev/null %s -msse 2> %t.log
// RUN: FileCheck --input-file=%t.log %s
// CHECK: "-analyze"
diff --git a/test/Driver/arm-darwin-builtin.c b/test/Driver/arm-darwin-builtin.c
index 5da8074..63cf343 100644
--- a/test/Driver/arm-darwin-builtin.c
+++ b/test/Driver/arm-darwin-builtin.c
@@ -8,7 +8,7 @@
// RUX: not grep -- "-fno-builtin-strcat" %t &&
// RUX: not grep -- "-fno-builtin-strcpy" %t &&
-// RUN: clang -ccc-no-clang -ccc-host-triple x86_64-apple-darwin9 -arch arm -### -fsyntax-only %s -fbuiltin-strcat -fbuiltin-strcpy 2> %t &&
-// RUN: not grep -- "-fno-builtin-strcat" %t &&
+// RUN: clang -ccc-no-clang -ccc-host-triple x86_64-apple-darwin9 -arch arm -### -fsyntax-only %s -fbuiltin-strcat -fbuiltin-strcpy 2> %t
+// RUN: not grep -- "-fno-builtin-strcat" %t
// RUN: not grep -- "-fno-builtin-strcpy" %t
diff --git a/test/Driver/ast.c b/test/Driver/ast.c
index 814b597..fd38c10 100644
--- a/test/Driver/ast.c
+++ b/test/Driver/ast.c
@@ -1,6 +1,6 @@
-// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases -emit-ast %s 2> %t &&
-// RUN: echo 'END' >> %t &&
-// RUN: FileCheck -check-prefix EMIT-AST-PHASES -input-file %t %s &&
+// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases -emit-ast %s 2> %t
+// RUN: echo 'END' >> %t
+// RUN: FileCheck -check-prefix EMIT-AST-PHASES -input-file %t %s
// EMIT-AST-PHASES: 0: input,
// EMIT-AST-PHASES: , c
@@ -9,9 +9,9 @@
// EMIT-AST-PHASES-NOT: 3:
// EMIT-AST-PHASES: END
-// RUN: touch %t.ast &&
-// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases -c %t.ast 2> %t &&
-// RUN: echo 'END' >> %t &&
+// RUN: touch %t.ast
+// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases -c %t.ast 2> %t
+// RUN: echo 'END' >> %t
// RUN: FileCheck -check-prefix COMPILE-AST-PHASES -input-file %t %s
// COMPILE-AST-PHASES: 0: input,
diff --git a/test/Driver/bindings.c b/test/Driver/bindings.c
index 3937390..41d6a7c 100644
--- a/test/Driver/bindings.c
+++ b/test/Driver/bindings.c
@@ -1,56 +1,55 @@
// Basic binding.
-// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings %s 2> %t &&
-// RUN: grep '"clang", inputs: \[".*bindings.c"\], output: ".*\.s"' %t &&
-// RUN: grep '"gcc::Assemble", inputs: \[".*\.s"\], output: ".*\.o"' %t &&
-// RUN: grep '"gcc::Link", inputs: \[".*\.o"\], output: "a.out"' %t &&
-
-// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang %s 2> %t &&
-// RUN: grep '"gcc::Compile", inputs: \[".*bindings.c"\], output: ".*\.s"' %t &&
-// RUN: grep '"gcc::Assemble", inputs: \[".*\.s"\], output: ".*\.o"' %t &&
-// RUN: grep '"gcc::Link", inputs: \[".*\.o"\], output: "a.out"' %t &&
-
-// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang -no-integrated-cpp %s 2> %t &&
-// RUN: grep '"gcc::Preprocess", inputs: \[".*bindings.c"\], output: ".*\.i"' %t &&
-// RUN: grep '"gcc::Compile", inputs: \[".*\.i"\], output: ".*\.s"' %t &&
-// RUN: grep '"gcc::Assemble", inputs: \[".*\.s"\], output: ".*\.o"' %t &&
-// RUN: grep '"gcc::Link", inputs: \[".*\.o"\], output: "a.out"' %t &&
-
-// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang -no-integrated-cpp -pipe %s 2> %t &&
-// RUN: grep '"gcc::Preprocess", inputs: \[".*bindings.c"\], output: (pipe)' %t &&
-// RUN: grep '"gcc::Compile", inputs: \[(pipe)\], output: (pipe)' %t &&
-// RUN: grep '"gcc::Assemble", inputs: \[(pipe)\], output: ".*\.o"' %t &&
-// RUN: grep '"gcc::Link", inputs: \[".*\.o"\], output: "a.out"' %t &&
-
-// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang -x c-header %s 2> %t &&
-// RUN: grep '"gcc::Precompile", inputs: \[".*bindings.c"\], output: ".*bindings.c.gch' %t &&
+// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings %s 2> %t
+// RUN: grep '"clang", inputs: \[".*bindings.c"\], output: ".*\.s"' %t
+// RUN: grep '"gcc::Assemble", inputs: \[".*\.s"\], output: ".*\.o"' %t
+// RUN: grep '"gcc::Link", inputs: \[".*\.o"\], output: "a.out"' %t
+
+// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang %s 2> %t
+// RUN: grep '"gcc::Compile", inputs: \[".*bindings.c"\], output: ".*\.s"' %t
+// RUN: grep '"gcc::Assemble", inputs: \[".*\.s"\], output: ".*\.o"' %t
+// RUN: grep '"gcc::Link", inputs: \[".*\.o"\], output: "a.out"' %t
+
+// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang -no-integrated-cpp %s 2> %t
+// RUN: grep '"gcc::Preprocess", inputs: \[".*bindings.c"\], output: ".*\.i"' %t
+// RUN: grep '"gcc::Compile", inputs: \[".*\.i"\], output: ".*\.s"' %t
+// RUN: grep '"gcc::Assemble", inputs: \[".*\.s"\], output: ".*\.o"' %t
+// RUN: grep '"gcc::Link", inputs: \[".*\.o"\], output: "a.out"' %t
+
+// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang -no-integrated-cpp -pipe %s 2> %t
+// RUN: grep '"gcc::Preprocess", inputs: \[".*bindings.c"\], output: (pipe)' %t
+// RUN: grep '"gcc::Compile", inputs: \[(pipe)\], output: (pipe)' %t
+// RUN: grep '"gcc::Assemble", inputs: \[(pipe)\], output: ".*\.o"' %t
+// RUN: grep '"gcc::Link", inputs: \[".*\.o"\], output: "a.out"' %t
+
+// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang -x c-header %s 2> %t
+// RUN: grep '"gcc::Precompile", inputs: \[".*bindings.c"\], output: ".*bindings.c.gch' %t
// Clang control options
-// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -fsyntax-only %s 2> %t &&
-// RUN: grep '"clang", inputs: \[".*bindings.c"\], output: (nothing)' %t &&
-// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang -fsyntax-only %s 2> %t &&
-// RUN: grep '"gcc::Compile", inputs: \[".*bindings.c"\], output: (nothing)' %t &&
-// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang-cxx -fsyntax-only -x c++ %s 2> %t &&
-// RUN: grep '"gcc::Compile", inputs: \[".*bindings.c"\], output: (nothing)' %t &&
-// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-clang-cxx -fsyntax-only -x c++ %s 2> %t &&
-// RUN: grep '"clang", inputs: \[".*bindings.c"\], output: (nothing)' %t &&
-// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang-cpp -fsyntax-only -no-integrated-cpp %s 2> %t &&
-// RUN: grep '"gcc::Preprocess", inputs: \[".*bindings.c"\], output: ".*\.i"' %t &&
-// RUN: grep '"clang", inputs: \[".*\.i"\], output: (nothing)' %t &&
-// RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-bindings -ccc-clang-archs i386 %s -S -arch ppc 2> %t &&
-// RUN: grep '"gcc::Compile", inputs: \[".*bindings.c"\], output: "bindings.s"' %t &&
-// RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-bindings -ccc-clang-archs powerpc %s -S -arch ppc 2> %t &&
-// RUN: grep '"clang", inputs: \[".*bindings.c"\], output: "bindings.s"' %t &&
-
-// RUN: clang -ccc-host-triple powerpc-unknown-unknown -ccc-print-bindings -ccc-clang-archs "" %s -S 2> %t &&
-// RUN: grep '"clang", inputs: \[".*bindings.c"\], output: "bindings.s"' %t &&
-// RUN: clang -ccc-host-triple powerpc-unknown-unknown -ccc-print-bindings -ccc-clang-archs "i386" %s -S 2> %t &&
-// RUN: grep '"gcc::Compile", inputs: \[".*bindings.c"\], output: "bindings.s"' %t &&
+// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -fsyntax-only %s 2> %t
+// RUN: grep '"clang", inputs: \[".*bindings.c"\], output: (nothing)' %t
+// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang -fsyntax-only %s 2> %t
+// RUN: grep '"gcc::Compile", inputs: \[".*bindings.c"\], output: (nothing)' %t
+// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang-cxx -fsyntax-only -x c++ %s 2> %t
+// RUN: grep '"gcc::Compile", inputs: \[".*bindings.c"\], output: (nothing)' %t
+// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-clang-cxx -fsyntax-only -x c++ %s 2> %t
+// RUN: grep '"clang", inputs: \[".*bindings.c"\], output: (nothing)' %t
+// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang-cpp -fsyntax-only -no-integrated-cpp %s 2> %t
+// RUN: grep '"gcc::Preprocess", inputs: \[".*bindings.c"\], output: ".*\.i"' %t
+// RUN: grep '"clang", inputs: \[".*\.i"\], output: (nothing)' %t
+// RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-bindings -ccc-clang-archs i386 %s -S -arch ppc 2> %t
+// RUN: grep '"gcc::Compile", inputs: \[".*bindings.c"\], output: "bindings.s"' %t
+// RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-bindings -ccc-clang-archs powerpc %s -S -arch ppc 2> %t
+// RUN: grep '"clang", inputs: \[".*bindings.c"\], output: "bindings.s"' %t
+
+// RUN: clang -ccc-host-triple powerpc-unknown-unknown -ccc-print-bindings -ccc-clang-archs "" %s -S 2> %t
+// RUN: grep '"clang", inputs: \[".*bindings.c"\], output: "bindings.s"' %t
+// RUN: clang -ccc-host-triple powerpc-unknown-unknown -ccc-print-bindings -ccc-clang-archs "i386" %s -S 2> %t
+// RUN: grep '"gcc::Compile", inputs: \[".*bindings.c"\], output: "bindings.s"' %t
// Darwin bindings
-// RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-bindings %s 2> %t &&
-// RUN: grep '"clang", inputs: \[".*bindings.c"\], output: ".*\.s"' %t &&
-// RUN: grep '"darwin::Assemble", inputs: \[".*\.s"\], output: ".*\.o"' %t &&
-// RUN: grep '"darwin::Link", inputs: \[".*\.o"\], output: "a.out"' %t &&
+// RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-bindings %s 2> %t
+// RUN: grep '"clang", inputs: \[".*bindings.c"\], output: ".*\.s"' %t
+// RUN: grep '"darwin::Assemble", inputs: \[".*\.s"\], output: ".*\.o"' %t
+// RUN: grep '"darwin::Link", inputs: \[".*\.o"\], output: "a.out"' %t
-// RUN: true
diff --git a/test/Driver/clang-translation.c b/test/Driver/clang-translation.c
index e0b9e3a..c57a2b7 100644
--- a/test/Driver/clang-translation.c
+++ b/test/Driver/clang-translation.c
@@ -1,16 +1,15 @@
-// RUN: clang -ccc-host-triple i386-unknown-unknown -### -S -O0 -Os %s -o %t.s -fverbose-asm 2> %t.log &&
-// RUN: grep '"-triple" "i386-unknown-unknown"' %t.log &&
-// RUN: grep '"-S"' %t.log &&
-// RUN: grep '"-disable-free"' %t.log &&
-// RUN: grep '"--relocation-model" "static"' %t.log &&
-// RUN: grep '"--disable-fp-elim"' %t.log &&
-// RUN: grep '"--unwind-tables=0"' %t.log &&
-// RUN: grep '"--fmath-errno=1"' %t.log &&
-// RUN: grep '"-Os"' %t.log &&
-// RUN: grep '"-o" .*clang-translation.*' %t.log &&
-// RUN: grep '"--asm-verbose"' %t.log &&
-// RUN: clang -ccc-host-triple i386-apple-darwin9 -### -S %s -o %t.s 2> %t.log &&
-// RUN: grep '"--mcpu=yonah"' %t.log &&
-// RUN: clang -ccc-host-triple x86_64-apple-darwin9 -### -S %s -o %t.s 2> %t.log &&
-// RUN: grep '"--mcpu=core2"' %t.log &&
-// RUN: true
+// RUN: clang -ccc-host-triple i386-unknown-unknown -### -S -O0 -Os %s -o %t.s -fverbose-asm 2> %t.log
+// RUN: grep '"-triple" "i386-unknown-unknown"' %t.log
+// RUN: grep '"-S"' %t.log
+// RUN: grep '"-disable-free"' %t.log
+// RUN: grep '"--relocation-model" "static"' %t.log
+// RUN: grep '"--disable-fp-elim"' %t.log
+// RUN: grep '"--unwind-tables=0"' %t.log
+// RUN: grep '"--fmath-errno=1"' %t.log
+// RUN: grep '"-Os"' %t.log
+// RUN: grep '"-o" .*clang-translation.*' %t.log
+// RUN: grep '"--asm-verbose"' %t.log
+// RUN: clang -ccc-host-triple i386-apple-darwin9 -### -S %s -o %t.s 2> %t.log
+// RUN: grep '"--mcpu" "yonah"' %t.log
+// RUN: clang -ccc-host-triple x86_64-apple-darwin9 -### -S %s -o %t.s 2> %t.log
+// RUN: grep '"--mcpu" "core2"' %t.log
diff --git a/test/Driver/clang_cpp.c b/test/Driver/clang_cpp.c
index fdbb321..8638465 100644
--- a/test/Driver/clang_cpp.c
+++ b/test/Driver/clang_cpp.c
@@ -1,4 +1,4 @@
// Verify that -include isn't included twice with -save-temps.
-// RUN: clang -S -o - %s -include %t.h -save-temps -### 2> %t.log &&
+// RUN: clang -S -o - %s -include %t.h -save-temps -### 2> %t.log
// RUN: grep '"-include' %t.log | count 1
diff --git a/test/Driver/clang_f_opts.c b/test/Driver/clang_f_opts.c
index 8266f77..b18f147 100644
--- a/test/Driver/clang_f_opts.c
+++ b/test/Driver/clang_f_opts.c
@@ -1,11 +1,10 @@
-// RUN: clang -### -S -x c /dev/null -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings -fno-blocks -fno-builtin -fno-math-errno -fno-common -fno-pascal-strings -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings %s 2> %t &&
-// RUN: grep -F '"-fblocks"' %t &&
-// RUN: grep -F '"--fmath-errno=1"' %t &&
-// RUN: grep -F '"-fpascal-strings"' %t &&
-// RUN: clang -### -S -x c /dev/null -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings -fno-blocks -fno-builtin -fno-math-errno -fno-common -fno-pascal-strings -fno-show-source-location %s 2> %t &&
-// RUN: grep -F '"-fblocks=0"' %t &&
-// RUN: grep -F '"-fbuiltin=0"' %t &&
-// RUN: grep -F '"-fno-common"' %t &&
-// RUN: grep -F '"--fmath-errno=0"' %t &&
-// RUN: grep -F '"-fno-show-source-location"' %t &&
-// RUN: true
+// RUN: clang -### -S -x c /dev/null -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings -fno-blocks -fno-builtin -fno-math-errno -fno-common -fno-pascal-strings -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings %s 2> %t
+// RUN: grep -F '"-fblocks"' %t
+// RUN: grep -F '"--fmath-errno=1"' %t
+// RUN: grep -F '"-fpascal-strings"' %t
+// RUN: clang -### -S -x c /dev/null -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings -fno-blocks -fno-builtin -fno-math-errno -fno-common -fno-pascal-strings -fno-show-source-location -fshort-wchar %s 2> %t
+// RUN: grep -F '"-fbuiltin=0"' %t
+// RUN: grep -F '"-fno-common"' %t
+// RUN: grep -F '"--fmath-errno=0"' %t
+// RUN: grep -F '"-fno-show-source-location"' %t
+// RUN: grep -F '"-fshort-wchar"' %t
diff --git a/test/Driver/cxx-pth.cpp b/test/Driver/cxx-pth.cpp
index a06a257..508696a 100644
--- a/test/Driver/cxx-pth.cpp
+++ b/test/Driver/cxx-pth.cpp
@@ -1,12 +1,12 @@
// Test forced PTH for CXX support.
-// RUN: clang -x c++-header %s -### 2> %t.log &&
-// RUN: FileCheck -check-prefix EMIT -input-file %t.log %s &&
+// RUN: clang -x c++-header %s -### 2> %t.log
+// RUN: FileCheck -check-prefix EMIT -input-file %t.log %s
// EMIT: "{{.*}}/clang-cc{{.*}}" {{.*}} "-emit-pth" "{{.*}}.cpp.gch" "-x" "c++-header" "{{.*}}.cpp"
-// RUN: touch %t.h.gch &&
-// RUN: clang -E -include %t.h %s -### 2> %t.log &&
+// RUN: touch %t.h.gch
+// RUN: clang -E -include %t.h %s -### 2> %t.log
// RUN: FileCheck -check-prefix USE -input-file %t.log %s
// USE: "{{.*}}/clang-cc{{.*}}" {{.*}}"-include-pth" "{{.*}}.h.gch" {{.*}}"-x" "c++" "{{.*}}.cpp"
diff --git a/test/Driver/darwin-as.c b/test/Driver/darwin-as.c
index 486dc2e..26e59a5 100644
--- a/test/Driver/darwin-as.c
+++ b/test/Driver/darwin-as.c
@@ -1,9 +1,9 @@
-// RUN: clang -ccc-host-triple i386-apple-darwin10 -### -x assembler -c %s -static -dynamic 2>%t &&
-// RUN: FileCheck -check-prefix=STATIC_AND_DYNAMIC-32 --input-file %t %s &&
+// RUN: clang -ccc-host-triple i386-apple-darwin10 -### -x assembler -c %s -static -dynamic 2>%t
+// RUN: FileCheck -check-prefix=STATIC_AND_DYNAMIC-32 --input-file %t %s
// CHECK-STATIC_AND_DYNAMIC-32: as{{(.exe)?}}" "-arch" "i386" "-force_cpusubtype_ALL" "-static" "-o"
-// RUN: clang -ccc-host-triple x86_64-apple-darwin10 -### -x assembler -c %s -static 2>%t &&
+// RUN: clang -ccc-host-triple x86_64-apple-darwin10 -### -x assembler -c %s -static 2>%t
// RUN: FileCheck -check-prefix=STATIC-64 --input-file %t %s
// CHECK-STATIC-64: as{{(.exe)?}}" "-arch" "x86_64" "-force_cpusubtype_ALL" "-o"
diff --git a/test/Driver/darwin-cc.c b/test/Driver/darwin-cc.c
index 77193cd..1f43358 100644
--- a/test/Driver/darwin-cc.c
+++ b/test/Driver/darwin-cc.c
@@ -1,6 +1,5 @@
-// 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" "-F" "ARG1" "-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" "-mmacosx-version-min=10.6.0" "-m32" "-mkernel" "-mtune=core2" "-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" "-mmacosx-version-min=10.6.0" "-m32" "-mkernel" "-mtune=core2" "-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: 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" "-F" "ARG1" "-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" "-mmacosx-version-min=10.6.0" "-m32" "-mkernel" "-mtune=core2" "-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" "-mmacosx-version-min=10.6.0" "-m32" "-mkernel" "-mtune=core2" "-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: true
diff --git a/test/Driver/darwin-ld.c b/test/Driver/darwin-ld.c
index 9165a4a..04f35be 100644
--- a/test/Driver/darwin-ld.c
+++ b/test/Driver/darwin-ld.c
@@ -1,27 +1,27 @@
// Check that ld gets arch_multiple.
-// RUN: clang -ccc-host-triple i386-apple-darwin9 -arch i386 -arch x86_64 %s -### -o foo 2> %t.log &&
-// RUN: grep '".*ld.*" .*"-arch_multiple" "-final_output" "foo"' %t.log &&
-
-// RUN: clang -ccc-host-triple i386-apple-darwin9 -### -filelist FOO -static 2> %t.log &&
-// RUN: grep '"-lcrt0.o" .*"-lgcc_static"' %t.log &&
-// RUN: grep '"-lgcc"' %t.log | count 0 &&
-// RUN: clang -ccc-host-triple i386-apple-darwin7 -### -filelist FOO 2> %t.log &&
-// RUN: grep '"-lcrt1.o" .*"-lgcc" "-lSystem"' %t.log &&
-// RUN: grep '"-lgcc_s"' %t.log | count 0 &&
-// RUN: clang -ccc-host-triple i386-apple-darwin8 -### -filelist FOO 2> %t.log &&
-// RUN: grep '"-lcrt1.o" .*"-lgcc_s.10.4" "-lgcc" "-lSystem"' %t.log &&
-// RUN: clang -ccc-host-triple i386-apple-darwin9 -### -filelist FOO 2> %t.log &&
-// RUN: grep '"-lcrt1.10.5.o" .*"-lgcc_s.10.5" "-lgcc" "-lSystem"' %t.log &&
-// RUN: clang -ccc-host-triple i386-apple-darwin10 -### -filelist FOO 2> %t.log &&
-// RUN: grep '"-lcrt1.10.6.o" .*"-lSystem" "-lgcc"' %t.log &&
-// RUN: grep '"-lgcc_s"' %t.log | count 0 &&
+// RUN: clang -ccc-host-triple i386-apple-darwin9 -arch i386 -arch x86_64 %s -### -o foo 2> %t.log
+// RUN: grep '".*ld.*" .*"-arch_multiple" "-final_output" "foo"' %t.log
+
+// RUN: clang -ccc-host-triple i386-apple-darwin9 -### -filelist FOO -static 2> %t.log
+// RUN: grep '"-lcrt0.o" .*"-lgcc_static"' %t.log
+// RUN: grep '"-lgcc"' %t.log | count 0
+// RUN: clang -ccc-host-triple i386-apple-darwin7 -### -filelist FOO 2> %t.log
+// RUN: grep '"-lcrt1.o" .*"-lgcc" "-lSystem"' %t.log
+// RUN: grep '"-lgcc_s"' %t.log | count 0
+// RUN: clang -ccc-host-triple i386-apple-darwin8 -### -filelist FOO 2> %t.log
+// RUN: grep '"-lcrt1.o" .*"-lgcc_s.10.4" "-lgcc" "-lSystem"' %t.log
+// RUN: clang -ccc-host-triple i386-apple-darwin9 -### -filelist FOO 2> %t.log
+// RUN: grep '"-lcrt1.10.5.o" .*"-lgcc_s.10.5" "-lgcc" "-lSystem"' %t.log
+// RUN: clang -ccc-host-triple i386-apple-darwin10 -### -filelist FOO 2> %t.log
+// RUN: grep '"-lcrt1.10.6.o" .*"-lSystem" "-lgcc"' %t.log
+// RUN: grep '"-lgcc_s"' %t.log | count 0
// Make sure we run dsymutil on source input files.
-// RUN: clang -ccc-host-triple i386-apple-darwin9 -### -g %s -o BAR 2> %t.log &&
-// RUN: grep '".*dsymutil" "BAR"' %t.log &&
-// RUN: clang -ccc-host-triple i386-apple-darwin9 -### -g -filelist FOO %s -o BAR 2> %t.log &&
-// RUN: grep '".*dsymutil" "BAR"' %t.log &&
+// RUN: clang -ccc-host-triple i386-apple-darwin9 -### -g %s -o BAR 2> %t.log
+// RUN: grep '".*dsymutil" "BAR"' %t.log
+// RUN: clang -ccc-host-triple i386-apple-darwin9 -### -g -filelist FOO %s -o BAR 2> %t.log
+// RUN: grep '".*dsymutil" "BAR"' %t.log
// Splatter test case. This is gross, but it works for now. For the
// driver, just getting coverage of the tool code and checking the
@@ -32,13 +32,12 @@
//
// 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 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" "-lgcov" "-allow_stack_execute" "-T" "ARG4" "-F" "ARG1"' %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 -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 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" "-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 &&
-// RUN: grep dsymutil %t.log | count 0 &&
+// RUN: clang -ccc-host-triple i386-apple-darwin9 -### -arch i386 -arch x86_64 -g %s 2> %t.log
+// RUN: grep dsymutil %t.log | count 0
-// RUN: true
diff --git a/test/Driver/default-toolchain.c b/test/Driver/default-toolchain.c
index 0e8a026..9cebdfe 100644
--- a/test/Driver/default-toolchain.c
+++ b/test/Driver/default-toolchain.c
@@ -1,8 +1,8 @@
-// RUN: clang -ccc-host-triple i386-unknown-unknown -m64 -v 2> %t &&
-// RUN: grep 'Target: x86_64-unknown-unknown' %t &&
+// RUN: clang -ccc-host-triple i386-unknown-unknown -m64 -v 2> %t
+// RUN: grep 'Target: x86_64-unknown-unknown' %t
-// RUN: clang -ccc-host-triple i386-apple-darwin9 -arch ppc -m64 -v 2> %t &&
-// RUN: grep 'Target: powerpc64-apple-darwin9' %t &&
+// RUN: clang -ccc-host-triple i386-apple-darwin9 -arch ppc -m64 -v 2> %t
+// RUN: grep 'Target: powerpc64-apple-darwin9' %t
-// RUN: clang -ccc-host-triple i386-apple-darwin9 -arch ppc64 -m32 -v 2> %t &&
+// RUN: clang -ccc-host-triple i386-apple-darwin9 -arch ppc64 -m32 -v 2> %t
// RUN: grep 'Target: powerpc-apple-darwin9' %t
diff --git a/test/Driver/dragonfly.c b/test/Driver/dragonfly.c
index f0b09f7..40f12e4 100644
--- a/test/Driver/dragonfly.c
+++ b/test/Driver/dragonfly.c
@@ -1,4 +1,4 @@
-// RUN: clang -ccc-host-triple amd64-pc-dragonfly %s -### 2> %t.log &&
+// RUN: clang -ccc-host-triple amd64-pc-dragonfly %s -### 2> %t.log
// RUN: FileCheck -input-file %t.log %s
// CHECK: clang-cc{{.*}}" "-triple" "amd64-pc-dragonfly"
diff --git a/test/Driver/emit-llvm.c b/test/Driver/emit-llvm.c
index a4aabe7..27007c6 100644
--- a/test/Driver/emit-llvm.c
+++ b/test/Driver/emit-llvm.c
@@ -1,3 +1,3 @@
-// RUN: not clang -ccc-host-triple i386-pc-linux-gnu -emit-llvm -o %t %s 2> %t.log &&
+// RUN: not clang -ccc-host-triple i386-pc-linux-gnu -emit-llvm -o %t %s 2> %t.log
// RUN: grep 'unable to pass LLVM bit-code files to linker' %t.log
diff --git a/test/Driver/flags.c b/test/Driver/flags.c
index 7c448fa..a324100 100644
--- a/test/Driver/flags.c
+++ b/test/Driver/flags.c
@@ -1,9 +1,9 @@
-// RUN: clang -ccc-host-triple i386-apple-darwin9 -### -S -msoft-float %s 2> %t.log &&
-// RUN: grep '"--no-implicit-float"' %t.log &&
+// RUN: clang -ccc-host-triple i386-apple-darwin9 -### -S -msoft-float %s 2> %t.log
+// RUN: grep '"--no-implicit-float"' %t.log
-// RUN: clang -ccc-host-triple i386-apple-darwin9 -### -S -msoft-float -mno-soft-float %s 2> %t.log &&
-// RUN: grep '"--no-implicit-float"' %t.log | count 0 &&
+// RUN: clang -ccc-host-triple i386-apple-darwin9 -### -S -msoft-float -mno-soft-float %s 2> %t.log
+// RUN: grep '"--no-implicit-float"' %t.log | count 0
-// RUN: clang -ccc-host-triple i386-apple-darwin9 -### -S -mno-soft-float %s -msoft-float 2> %t.log &&
+// RUN: clang -ccc-host-triple i386-apple-darwin9 -### -S -mno-soft-float %s -msoft-float 2> %t.log
// RUN: grep '"--no-implicit-float"' %t.log
diff --git a/test/Driver/freebsd.c b/test/Driver/freebsd.c
index d50c85b..8c03bbc 100644
--- a/test/Driver/freebsd.c
+++ b/test/Driver/freebsd.c
@@ -1,5 +1,5 @@
-// RUN: clang -ccc-clang-archs "" -ccc-host-triple powerpc64-pc-freebsd8 %s -### 2> %t.log &&
-// RUN: cat %t.log &&
+// RUN: clang -ccc-clang-archs "" -ccc-host-triple powerpc64-pc-freebsd8 %s -### 2> %t.log
+// RUN: cat %t.log
// RUN: FileCheck -input-file %t.log %s
// CHECK: clang-cc{{.*}}" "-triple" "powerpc64-pc-freebsd8"
diff --git a/test/Driver/hello.c b/test/Driver/hello.c
index ead0d07..0df1341 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 %s 2> %t.log
// Make sure we used clang.
-// RUN: grep 'clang-cc" .*hello.c' %t.log &&
+// RUN: grep 'clang-cc" .*hello.c' %t.log
-// RUN: %t > %t.out &&
+// RUN: %t > %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/immediate-options.c b/test/Driver/immediate-options.c
index 34af89f..923c30e 100644
--- a/test/Driver/immediate-options.c
+++ b/test/Driver/immediate-options.c
@@ -1,5 +1,4 @@
-// RUN: clang --help &&
-// RUN: clang --help-hidden &&
-// RUN: clang -dumpversion &&
-// RUN: clang -print-search-dirs &&
-// RUN: true
+// RUN: clang --help
+// RUN: clang --help-hidden
+// RUN: clang -dumpversion
+// RUN: clang -print-search-dirs
diff --git a/test/Driver/lto.c b/test/Driver/lto.c
index 01ef2eb..041b4246 100644
--- a/test/Driver/lto.c
+++ b/test/Driver/lto.c
@@ -1,25 +1,24 @@
// -emit-llvm, -flto, and -O4 all cause a switch to llvm-bc object
// files.
-// RUN: clang -ccc-print-phases -c %s -flto 2> %t.log &&
-// RUN: grep '2: compiler, {1}, llvm-bc' %t.log &&
-// RUN: clang -ccc-print-phases -c %s -O4 2> %t.log &&
-// RUN: grep '2: compiler, {1}, llvm-bc' %t.log &&
+// RUN: clang -ccc-print-phases -c %s -flto 2> %t.log
+// RUN: grep '2: compiler, {1}, llvm-bc' %t.log
+// RUN: clang -ccc-print-phases -c %s -O4 2> %t.log
+// RUN: grep '2: compiler, {1}, llvm-bc' %t.log
// and -emit-llvm doesn't alter pipeline (unfortunately?).
-// RUN: clang -ccc-print-phases %s -emit-llvm 2> %t.log &&
-// RUN: grep '0: input, ".*lto.c", c' %t.log &&
-// RUN: grep '1: preprocessor, {0}, cpp-output' %t.log &&
-// RUN: grep '2: compiler, {1}, llvm-bc' %t.log &&
-// RUN: grep '3: linker, {2}, image' %t.log &&
+// RUN: clang -ccc-print-phases %s -emit-llvm 2> %t.log
+// RUN: grep '0: input, ".*lto.c", c' %t.log
+// RUN: grep '1: preprocessor, {0}, cpp-output' %t.log
+// RUN: grep '2: compiler, {1}, llvm-bc' %t.log
+// RUN: grep '3: linker, {2}, image' %t.log
// llvm-bc and llvm-ll outputs need to match regular suffixes
// (unfortunately).
-// RUN: clang %s -emit-llvm -save-temps -### 2> %t.log &&
-// RUN: grep '"-o" ".*lto\.i" "-x" "c" ".*lto\.c"' %t.log &&
-// RUN: grep '"-o" ".*lto\.o" .*".*lto\.i"' %t.log &&
-// RUN: grep '".*a.out" .*".*lto\.o"' %t.log &&
+// RUN: clang %s -emit-llvm -save-temps -### 2> %t.log
+// RUN: grep '"-o" ".*lto\.i" "-x" "c" ".*lto\.c"' %t.log
+// RUN: grep '"-o" ".*lto\.o" .*".*lto\.i"' %t.log
+// RUN: grep '".*a.out" .*".*lto\.o"' %t.log
-// RUN: clang %s -emit-llvm -S -### 2> %t.log &&
-// RUN: grep '"-o" ".*lto\.s" "-x" "c" ".*lto\.c"' %t.log &&
+// RUN: clang %s -emit-llvm -S -### 2> %t.log
+// RUN: grep '"-o" ".*lto\.s" "-x" "c" ".*lto\.c"' %t.log
-// RUN: true
diff --git a/test/Driver/openbsd.c b/test/Driver/openbsd.c
index c73ef20..8b0706b 100644
--- a/test/Driver/openbsd.c
+++ b/test/Driver/openbsd.c
@@ -1,4 +1,4 @@
-// RUN: clang -ccc-clang-archs "" -ccc-host-triple i686-pc-openbsd %s -### 2> %t.log &&
+// RUN: clang -ccc-clang-archs "" -ccc-host-triple i686-pc-openbsd %s -### 2> %t.log
// RUN: FileCheck -input-file %t.log %s
// CHECK: clang-cc{{.*}}" "-triple" "i686-pc-openbsd"
diff --git a/test/Driver/parsing.c b/test/Driver/parsing.c
index 7b64440..8e37128 100644
--- a/test/Driver/parsing.c
+++ b/test/Driver/parsing.c
@@ -1,24 +1,23 @@
-// RUN: clang -ccc-print-options input -Yunknown -m32 -arch ppc -djoined -A separate -Ajoined -Wp,one,two -Xarch_joined AndSeparate -sectalign 1 2 3 2> %t &&
-// RUN: grep 'Option 0 - Name: "<input>", Values: {"input"}' %t &&
-// RUN: grep 'Option 1 - Name: "<unknown>", Values: {"-Yunknown"}' %t &&
-// RUN: grep 'Option 2 - Name: "-m32", Values: {}' %t &&
-// RUN: grep 'Option 3 - Name: "-arch", Values: {"ppc"}' %t &&
-// RUN: grep 'Option 4 - Name: "-d", Values: {"joined"}' %t &&
-// RUN: grep 'Option 5 - Name: "-A", Values: {"separate"}' %t &&
-// RUN: grep 'Option 6 - Name: "-A", Values: {"joined"}' %t &&
-// RUN: grep 'Option 7 - Name: "-Wp,", Values: {"one", "two"}' %t &&
-// RUN: grep 'Option 8 - Name: "-Xarch_", Values: {"joined", "AndSeparate"}' %t &&
-// RUN: grep 'Option 9 - Name: "-sectalign", Values: {"1", "2", "3"}' %t &&
+// RUN: clang -ccc-print-options input -Yunknown -m32 -arch ppc -djoined -A separate -Ajoined -Wp,one,two -Xarch_joined AndSeparate -sectalign 1 2 3 2> %t
+// RUN: grep 'Option 0 - Name: "<input>", Values: {"input"}' %t
+// RUN: grep 'Option 1 - Name: "<unknown>", Values: {"-Yunknown"}' %t
+// RUN: grep 'Option 2 - Name: "-m32", Values: {}' %t
+// RUN: grep 'Option 3 - Name: "-arch", Values: {"ppc"}' %t
+// RUN: grep 'Option 4 - Name: "-d", Values: {"joined"}' %t
+// RUN: grep 'Option 5 - Name: "-A", Values: {"separate"}' %t
+// RUN: grep 'Option 6 - Name: "-A", Values: {"joined"}' %t
+// RUN: grep 'Option 7 - Name: "-Wp,", Values: {"one", "two"}' %t
+// RUN: grep 'Option 8 - Name: "-Xarch_", Values: {"joined", "AndSeparate"}' %t
+// RUN: grep 'Option 9 - Name: "-sectalign", Values: {"1", "2", "3"}' %t
-// RUN: not clang -V 2> %t &&
-// RUN: grep "error: argument to '-V' is missing (expected 1 value)" %t &&
-// RUN: not clang -sectalign 1 2 2> %t &&
-// RUN: grep "error: argument to '-sectalign' is missing (expected 3 values)" %t &&
+// RUN: not clang -V 2> %t
+// RUN: grep "error: argument to '-V' is missing (expected 1 value)" %t
+// RUN: not clang -sectalign 1 2 2> %t
+// RUN: grep "error: argument to '-sectalign' is missing (expected 3 values)" %t
// Verify that search continues after find the first option.
-// RUN: clang -ccc-print-options -Wally 2> %t &&
-// RUN: grep 'Option 0 - Name: "-W", Values: {"ally"}' %t &&
+// RUN: clang -ccc-print-options -Wally 2> %t
+// RUN: grep 'Option 0 - Name: "-W", Values: {"ally"}' %t
-// RUN: true
diff --git a/test/Driver/phases.c b/test/Driver/phases.c
index 61f68c4..d03bff9 100644
--- a/test/Driver/phases.c
+++ b/test/Driver/phases.c
@@ -1,5 +1,5 @@
// Basic compilation for various types of files.
-// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases -x c %s -x objective-c %s -x c++ %s -x objective-c++ -x assembler %s -x assembler-with-cpp %s -x none %s 2>&1 | FileCheck -check-prefix=BASIC %s &&
+// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases -x c %s -x objective-c %s -x c++ %s -x objective-c++ -x assembler %s -x assembler-with-cpp %s -x none %s 2>&1 | FileCheck -check-prefix=BASIC %s
// BASIC: 0: input, "{{.*}}phases.c", c
// BASIC: 1: preprocessor, {0}, cpp-output
// BASIC: 2: compiler, {1}, assembler
@@ -24,7 +24,7 @@
// BASIC: 21: linker, {3, 7, 11, 13, 16, 20}, image
// Universal linked image.
-// RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -x c %s -arch ppc -arch i386 2>&1 | FileCheck -check-prefix=ULI %s &&
+// RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -x c %s -arch ppc -arch i386 2>&1 | FileCheck -check-prefix=ULI %s
// ULI: 0: input, "{{.*}}phases.c", c
// ULI: 1: preprocessor, {0}, cpp-output
// ULI: 2: compiler, {1}, assembler
@@ -35,7 +35,7 @@
// ULI: 7: lipo, {5, 6}, image
// Universal object file.
-// RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c -x c %s -arch ppc -arch i386 2>&1 | FileCheck -check-prefix=UOF %s &&
+// RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c -x c %s -arch ppc -arch i386 2>&1 | FileCheck -check-prefix=UOF %s
// UOF: 0: input, "{{.*}}phases.c", c
// UOF: 1: preprocessor, {0}, cpp-output
// UOF: 2: compiler, {1}, assembler
@@ -45,35 +45,34 @@
// UOF: 6: lipo, {4, 5}, object
// Arch defaulting
-// RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c -x assembler %s 2>&1 | FileCheck -check-prefix=ARCH1 %s &&
+// RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c -x assembler %s 2>&1 | FileCheck -check-prefix=ARCH1 %s
// ARCH1: 2: bind-arch, "i386", {1}, object
-// RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c -x assembler %s -m32 -m64 2>&1 | FileCheck -check-prefix=ARCH2 %s &&
+// RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c -x assembler %s -m32 -m64 2>&1 | FileCheck -check-prefix=ARCH2 %s
// ARCH2: 2: bind-arch, "x86_64", {1}, object
-// RUN: clang -ccc-host-triple x86_64-apple-darwin9 -ccc-print-phases -c -x assembler %s 2>&1 | FileCheck -check-prefix=ARCH3 %s &&
+// RUN: clang -ccc-host-triple x86_64-apple-darwin9 -ccc-print-phases -c -x assembler %s 2>&1 | FileCheck -check-prefix=ARCH3 %s
// ARCH3: 2: bind-arch, "x86_64", {1}, object
-// RUN: clang -ccc-host-triple x86_64-apple-darwin9 -ccc-print-phases -c -x assembler %s -m64 -m32 2>&1 | FileCheck -check-prefix=ARCH4 %s &&
+// RUN: clang -ccc-host-triple x86_64-apple-darwin9 -ccc-print-phases -c -x assembler %s -m64 -m32 2>&1 | FileCheck -check-prefix=ARCH4 %s
// ARCH4: 2: bind-arch, "i386", {1}, object
// Analyzer
-// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases --analyze %s 2>&1 | FileCheck -check-prefix=ANALYZE %s &&
+// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases --analyze %s 2>&1 | FileCheck -check-prefix=ANALYZE %s
// ANALYZE: 0: input, "{{.*}}phases.c", c
// ANALYZE: 1: preprocessor, {0}, cpp-output
// ANALYZE: 2: analyzer, {1}, plist
// Precompiler
-// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases -x c-header %s 2>&1 | FileCheck -check-prefix=PCH %s &&
+// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases -x c-header %s 2>&1 | FileCheck -check-prefix=PCH %s
// PCH: 0: input, "{{.*}}phases.c", c-header
// PCH: 1: preprocessor, {0}, c-header-cpp-output
// PCH: 2: precompiler, {1}, precompiled-header
// Darwin overrides the handling for .s
-// RUN: touch %t.s &&
-// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases -c %t.s 2>&1 | FileCheck -check-prefix=DARWIN1 %s &&
+// RUN: touch %t.s
+// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases -c %t.s 2>&1 | FileCheck -check-prefix=DARWIN1 %s
// DARWIN1: 0: input, "{{.*}}.s", assembler
// DARWIN1: 1: assembler, {0}, object
-// RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c %t.s 2>&1 | FileCheck -check-prefix=DARWIN2 %s &&
+// RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c %t.s 2>&1 | FileCheck -check-prefix=DARWIN2 %s
// DARWIN2: 0: input, "{{.*}}.s", assembler-with-cpp
// DARWIN2: 1: preprocessor, {0}, assembler
// DARWIN2: 2: assembler, {1}, object
-// RUN: true
diff --git a/test/Driver/preprocessor.c b/test/Driver/preprocessor.c
index ec1f42f..51b6fc5 100644
--- a/test/Driver/preprocessor.c
+++ b/test/Driver/preprocessor.c
@@ -1,4 +1,4 @@
-// RUN: clang -E -x c-header %s > %t &&
+// RUN: clang -E -x c-header %s > %t
// RUN: grep 'B B' %t
#define A B
diff --git a/test/Driver/pth.c b/test/Driver/pth.c
index 5c83aea..8e8b2dd 100644
--- a/test/Driver/pth.c
+++ b/test/Driver/pth.c
@@ -1,12 +1,12 @@
// Test transparent PTH support.
-// RUN: clang -ccc-pch-is-pth -x c-header %s -o %t.h.pth -### 2> %t.log &&
-// RUN: FileCheck -check-prefix CHECK1 -input-file %t.log %s &&
+// RUN: clang -ccc-pch-is-pth -x c-header %s -o %t.h.pth -### 2> %t.log
+// RUN: FileCheck -check-prefix CHECK1 -input-file %t.log %s
// CHECK1: "{{.*}}/clang-cc{{.*}}" {{.*}} "-o" "{{.*}}.h.pth" "-x" "c-header" "{{.*}}pth.c"
-// RUN: touch %t.h.pth &&
-// RUN: clang -ccc-pch-is-pth -E -include %t.h %s -### 2> %t.log &&
+// RUN: touch %t.h.pth
+// RUN: clang -ccc-pch-is-pth -E -include %t.h %s -### 2> %t.log
// RUN: FileCheck -check-prefix CHECK2 -input-file %t.log %s
// CHECK2: "{{.*}}/clang-cc{{.*}}" {{.*}}"-include-pth" "{{.*}}.h.pth" {{.*}}"-x" "c" "{{.*}}pth.c"
diff --git a/test/Driver/redzone.c b/test/Driver/redzone.c
index 64729ac..86f412f 100644
--- a/test/Driver/redzone.c
+++ b/test/Driver/redzone.c
@@ -1,6 +1,6 @@
-// RUN: clang -ccc-host-triple i386-unknown-unknown -mno-red-zone %s -S -emit-llvm -o %t.log &&
-// RUN: grep 'noredzone' %t.log &&
-// RUN: clang -ccc-host-triple i386-unknown-unknown -mred-zone %s -S -emit-llvm -o %t.log &&
+// RUN: clang -ccc-host-triple i386-unknown-unknown -mno-red-zone %s -S -emit-llvm -o %t.log
+// RUN: grep 'noredzone' %t.log
+// RUN: clang -ccc-host-triple i386-unknown-unknown -mred-zone %s -S -emit-llvm -o %t.log
// RUN: grep -v 'noredzone' %t.log
int foo() { return 42; }
diff --git a/test/Driver/std.c b/test/Driver/std.c
index 04113d5..01a5f7c 100644
--- a/test/Driver/std.c
+++ b/test/Driver/std.c
@@ -1,6 +1,6 @@
-// RUN: clang -std=c99 -trigraphs -std=gnu99 %s -E -o - | FileCheck -check-prefix=OVERRIDE %s &&
+// RUN: clang -std=c99 -trigraphs -std=gnu99 %s -E -o - | FileCheck -check-prefix=OVERRIDE %s
// OVERRIDE: ??(??)
-// RUN: clang -ansi %s -E -o - | FileCheck -check-prefix=ANSI %s &&
+// RUN: clang -ansi %s -E -o - | FileCheck -check-prefix=ANSI %s
// ANSI: []
// RUN: clang -std=gnu99 -trigraphs %s -E -o - | FileCheck -check-prefix=EXPLICIT %s
// EXPLICIT: []
diff --git a/test/Driver/unknown-gcc-arch.c b/test/Driver/unknown-gcc-arch.c
index de9e8e8..e8b653f 100644
--- a/test/Driver/unknown-gcc-arch.c
+++ b/test/Driver/unknown-gcc-arch.c
@@ -1,8 +1,8 @@
-// RUN: clang -ccc-host-triple x86_64-unknown-unknown -c -x assembler %s -### 2> %t.log &&
-// RUN: grep '.*gcc.*"-m64"' %t.log &&
-// RUN: clang -ccc-host-triple x86_64-unknown-unknown -c -x assembler %s -### -m32 2> %t.log &&
-// RUN: grep '.*gcc.*"-m32"' %t.log &&
-// RUN: clang -ccc-host-triple i386-unknown-unknown -c -x assembler %s -### 2> %t.log &&
-// RUN: grep '.*gcc.*"-m32"' %t.log &&
-// RUN: clang -ccc-host-triple i386-unknown-unknown -c -x assembler %s -### -m64 2> %t.log &&
+// RUN: clang -ccc-host-triple x86_64-unknown-unknown -c -x assembler %s -### 2> %t.log
+// RUN: grep '.*gcc.*"-m64"' %t.log
+// RUN: clang -ccc-host-triple x86_64-unknown-unknown -c -x assembler %s -### -m32 2> %t.log
+// RUN: grep '.*gcc.*"-m32"' %t.log
+// RUN: clang -ccc-host-triple i386-unknown-unknown -c -x assembler %s -### 2> %t.log
+// RUN: grep '.*gcc.*"-m32"' %t.log
+// RUN: clang -ccc-host-triple i386-unknown-unknown -c -x assembler %s -### -m64 2> %t.log
// RUN: grep '.*gcc.*"-m64"' %t.log
diff --git a/test/Driver/x86_features.c b/test/Driver/x86_features.c
index efb3681..d0473b3 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: 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
diff --git a/test/FixIt/fixit-at.c b/test/FixIt/fixit-at.c
index 42488f5..5eaa5c3 100644
--- a/test/FixIt/fixit-at.c
+++ b/test/FixIt/fixit-at.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fsyntax-only -fixit-at=fixit-at.c:3:1 %s -o - | clang-cc -verify -x c -
+// RUN: clang-cc -fixit-at=fixit-at.c:3:1 %s -o - | clang-cc -verify -x c -
_Complex cd;
diff --git a/test/FixIt/fixit-c90.c b/test/FixIt/fixit-c90.c
index 03c9495..7036b08 100644
--- a/test/FixIt/fixit-c90.c
+++ b/test/FixIt/fixit-c90.c
@@ -1,4 +1,4 @@
-/* RUN: clang-cc -fsyntax-only -std=c90 -pedantic -fixit %s -o - | clang-cc -pedantic -x c -std=c90 -Werror -
+/* RUN: clang-cc -std=c90 -pedantic -fixit %s -o - | clang-cc -pedantic -x c -std=c90 -Werror -
*/
/* This is a test of the various code modification hints that are
diff --git a/test/FixIt/fixit-errors-1.c b/test/FixIt/fixit-errors-1.c
index 14329ea..968d1d2 100644
--- a/test/FixIt/fixit-errors-1.c
+++ b/test/FixIt/fixit-errors-1.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fsyntax-only -pedantic -fixit %s -o - | clang-cc -pedantic -Werror -x c -
+// RUN: clang-cc -pedantic -fixit %s -o - | clang-cc -pedantic -Werror -x c -
/* This is a test of the various code modification hints that are
provided as part of warning or extension diagnostics. All of the
diff --git a/test/FixIt/fixit-errors.c b/test/FixIt/fixit-errors.c
index 9c5258d..030f505 100644
--- a/test/FixIt/fixit-errors.c
+++ b/test/FixIt/fixit-errors.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fsyntax-only -pedantic -fixit %s -o - | clang-cc -pedantic -Werror -x c -
+// RUN: clang-cc -pedantic -fixit %s -o - | clang-cc -pedantic -Werror -x c -
/* This is a test of the various code modification hints that are
provided as part of warning or extension diagnostics. All of the
@@ -8,3 +8,13 @@
struct s; // expected-note{{previous use is here}}
union s *s1; // expected-error{{use of 's' with tag type that does not match previous declaration}}
+
+struct Point {
+ float x, y, z;
+};
+
+struct Point *get_origin();
+
+void test_point() {
+ (void)get_origin->x;
+}
diff --git a/test/FixIt/fixit-objc.m b/test/FixIt/fixit-objc.m
index baef233..21aebfe 100644
--- a/test/FixIt/fixit-objc.m
+++ b/test/FixIt/fixit-objc.m
@@ -1,8 +1,36 @@
-// RUN: clang-cc -fsyntax-only -fixit-at=fixit-at.c:3:1 %s -o %t.m &&
-// RUN: clang-cc -verify %t.m
+// RUN: clang-cc -pedantic -fixit %s -o %t
+// RUN: clang-cc -pedantic -x objective-c %t -verify
+
+/* This is a test of the various code modification hints that are
+ provided as part of warning or extension diagnostics. All of the
+ warnings will be fixed by -fixit, and the resulting file should
+ compile cleanly with -Werror -pedantic. */
@protocol X;
void foo() {
<X> *P; // should be fixed to 'id<X>'.
}
+
+@class A;
+@class NSString;
+
+@interface Test
+- (void)test:(NSString *)string;
+
+@property (copy) NSString *property;
+@end
+
+void g(NSString *a);
+void h(id a);
+
+void f(Test *t) {
+ NSString *a = "Foo";
+ id b = "Foo";
+ A* c = "Foo"; // expected-warning {{incompatible pointer types initializing 'char [4]', expected 'A *'}}
+ g("Foo");
+ h("Foo");
+ h(("Foo"));
+ [t test:"Foo"];
+ t.property = "Foo";
+}
diff --git a/test/FixIt/fixit-pmem.cpp b/test/FixIt/fixit-pmem.cpp
index bb36f7f..f938009 100644
--- a/test/FixIt/fixit-pmem.cpp
+++ b/test/FixIt/fixit-pmem.cpp
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fsyntax-only -pedantic -fixit %s -o - | clang-cc -fsyntax-only -pedantic -Werror -x c++ -
+// RUN: clang-cc -pedantic -fixit %s -o - | clang-cc -fsyntax-only -pedantic -Werror -x c++ -
/* This is a test of the various code modification hints that are
provided as part of warning or extension diagnostics. All of the
diff --git a/test/FixIt/fixit.c b/test/FixIt/fixit.c
index 1378df4..4a32682 100644
--- a/test/FixIt/fixit.c
+++ b/test/FixIt/fixit.c
@@ -1,10 +1,14 @@
-// RUN: clang-cc -fsyntax-only -pedantic -fixit %s -o - | clang-cc -pedantic -Werror -x c -
+// RUN: clang-cc -pedantic -fixit %s -o - | grep -v 'CHECK' > %t
+// RUN: clang-cc -pedantic -Werror -x c -
+// RUN: FileCheck -input-file=%t %s
/* This is a test of the various code modification hints that are
provided as part of warning or extension diagnostics. All of the
warnings will be fixed by -fixit, and the resulting file should
compile cleanly with -Werror -pedantic. */
-#include <string.h> // FIXME: FIX-IT hint should add this for us!
+
+// FIXME: FIX-IT should add #include <string.h>?
+int strcmp(const char *s1, const char *s2);
void f0(void) { };
@@ -12,9 +16,13 @@ struct s {
int x, y;;
};
+// CHECK: _Complex double cd;
_Complex cd;
+// CHECK: struct s s0 = { .y = 5 };
struct s s0 = { y: 5 };
+
+// CHECK: int array0[5] = { [3] = 3 };
int array0[5] = { [3] 3 };
void f1(x, y)
@@ -25,5 +33,7 @@ int i0 = { 17 };
int f2(const char *my_string) {
// FIXME: terminal output isn't so good when "my_string" is shorter
+// CHECK: return strcmp(my_string , "foo") == 0;
return my_string == "foo";
}
+
diff --git a/test/FixIt/fixit.cpp b/test/FixIt/fixit.cpp
index ccddd95..dac1fa0 100644
--- a/test/FixIt/fixit.cpp
+++ b/test/FixIt/fixit.cpp
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fsyntax-only -pedantic -fixit %s -o - | clang-cc -fsyntax-only -pedantic -Werror -x c++ -
+// RUN: clang-cc -pedantic -fixit %s -o - | clang-cc -fsyntax-only -pedantic -Werror -x c++ -
/* This is a test of the various code modification hints that are
provided as part of warning or extension diagnostics. All of the
@@ -27,3 +27,12 @@ public:
struct CT<0> { }; // expected-error{{'template<>'}}
template<> class CT<1> { }; // expected-error{{tag type}}
+
+// PR5444
+namespace PR5444 {
+ void foo(int x, int y = 0);
+ void foo(int x, int y = 0) { }
+
+ void foo(int = 0);
+ void foo(int = 0) { }
+}
diff --git a/test/Frontend/ast-codegen.c b/test/Frontend/ast-codegen.c
index 1fe74d4..bd8a20a 100644
--- a/test/Frontend/ast-codegen.c
+++ b/test/Frontend/ast-codegen.c
@@ -1,4 +1,4 @@
-// RUN: clang -emit-ast -o %t.ast %s &&
+// RUN: clang -emit-ast -o %t.ast %s
// RUN: clang -emit-llvm -S -o - %t.ast | FileCheck %s
// CHECK: module asm "foo"
diff --git a/test/Frontend/ast-main.c b/test/Frontend/ast-main.c
index 7831406..ef072b9 100644
--- a/test/Frontend/ast-main.c
+++ b/test/Frontend/ast-main.c
@@ -1,6 +1,6 @@
-// RUN: clang -emit-llvm -S -o %t1.ll -x c - < %s &&
-// RUN: clang -emit-ast -o %t.ast %s &&
-// RUN: clang -emit-llvm -S -o %t2.ll -x ast - < %t.ast &&
+// RUN: clang -emit-llvm -S -o %t1.ll -x c - < %s
+// RUN: clang -emit-ast -o %t.ast %s
+// RUN: clang -emit-llvm -S -o %t2.ll -x ast - < %t.ast
// RUN: diff %t1.ll %t2.ll
int main() {
diff --git a/test/Frontend/cpp-output.c b/test/Frontend/cpp-output.c
index ee37f4c..9a6fc9b 100644
--- a/test/Frontend/cpp-output.c
+++ b/test/Frontend/cpp-output.c
@@ -1,10 +1,9 @@
-// RUN: clang -E -o %t -C %s &&
-// RUN: grep '^int x; // comment' %t &&
-// RUN: grep '^x x' %t &&
-// RUN: clang -E -o %t -CC %s &&
-// RUN: grep '^int x; // comment' %t &&
-// RUN: grep '^x /\* comment \*/ x /\* comment \*/' %t &&
-// RUN: true
+// RUN: clang -E -o %t -C %s
+// RUN: grep '^int x; // comment' %t
+// RUN: grep '^x x' %t
+// RUN: clang -E -o %t -CC %s
+// RUN: grep '^int x; // comment' %t
+// RUN: grep '^x /\* comment \*/ x /\* comment \*/' %t
int x; // comment
diff --git a/test/Frontend/darwin-version.c b/test/Frontend/darwin-version.c
index 3217b9a..4896aec 100644
--- a/test/Frontend/darwin-version.c
+++ b/test/Frontend/darwin-version.c
@@ -1,23 +1,22 @@
-// RUN: clang -ccc-host-triple armv6-apple-darwin9 -dM -E -o %t %s &&
-// RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | grep '30000' | count 1 &&
-// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | count 0 &&
-// RUN: clang -ccc-host-triple armv6-apple-darwin9 -miphoneos-version-min=2.0 -dM -E -o %t %s &&
-// RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | grep '20000' | count 1 &&
-// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | count 0 &&
-// RUN: clang -ccc-host-triple armv6-apple-darwin9 -miphoneos-version-min=2.2 -dM -E -o %t %s &&
-// RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | grep '20200' | count 1 &&
-// RUN: clang -ccc-host-triple i686-apple-darwin8 -dM -E -o %t %s &&
-// RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | count 0 &&
-// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1040' | count 1 &&
-// RUN: clang -ccc-host-triple i686-apple-darwin9 -dM -E -o %t %s &&
-// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1050' | count 1 &&
-// RUN: clang -ccc-host-triple i686-apple-darwin10 -dM -E -o %t %s &&
-// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1060' | count 1 &&
-// RUN: clang -ccc-host-triple i686-apple-darwin9 -mmacosx-version-min=10.4 -dM -E -o %t %s &&
-// RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | count 0 &&
-// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1040' | count 1 &&
-// RUN: clang -ccc-host-triple i686-apple-darwin9 -mmacosx-version-min=10.5 -dM -E -o %t %s &&
-// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1050' | count 1 &&
-// RUN: clang -ccc-host-triple i686-apple-darwin9 -mmacosx-version-min=10.6 -dM -E -o %t %s &&
-// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1060' | count 1 &&
-// RUN: true
+// RUN: clang -ccc-host-triple armv6-apple-darwin9 -dM -E -o %t %s
+// RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | grep '30000' | count 1
+// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | count 0
+// RUN: clang -ccc-host-triple armv6-apple-darwin9 -miphoneos-version-min=2.0 -dM -E -o %t %s
+// RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | grep '20000' | count 1
+// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | count 0
+// RUN: clang -ccc-host-triple armv6-apple-darwin9 -miphoneos-version-min=2.2 -dM -E -o %t %s
+// RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | grep '20200' | count 1
+// RUN: clang -ccc-host-triple i686-apple-darwin8 -dM -E -o %t %s
+// RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | count 0
+// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1040' | count 1
+// RUN: clang -ccc-host-triple i686-apple-darwin9 -dM -E -o %t %s
+// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1050' | count 1
+// RUN: clang -ccc-host-triple i686-apple-darwin10 -dM -E -o %t %s
+// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1060' | count 1
+// RUN: clang -ccc-host-triple i686-apple-darwin9 -mmacosx-version-min=10.4 -dM -E -o %t %s
+// RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | count 0
+// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1040' | count 1
+// RUN: clang -ccc-host-triple i686-apple-darwin9 -mmacosx-version-min=10.5 -dM -E -o %t %s
+// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1050' | count 1
+// RUN: clang -ccc-host-triple i686-apple-darwin9 -mmacosx-version-min=10.6 -dM -E -o %t %s
+// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1060' | count 1
diff --git a/test/Frontend/dependency-gen.c b/test/Frontend/dependency-gen.c
index 458d8d5..9185921 100644
--- a/test/Frontend/dependency-gen.c
+++ b/test/Frontend/dependency-gen.c
@@ -1,8 +1,8 @@
// rdar://6533411
-// RUN: clang -MD -MF %t.d -S -x c -o %t.o %s &&
-// RUN: grep '.*dependency-gen.*:' %t.d &&
-// RUN: grep 'dependency-gen.c' %t.d &&
+// RUN: clang -MD -MF %t.d -S -x c -o %t.o %s
+// RUN: grep '.*dependency-gen.*:' %t.d
+// RUN: grep 'dependency-gen.c' %t.d
-// RUN: clang -S -M -x c %s -o %t.d &&
-// RUN: grep '.*dependency-gen.*:' %t.d &&
+// RUN: clang -S -M -x c %s -o %t.d
+// RUN: grep '.*dependency-gen.*:' %t.d
// RUN: grep 'dependency-gen.c' %t.d
diff --git a/test/Frontend/rewrite-macros.c b/test/Frontend/rewrite-macros.c
index 32e02ec..2d9fef4 100644
--- a/test/Frontend/rewrite-macros.c
+++ b/test/Frontend/rewrite-macros.c
@@ -1,18 +1,17 @@
-// RUN: clang-cc -verify --rewrite-macros -o %t %s &&
+// RUN: clang-cc -verify --rewrite-macros -o %t %s
#define A(a,b) a ## b
-// RUN: grep '12 */\*A\*/ /\*(1,2)\*/' %t &&
+// RUN: grep '12 */\*A\*/ /\*(1,2)\*/' %t
A(1,2)
-// RUN: grep '/\*_Pragma("mark")\*/' %t &&
+// RUN: grep '/\*_Pragma("mark")\*/' %t
_Pragma("mark")
-// RUN: grep "//#warning eek" %t &&
+// RUN: grep "//#warning eek" %t
/* expected-warning {{#warning eek}} */ #warning eek
-// RUN: grep "//#pragma mark mark" %t &&
+// RUN: grep "//#pragma mark mark" %t
#pragma mark mark
-// RUN: true
diff --git a/test/Frontend/stdin.c b/test/Frontend/stdin.c
index 5b719b2..35fe45d 100644
--- a/test/Frontend/stdin.c
+++ b/test/Frontend/stdin.c
@@ -1,3 +1,3 @@
-// RUN: clang-cc -E - < /dev/null > %t &&
+// RUN: clang-cc -E - < /dev/null > %t
// RUN: grep '<built-in>' %t
diff --git a/test/Index/Inputs/c-index-pch.h b/test/Index/Inputs/c-index-pch.h
new file mode 100644
index 0000000..6dda180
--- /dev/null
+++ b/test/Index/Inputs/c-index-pch.h
@@ -0,0 +1,7 @@
+#ifndef C_INDEX_PCH_H
+#define C_INDEX_PCH_H
+
+void foo(int i, float f);
+extern int bar;
+
+#endif // C_INDEX_PCH_H
diff --git a/test/Index/Inputs/foo.h b/test/Index/Inputs/foo.h
new file mode 100644
index 0000000..7670c00
--- /dev/null
+++ b/test/Index/Inputs/foo.h
@@ -0,0 +1,8 @@
+extern int global_var;
+
+void foo_func(int param1);
+void bar_func(void);
+
+struct MyStruct {
+ int field_var;
+};
diff --git a/test/Index/Inputs/lit.local.cfg b/test/Index/Inputs/lit.local.cfg
new file mode 100644
index 0000000..e6f55ee
--- /dev/null
+++ b/test/Index/Inputs/lit.local.cfg
@@ -0,0 +1 @@
+config.suffixes = []
diff --git a/test/Index/Inputs/objc.h b/test/Index/Inputs/objc.h
new file mode 100644
index 0000000..c671add
--- /dev/null
+++ b/test/Index/Inputs/objc.h
@@ -0,0 +1,11 @@
+@interface Base {
+ int my_var;
+}
+-(int) my_var;
+-(void) my_method: (int)param;
++(void) my_method: (int)param;
+@end
+
+@interface Sub : Base
+-(void) my_method: (int)param;
+@end
diff --git a/test/Index/Inputs/t1.c b/test/Index/Inputs/t1.c
new file mode 100644
index 0000000..ceaad4c
--- /dev/null
+++ b/test/Index/Inputs/t1.c
@@ -0,0 +1,28 @@
+#include "foo.h"
+
+void foo_func(int param1) {
+ int local_var = global_var;
+ for (int for_var = 100; for_var < 500; ++for_var) {
+ local_var = param1 + for_var;
+ }
+ bar_func();
+}
+
+struct S1 {
+ int x;
+};
+
+struct S2 {
+ int x;
+};
+
+void field_test(void) {
+ struct S1 s1;
+ s1.x = 0;
+ ((struct S2 *)0)->x = 0;
+
+ struct MyStruct ms;
+ ms.field_var = 10;
+}
+
+int (^CP)(int) = ^(int x) { return x * global_var; };
diff --git a/test/Index/Inputs/t1.m b/test/Index/Inputs/t1.m
new file mode 100644
index 0000000..b7c86cd
--- /dev/null
+++ b/test/Index/Inputs/t1.m
@@ -0,0 +1,20 @@
+#include "objc.h"
+
+static void foo() {
+ Base *base;
+ int x = [base my_var];
+ [base my_method:x];
+ [Base my_method:x];
+}
+
+@implementation Base
+-(int) my_var {
+ return my_var;
+}
+
+-(void) my_method: (int)param {
+}
+
++(void) my_method: (int)param {
+}
+@end
diff --git a/test/Index/Inputs/t2.c b/test/Index/Inputs/t2.c
new file mode 100644
index 0000000..76d5d6c
--- /dev/null
+++ b/test/Index/Inputs/t2.c
@@ -0,0 +1,11 @@
+#include "foo.h"
+
+int global_var = 10;
+
+void bar_func(void) {
+ global_var += 100;
+ foo_func(global_var);
+
+ struct MyStruct *ms;
+ ms->field_var = 10;
+}
diff --git a/test/Index/Inputs/t2.m b/test/Index/Inputs/t2.m
new file mode 100644
index 0000000..3f103ee
--- /dev/null
+++ b/test/Index/Inputs/t2.m
@@ -0,0 +1,13 @@
+#include "objc.h"
+
+static void foo() {
+ Sub *sub;
+ int x = [sub my_var];
+ [sub my_method:x];
+ [Sub my_method:x];
+}
+
+@implementation Sub
+-(void) my_method: (int)param {
+}
+@end
diff --git a/test/Index/TestClassDecl.m b/test/Index/TestClassDecl.m
new file mode 100644
index 0000000..7256d2b
--- /dev/null
+++ b/test/Index/TestClassDecl.m
@@ -0,0 +1,52 @@
+// RUN: clang-cc -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fblocks -emit-pch -x objective-c %s -o %t.ast
+// RUN: c-index-test -test-file-scan %t.ast %s | FileCheck -check-prefix=scan %s
+// RUN: c-index-test -test-load-tu %t.ast local | FileCheck -check-prefix=load %s
+
+// This test checks how the @class resolves as a cursor when there is a real definition
+// that follows. <rdar://problem/7383421>
+
+@class Foo;
+
+@interface Foo
+@end
+
+void function(Foo * arg)
+{
+ // nothing here.
+}
+
+// CHECK-scan: {start_line=1 start_col=1 end_line=7 end_col=1} Invalid Cursor => NoDeclFound
+// CHECK-scan: {start_line=8 start_col=1 end_line=8 end_col=7} Invalid Cursor => NotImplemented
+// CHECK-scan: {start_line=8 start_col=8 end_line=8 end_col=10} ObjCClassRef=Foo:8:1
+// CHECK-scan: {start_line=8 start_col=11 end_line=9 end_col=1} Invalid Cursor => NoDeclFound
+// CHECK-scan: {start_line=10 start_col=1 end_line=11 end_col=1} ObjCInterfaceDecl=Foo:10:1
+// CHECK-scan: {start_line=11 start_col=2 end_line=12 end_col=1} Invalid Cursor => NoDeclFound
+// CHECK-scan: {start_line=13 start_col=1 end_line=13 end_col=4} FunctionDecl=function:13:6
+// CHECK-scan: {start_line=13 start_col=5 end_line=13 end_col=5} Invalid Cursor => NoDeclFound
+// CHECK-scan: {start_line=13 start_col=6 end_line=13 end_col=14} FunctionDecl=function:13:6
+// CHECK-scan: {start_line=13 start_col=15 end_line=13 end_col=17} ObjCClassRef=Foo:13:21
+// CHECK-scan: {start_line=13 start_col=18 end_line=13 end_col=18} FunctionDecl=function:13:6
+// CHECK-scan: {start_line=13 start_col=19 end_line=13 end_col=19} ParmDecl=arg:13:21
+// CHECK-scan: {start_line=13 start_col=20 end_line=13 end_col=20} FunctionDecl=function:13:6
+// CHECK-scan: {start_line=13 start_col=21 end_line=13 end_col=23} ParmDecl=arg:13:21
+// CHECK-scan: {start_line=13 start_col=24 end_line=16 end_col=1} FunctionDecl=function:13:6
+// CHECK-scan: {start_line=16 start_col=2 end_line=52 end_col=1} Invalid Cursor => NoDeclFound
+
+// CHECK-load: <invalid loc>:0:0: TypedefDecl=__int128_t:0:0 [Context=TestClassDecl.m]
+// CHECK-load: <invalid loc>:0:0: TypedefDecl=__uint128_t:0:0 [Context=TestClassDecl.m]
+// CHECK-load: <invalid loc>:0:0: StructDecl=objc_selector:0:0 [Context=TestClassDecl.m]
+// CHECK-load: <invalid loc>:0:0: TypedefDecl=SEL:0:0 [Context=TestClassDecl.m]
+// CHECK-load: <invalid loc>:0:0: ObjCInterfaceDecl=Protocol:0:0 [Context=TestClassDecl.m]
+// CHECK-load: <invalid loc>:0:0: TypedefDecl=id:0:0 [Context=TestClassDecl.m]
+// CHECK-load: <invalid loc>:0:0: TypedefDecl=Class:0:0 [Context=TestClassDecl.m]
+// CHECK-load: <invalid loc>:80:16: StructDecl=__va_list_tag:80:16 [Context=TestClassDecl.m]
+// CHECK-load: <invalid loc>:80:42: FieldDecl=gp_offset:80:42 [Context=__va_list_tag]
+// CHECK-load: <invalid loc>:80:63: FieldDecl=fp_offset:80:63 [Context=__va_list_tag]
+// CHECK-load: <invalid loc>:80:81: FieldDecl=overflow_arg_area:80:81 [Context=__va_list_tag]
+// CHECK-load: <invalid loc>:80:107: FieldDecl=reg_save_area:80:107 [Context=__va_list_tag]
+// CHECK-load: <invalid loc>:80:123: TypedefDecl=__va_list_tag:80:123 [Context=TestClassDecl.m]
+// CHECK-load: <invalid loc>:80:159: TypedefDecl=__builtin_va_list:80:159 [Context=TestClassDecl.m]
+// CHECK-load: TestClassDecl.m:10:12: ObjCInterfaceDecl=Foo:10:1 [Context=TestClassDecl.m]
+// CHECK-load: TestClassDecl.m:13:6: FunctionDefn=function [Context=TestClassDecl.m]
+// CHECK-load: TestClassDecl.m:13:21: ParmDecl=arg:13:21 [Context=function]
+
diff --git a/test/Index/TestClassForwardDecl.m b/test/Index/TestClassForwardDecl.m
new file mode 100644
index 0000000..4584445
--- /dev/null
+++ b/test/Index/TestClassForwardDecl.m
@@ -0,0 +1,46 @@
+// RUN: clang-cc -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fblocks -emit-pch -x objective-c %s -o %t.ast
+// RUN: c-index-test -test-file-scan %t.ast %s | FileCheck -check-prefix=scan %s
+// RUN: c-index-test -test-load-tu %t.ast local | FileCheck -check-prefix=load %s
+
+// This test checks how the @class resolves as a cursor when the @interface is implicitly defined.
+// See TestClassDecl.m for the corresponding test case. (<rdar://problem/7383421>)
+
+@class Foo;
+
+void function(Foo * arg)
+{
+ // nothing here.
+}
+
+// CHECK-scan: {start_line=1 start_col=1 end_line=7 end_col=1} Invalid Cursor => NoDeclFound
+// CHECK-scan: {start_line=8 start_col=1 end_line=8 end_col=7} Invalid Cursor => NotImplemented
+// CHECK-scan: {start_line=8 start_col=8 end_line=8 end_col=10} ObjCClassRef=Foo:8:1
+// CHECK-scan: {start_line=8 start_col=11 end_line=9 end_col=1} Invalid Cursor => NoDeclFound
+// CHECK-scan: {start_line=10 start_col=1 end_line=10 end_col=4} FunctionDecl=function:10:6
+// CHECK-scan: {start_line=10 start_col=5 end_line=10 end_col=5} Invalid Cursor => NoDeclFound
+// CHECK-scan: {start_line=10 start_col=6 end_line=10 end_col=14} FunctionDecl=function:10:6
+// CHECK-scan: {start_line=10 start_col=15 end_line=10 end_col=17} ObjCClassRef=Foo:10:21
+// CHECK-scan: {start_line=10 start_col=18 end_line=10 end_col=18} FunctionDecl=function:10:6
+// CHECK-scan: {start_line=10 start_col=19 end_line=10 end_col=19} ParmDecl=arg:10:21
+// CHECK-scan: {start_line=10 start_col=20 end_line=10 end_col=20} FunctionDecl=function:10:6
+// CHECK-scan: {start_line=10 start_col=21 end_line=10 end_col=23} ParmDecl=arg:10:21
+// CHECK-scan: {start_line=10 start_col=24 end_line=13 end_col=1} FunctionDecl=function:10:6
+// CHECK-scan: {start_line=13 start_col=2 end_line=46 end_col=1} Invalid Cursor => NoDeclFound
+
+// CHECK-load: <invalid loc>:0:0: TypedefDecl=__int128_t:0:0 [Context=TestClassForwardDecl.m]
+// CHECK-load: <invalid loc>:0:0: TypedefDecl=__uint128_t:0:0 [Context=TestClassForwardDecl.m]
+// CHECK-load: <invalid loc>:0:0: StructDecl=objc_selector:0:0 [Context=TestClassForwardDecl.m]
+// CHECK-load: <invalid loc>:0:0: TypedefDecl=SEL:0:0 [Context=TestClassForwardDecl.m]
+// CHECK-load: <invalid loc>:0:0: ObjCInterfaceDecl=Protocol:0:0 [Context=TestClassForwardDecl.m]
+// CHECK-load: <invalid loc>:0:0: TypedefDecl=id:0:0 [Context=TestClassForwardDecl.m]
+// CHECK-load: <invalid loc>:0:0: TypedefDecl=Class:0:0 [Context=TestClassForwardDecl.m]
+// CHECK-load: <invalid loc>:80:16: StructDecl=__va_list_tag:80:16 [Context=TestClassForwardDecl.m]
+// CHECK-load: <invalid loc>:80:42: FieldDecl=gp_offset:80:42 [Context=__va_list_tag]
+// CHECK-load: <invalid loc>:80:63: FieldDecl=fp_offset:80:63 [Context=__va_list_tag]
+// CHECK-load: <invalid loc>:80:81: FieldDecl=overflow_arg_area:80:81 [Context=__va_list_tag]
+// CHECK-load: <invalid loc>:80:107: FieldDecl=reg_save_area:80:107 [Context=__va_list_tag]
+// CHECK-load: <invalid loc>:80:123: TypedefDecl=__va_list_tag:80:123 [Context=TestClassForwardDecl.m]
+// CHECK-load: <invalid loc>:80:159: TypedefDecl=__builtin_va_list:80:159 [Context=TestClassForwardDecl.m]
+// CHECK-load: TestClassForwardDecl.m:10:6: FunctionDefn=function [Context=TestClassForwardDecl.m]
+// CHECK-load: TestClassForwardDecl.m:10:21: ParmDecl=arg:10:21 [Context=function]
+
diff --git a/test/Index/c-index-api-loadTU-test.m b/test/Index/c-index-api-loadTU-test.m
new file mode 100644
index 0000000..5427764
--- /dev/null
+++ b/test/Index/c-index-api-loadTU-test.m
@@ -0,0 +1,224 @@
+// RUN: clang-cc -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fblocks -emit-pch -x objective-c %s -o %t.ast
+// RUN: c-index-test -test-load-tu %t.ast all | FileCheck %s
+
+// CHECK: <invalid loc>:0:0: TypedefDecl=__int128_t:0:0 [Context=c-index-api-loadTU-test.m]
+// CHECK: <invalid loc>:0:0: TypedefDecl=__uint128_t:0:0 [Context=c-index-api-loadTU-test.m]
+// CHECK: <invalid loc>:0:0: StructDecl=objc_selector:0:0 [Context=c-index-api-loadTU-test.m]
+// CHECK: <invalid loc>:0:0: TypedefDecl=SEL:0:0 [Context=c-index-api-loadTU-test.m]
+// CHECK: <invalid loc>:0:0: ObjCInterfaceDecl=Protocol:0:0 [Context=c-index-api-loadTU-test.m]
+// CHECK: <invalid loc>:0:0: TypedefDecl=id:0:0 [Context=c-index-api-loadTU-test.m]
+// CHECK: <invalid loc>:0:0: TypedefDecl=Class:0:0 [Context=c-index-api-loadTU-test.m]
+// CHECK: <invalid loc>:80:16: StructDecl=__va_list_tag:80:16 [Context=c-index-api-loadTU-test.m]
+// CHECK: <invalid loc>:80:42: FieldDecl=gp_offset:80:42 [Context=__va_list_tag]
+// CHECK: <invalid loc>:80:63: FieldDecl=fp_offset:80:63 [Context=__va_list_tag]
+// CHECK: <invalid loc>:80:81: FieldDecl=overflow_arg_area:80:81 [Context=__va_list_tag]
+// CHECK: <invalid loc>:80:107: FieldDecl=reg_save_area:80:107 [Context=__va_list_tag]
+// CHECK: <invalid loc>:80:123: TypedefDecl=__va_list_tag:80:123 [Context=c-index-api-loadTU-test.m]
+// CHECK: <invalid loc>:80:159: TypedefDecl=__builtin_va_list:80:159 [Context=c-index-api-loadTU-test.m]
+//
+
+@interface Foo
+{
+}
+
+- foo;
++ fooC;
+
+@end
+
+@interface Bar : Foo
+{
+}
+
+@end
+
+@interface Foo (FooCat)
+- (int) catMethodWithFloat:(float) fArg;
+- (float) floatMethod;
+@end
+
+@protocol Proto
+- pMethod;
+@end
+
+@protocol SubP <Proto>
+- spMethod;
+@end
+
+@interface Baz : Bar <SubP>
+{
+ int _anIVar;
+}
+
+- (Foo *) bazMethod;
+
+@end
+
+enum {
+ someEnum
+};
+
+// CHECK: c-index-api-loadTU-test.m:20:12: ObjCInterfaceDecl=Foo:20:1 [Context=c-index-api-loadTU-test.m]
+// CHECK: c-index-api-loadTU-test.m:24:1: ObjCInstanceMethodDecl=foo:24:1 [Context=Foo]
+// CHECK: c-index-api-loadTU-test.m:25:1: ObjCClassMethodDecl=fooC:25:1 [Context=Foo]
+// CHECK: c-index-api-loadTU-test.m:29:12: ObjCInterfaceDecl=Bar:29:1 [Context=c-index-api-loadTU-test.m]
+// CHECK: c-index-api-loadTU-test.m:29:18: ObjCSuperClassRef=Foo:29:1 [Context=Bar]
+// CHECK: c-index-api-loadTU-test.m:35:1: ObjCCategoryDecl=FooCat:35:1 [Context=c-index-api-loadTU-test.m]
+// CHECK: c-index-api-loadTU-test.m:20:1: ObjCClassRef=Foo:35:1 [Context=FooCat]
+// CHECK: c-index-api-loadTU-test.m:36:1: ObjCInstanceMethodDecl=catMethodWithFloat::36:1 [Context=FooCat]
+// CHECK: c-index-api-loadTU-test.m:37:1: ObjCInstanceMethodDecl=floatMethod:37:1 [Context=FooCat]
+// CHECK: c-index-api-loadTU-test.m:40:1: ObjCProtocolDecl=Proto:40:1 [Context=c-index-api-loadTU-test.m]
+// CHECK: c-index-api-loadTU-test.m:41:1: ObjCInstanceMethodDecl=pMethod:41:1 [Context=Proto]
+// CHECK: c-index-api-loadTU-test.m:44:1: ObjCProtocolDecl=SubP:44:1 [Context=c-index-api-loadTU-test.m]
+// CHECK: c-index-api-loadTU-test.m:40:1: ObjCProtocolRef=Proto:40:1 [Context=SubP]
+// CHECK: c-index-api-loadTU-test.m:45:1: ObjCInstanceMethodDecl=spMethod:45:1 [Context=SubP]
+// CHECK: c-index-api-loadTU-test.m:48:12: ObjCInterfaceDecl=Baz:48:1 [Context=c-index-api-loadTU-test.m]
+// CHECK: c-index-api-loadTU-test.m:48:18: ObjCSuperClassRef=Bar:48:1 [Context=Baz]
+// CHECK: c-index-api-loadTU-test.m:44:1: ObjCProtocolRef=SubP:44:1 [Context=Baz]
+// CHECK: c-index-api-loadTU-test.m:50:9: ObjCIvarDecl=_anIVar:50:9 [Context=Baz]
+// CHECK: c-index-api-loadTU-test.m:53:1: ObjCInstanceMethodDecl=bazMethod:53:1 [Context=Baz]
+// CHECK: c-index-api-loadTU-test.m:57:1: EnumDecl=:57:1 [Context=c-index-api-loadTU-test.m]
+// CHECK: c-index-api-loadTU-test.m:58:3: EnumConstantDecl=someEnum:58:3 [Context=]
+
+int main (int argc, const char * argv[]) {
+ Baz * bee;
+ id a = [bee foo];
+ id <SubP> c = [Foo fooC];
+ id <Proto> d;
+ d = c;
+ [d pMethod];
+ [bee catMethodWithFloat:[bee floatMethod]];
+ main(someEnum, (const char **)bee);
+}
+
+// CHECK: c-index-api-loadTU-test.m:83:5: FunctionDefn=main [Context=c-index-api-loadTU-test.m]
+// CHECK: c-index-api-loadTU-test.m:83:15: ParmDecl=argc:83:15 [Context=main]
+// CHECK: c-index-api-loadTU-test.m:83:34: ParmDecl=argv:83:34 [Context=main]
+// CHECK: c-index-api-loadTU-test.m:84:8: VarDecl=bee:84:8 [Context=main]
+// CHECK: c-index-api-loadTU-test.m:85:5: VarDecl=a:85:5 [Context=main]
+// CHECK: c-index-api-loadTU-test.m:86:12: VarDecl=c:86:12 [Context=main]
+// CHECK: c-index-api-loadTU-test.m:87:13: VarDecl=d:87:13 [Context=main]
+// CHECK: c-index-api-loadTU-test.m:84:2: ObjCClassRef=Baz:84:8 [Context:Baz]
+// CHECK: c-index-api-loadTU-test.m:84:3: ObjCClassRef=Baz:84:8 [Context:Baz]
+// CHECK: c-index-api-loadTU-test.m:84:4: ObjCClassRef=Baz:84:8 [Context:Baz]
+// CHECK: c-index-api-loadTU-test.m:84:6: VarDecl=bee:84:8 [Context:bee]
+// CHECK: c-index-api-loadTU-test.m:84:8: VarDecl=bee:84:8 [Context:bee]
+// CHECK: c-index-api-loadTU-test.m:84:9: VarDecl=bee:84:8 [Context:bee]
+// CHECK: c-index-api-loadTU-test.m:84:10: VarDecl=bee:84:8 [Context:bee]
+// CHECK: <invalid loc>:85:2: TypedefDecl=id:0:0 [Context:id]
+// CHECK: <invalid loc>:85:3: TypedefDecl=id:0:0 [Context:id]
+// CHECK: c-index-api-loadTU-test.m:85:5: VarDecl=a:85:5 [Context:a]
+// CHECK: c-index-api-loadTU-test.m:85:6: VarDecl=a:85:5 [Context:a]
+// CHECK: c-index-api-loadTU-test.m:85:7: VarDecl=a:85:5 [Context:a]
+// CHECK: c-index-api-loadTU-test.m:85:8: VarDecl=a:85:5 [Context:a]
+// CHECK: c-index-api-loadTU-test.m:85:9: ObjCSelectorRef=foo:24:1 [Context:a]
+// CHECK: c-index-api-loadTU-test.m:85:10: VarRef=bee:84:8 [Context:a]
+// CHECK: c-index-api-loadTU-test.m:85:11: VarRef=bee:84:8 [Context:a]
+// CHECK: c-index-api-loadTU-test.m:85:12: VarRef=bee:84:8 [Context:a]
+// CHECK: c-index-api-loadTU-test.m:85:13: ObjCSelectorRef=foo:24:1 [Context:a]
+// CHECK: c-index-api-loadTU-test.m:85:14: ObjCSelectorRef=foo:24:1 [Context:a]
+// CHECK: c-index-api-loadTU-test.m:85:15: ObjCSelectorRef=foo:24:1 [Context:a]
+// CHECK: c-index-api-loadTU-test.m:85:16: ObjCSelectorRef=foo:24:1 [Context:a]
+// CHECK: c-index-api-loadTU-test.m:85:17: ObjCSelectorRef=foo:24:1 [Context:a]
+// CHECK: <invalid loc>:86:2: TypedefDecl=id:0:0 [Context:id]
+// CHECK: <invalid loc>:86:3: TypedefDecl=id:0:0 [Context:id]
+// CHECK: c-index-api-loadTU-test.m:86:5: VarDecl=c:86:12 [Context:c]
+// CHECK: c-index-api-loadTU-test.m:86:6: ObjCProtocolRef=SubP:86:12 [Context:SubP]
+// CHECK: c-index-api-loadTU-test.m:86:7: ObjCProtocolRef=SubP:86:12 [Context:SubP]
+// CHECK: c-index-api-loadTU-test.m:86:8: ObjCProtocolRef=SubP:86:12 [Context:SubP]
+// CHECK: c-index-api-loadTU-test.m:86:9: ObjCProtocolRef=SubP:86:12 [Context:SubP]
+// CHECK: c-index-api-loadTU-test.m:86:10: VarDecl=c:86:12 [Context:c]
+// CHECK: c-index-api-loadTU-test.m:86:12: VarDecl=c:86:12 [Context:c]
+// CHECK: c-index-api-loadTU-test.m:86:13: VarDecl=c:86:12 [Context:c]
+// CHECK: c-index-api-loadTU-test.m:86:14: VarDecl=c:86:12 [Context:c]
+// CHECK: c-index-api-loadTU-test.m:86:15: VarDecl=c:86:12 [Context:c]
+// CHECK: c-index-api-loadTU-test.m:86:16: ObjCSelectorRef=fooC:25:1 [Context:c]
+// CHECK: c-index-api-loadTU-test.m:86:17: ObjCSelectorRef=fooC:25:1 [Context:c]
+// CHECK: c-index-api-loadTU-test.m:86:18: ObjCSelectorRef=fooC:25:1 [Context:c]
+// CHECK: c-index-api-loadTU-test.m:86:19: ObjCSelectorRef=fooC:25:1 [Context:c]
+// CHECK: c-index-api-loadTU-test.m:86:20: ObjCSelectorRef=fooC:25:1 [Context:c]
+// CHECK: c-index-api-loadTU-test.m:86:21: ObjCSelectorRef=fooC:25:1 [Context:c]
+// CHECK: c-index-api-loadTU-test.m:86:22: ObjCSelectorRef=fooC:25:1 [Context:c]
+// CHECK: c-index-api-loadTU-test.m:86:23: ObjCSelectorRef=fooC:25:1 [Context:c]
+// CHECK: c-index-api-loadTU-test.m:86:24: ObjCSelectorRef=fooC:25:1 [Context:c]
+// CHECK: c-index-api-loadTU-test.m:86:25: ObjCSelectorRef=fooC:25:1 [Context:c]
+// CHECK: <invalid loc>:87:2: TypedefDecl=id:0:0 [Context:id]
+// CHECK: <invalid loc>:87:3: TypedefDecl=id:0:0 [Context:id]
+// CHECK: c-index-api-loadTU-test.m:87:5: VarDecl=d:87:13 [Context:d]
+// CHECK: c-index-api-loadTU-test.m:87:6: ObjCProtocolRef=Proto:87:13 [Context:Proto]
+// CHECK: c-index-api-loadTU-test.m:87:7: ObjCProtocolRef=Proto:87:13 [Context:Proto]
+// CHECK: c-index-api-loadTU-test.m:87:8: ObjCProtocolRef=Proto:87:13 [Context:Proto]
+// CHECK: c-index-api-loadTU-test.m:87:9: ObjCProtocolRef=Proto:87:13 [Context:Proto]
+// CHECK: c-index-api-loadTU-test.m:87:10: ObjCProtocolRef=Proto:87:13 [Context:Proto]
+// CHECK: c-index-api-loadTU-test.m:87:11: VarDecl=d:87:13 [Context:d]
+// CHECK: c-index-api-loadTU-test.m:87:13: VarDecl=d:87:13 [Context:d]
+// CHECK: c-index-api-loadTU-test.m:88:2: VarRef=d:87:13 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:88:6: VarRef=c:86:12 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:89:2: ObjCSelectorRef=pMethod:41:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:89:3: VarRef=d:87:13 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:89:4: ObjCSelectorRef=pMethod:41:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:89:5: ObjCSelectorRef=pMethod:41:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:89:6: ObjCSelectorRef=pMethod:41:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:89:7: ObjCSelectorRef=pMethod:41:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:89:8: ObjCSelectorRef=pMethod:41:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:89:9: ObjCSelectorRef=pMethod:41:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:89:10: ObjCSelectorRef=pMethod:41:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:89:11: ObjCSelectorRef=pMethod:41:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:89:12: ObjCSelectorRef=pMethod:41:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:2: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:3: VarRef=bee:84:8 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:4: VarRef=bee:84:8 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:5: VarRef=bee:84:8 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:6: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:7: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:8: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:9: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:10: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:11: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:12: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:13: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:14: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:15: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:16: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:17: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:18: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:19: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:20: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:21: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:22: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:23: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:24: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:25: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:26: ObjCSelectorRef=floatMethod:37:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:27: VarRef=bee:84:8 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:28: VarRef=bee:84:8 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:29: VarRef=bee:84:8 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:30: ObjCSelectorRef=floatMethod:37:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:31: ObjCSelectorRef=floatMethod:37:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:32: ObjCSelectorRef=floatMethod:37:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:33: ObjCSelectorRef=floatMethod:37:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:34: ObjCSelectorRef=floatMethod:37:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:35: ObjCSelectorRef=floatMethod:37:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:36: ObjCSelectorRef=floatMethod:37:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:37: ObjCSelectorRef=floatMethod:37:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:38: ObjCSelectorRef=floatMethod:37:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:39: ObjCSelectorRef=floatMethod:37:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:40: ObjCSelectorRef=floatMethod:37:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:41: ObjCSelectorRef=floatMethod:37:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:42: ObjCSelectorRef=floatMethod:37:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:90:43: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:91:3: FunctionRef=main:83:5 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:91:4: FunctionRef=main:83:5 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:91:5: FunctionRef=main:83:5 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:91:6: FunctionRef=main:83:5 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:91:8: EnumConstantRef=someEnum:58:3 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:91:9: EnumConstantRef=someEnum:58:3 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:91:10: EnumConstantRef=someEnum:58:3 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:91:11: EnumConstantRef=someEnum:58:3 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:91:12: EnumConstantRef=someEnum:58:3 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:91:13: EnumConstantRef=someEnum:58:3 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:91:14: EnumConstantRef=someEnum:58:3 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:91:15: EnumConstantRef=someEnum:58:3 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:91:33: VarRef=bee:84:8 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:91:34: VarRef=bee:84:8 [Context:main]
+// CHECK: c-index-api-loadTU-test.m:91:35: VarRef=bee:84:8 [Context:main]
diff --git a/test/Index/c-index-api-test.m b/test/Index/c-index-api-test.m
index 20d4d7b..55669e7 100644
--- a/test/Index/c-index-api-test.m
+++ b/test/Index/c-index-api-test.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple x86_64-apple-darwin10 -emit-pch -x objective-c %s -o %t.ast &&
+// RUN: clang-cc -triple x86_64-apple-darwin10 -emit-pch -x objective-c %s -o %t.ast
// RUN: c-index-test %t.ast all | FileCheck %s
// CHECK: <invalid loc>:0:0: TypedefDecl=__int128_t:0:0 [Context=c-index-api-test.m]
diff --git a/test/Index/c-index-getCursor-test.m b/test/Index/c-index-getCursor-test.m
new file mode 100644
index 0000000..3653a9c
--- /dev/null
+++ b/test/Index/c-index-getCursor-test.m
@@ -0,0 +1,160 @@
+// RUN: clang-cc -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fblocks -emit-pch -x objective-c %s -o %t.ast
+// RUN: c-index-test -test-file-scan %t.ast %s | FileCheck %s
+@interface Foo
+{
+}
+
+- foo;
++ fooC;
+
+@end
+
+@interface Bar : Foo
+{
+}
+
+@end
+
+@interface Foo (FooCat)
+- (int) catMethodWithFloat:(float) fArg;
+- (float) floatMethod;
+@end
+
+@protocol Proto
+- pMethod;
+@end
+
+@protocol SubP <Proto>
+- spMethod;
+@end
+
+@interface Baz : Bar <SubP>
+{
+ int _anIVar;
+}
+
+- (Foo *) bazMethod;
+
+@end
+
+enum {
+ someEnum
+};
+
+int main (int argc, const char * argv[]) {
+ Baz * bee;
+ id a = [bee foo];
+ id <SubP> c = [Foo fooC];
+ id <Proto> d;
+ d = c;
+ [d pMethod];
+ [bee catMethodWithFloat:[bee floatMethod]];
+ main(someEnum, (const char **)bee);
+}
+
+// CHECK: {start_line=1 start_col=1 end_line=2 end_col=62} Invalid Cursor => NoDeclFound
+// CHECK: {start_line=3 start_col=1 end_line=6 end_col=1} ObjCInterfaceDecl=Foo:3:1
+// CHECK: {start_line=7 start_col=1 end_line=7 end_col=6} ObjCInstanceMethodDecl=foo:7:1
+// CHECK: {start_line=7 start_col=7 end_line=7 end_col=7} ObjCInterfaceDecl=Foo:3:1
+// CHECK: {start_line=8 start_col=1 end_line=8 end_col=7} ObjCClassMethodDecl=fooC:8:1
+// CHECK: {start_line=8 start_col=8 end_line=10 end_col=1} ObjCInterfaceDecl=Foo:3:1
+// CHECK: {start_line=10 start_col=2 end_line=11 end_col=1} Invalid Cursor => NoDeclFound
+// CHECK: {start_line=12 start_col=1 end_line=16 end_col=1} ObjCInterfaceDecl=Bar:12:1
+// CHECK: {start_line=16 start_col=2 end_line=17 end_col=1} Invalid Cursor => NoDeclFound
+// CHECK: {start_line=18 start_col=1 end_line=18 end_col=24} ObjCCategoryDecl=FooCat:18:1
+// CHECK: {start_line=19 start_col=1 end_line=19 end_col=28} ObjCInstanceMethodDecl=catMethodWithFloat::19:1
+// CHECK: {start_line=19 start_col=29 end_line=19 end_col=33} ParmDecl=fArg:19:36
+// CHECK: {start_line=19 start_col=34 end_line=19 end_col=35} ObjCInstanceMethodDecl=catMethodWithFloat::19:1
+// CHECK: {start_line=19 start_col=36 end_line=19 end_col=39} ParmDecl=fArg:19:36
+// CHECK: {start_line=19 start_col=40 end_line=19 end_col=40} ObjCInstanceMethodDecl=catMethodWithFloat::19:1
+// CHECK: {start_line=19 start_col=41 end_line=19 end_col=41} ObjCCategoryDecl=FooCat:18:1
+// CHECK: {start_line=20 start_col=1 end_line=20 end_col=22} ObjCInstanceMethodDecl=floatMethod:20:1
+// CHECK: {start_line=20 start_col=23 end_line=21 end_col=1} ObjCCategoryDecl=FooCat:18:1
+// CHECK: {start_line=21 start_col=2 end_line=22 end_col=1} Invalid Cursor => NoDeclFound
+// CHECK: {start_line=23 start_col=1 end_line=23 end_col=16} ObjCProtocolDecl=Proto:23:1
+// CHECK: {start_line=24 start_col=1 end_line=24 end_col=10} ObjCInstanceMethodDecl=pMethod:24:1
+// CHECK: {start_line=24 start_col=11 end_line=25 end_col=1} ObjCProtocolDecl=Proto:23:1
+// CHECK: {start_line=25 start_col=2 end_line=26 end_col=1} Invalid Cursor => NoDeclFound
+// CHECK: {start_line=27 start_col=1 end_line=27 end_col=23} ObjCProtocolDecl=SubP:27:1
+// CHECK: {start_line=28 start_col=1 end_line=28 end_col=11} ObjCInstanceMethodDecl=spMethod:28:1
+// CHECK: {start_line=28 start_col=12 end_line=29 end_col=1} ObjCProtocolDecl=SubP:27:1
+// CHECK: {start_line=29 start_col=2 end_line=30 end_col=1} Invalid Cursor => NoDeclFound
+// CHECK: {start_line=31 start_col=1 end_line=33 end_col=4} ObjCInterfaceDecl=Baz:31:1
+// CHECK: {start_line=33 start_col=5 end_line=33 end_col=7} Invalid Cursor => NotImplemented
+// CHECK: {start_line=33 start_col=8 end_line=33 end_col=8} ObjCInterfaceDecl=Baz:31:1
+// CHECK: {start_line=33 start_col=9 end_line=33 end_col=15} Invalid Cursor => NotImplemented
+// CHECK: {start_line=33 start_col=16 end_line=35 end_col=1} ObjCInterfaceDecl=Baz:31:1
+// CHECK: {start_line=36 start_col=1 end_line=36 end_col=20} ObjCInstanceMethodDecl=bazMethod:36:1
+// CHECK: {start_line=36 start_col=21 end_line=38 end_col=1} ObjCInterfaceDecl=Baz:31:1
+// CHECK: {start_line=38 start_col=2 end_line=39 end_col=1} Invalid Cursor => NoDeclFound
+// CHECK: {start_line=40 start_col=1 end_line=41 end_col=2} EnumDecl=:40:1
+// CHECK: {start_line=41 start_col=3 end_line=41 end_col=10} EnumConstantDecl=someEnum:41:3
+// CHECK: {start_line=41 start_col=11 end_line=42 end_col=1} EnumDecl=:40:1
+// CHECK: {start_line=42 start_col=2 end_line=43 end_col=1} Invalid Cursor => NoDeclFound
+// CHECK: {start_line=44 start_col=1 end_line=44 end_col=3} FunctionDecl=main:44:5
+// CHECK: {start_line=44 start_col=4 end_line=44 end_col=4} Invalid Cursor => NoDeclFound
+// CHECK: {start_line=44 start_col=5 end_line=44 end_col=10} FunctionDecl=main:44:5
+// CHECK: {start_line=44 start_col=11 end_line=44 end_col=13} ParmDecl=argc:44:15
+// CHECK: {start_line=44 start_col=14 end_line=44 end_col=14} FunctionDecl=main:44:5
+// CHECK: {start_line=44 start_col=15 end_line=44 end_col=18} ParmDecl=argc:44:15
+// CHECK: {start_line=44 start_col=19 end_line=44 end_col=26} FunctionDecl=main:44:5
+// CHECK: {start_line=44 start_col=27 end_line=44 end_col=30} ParmDecl=argv:44:34
+// CHECK: {start_line=44 start_col=31 end_line=44 end_col=31} FunctionDecl=main:44:5
+// CHECK: {start_line=44 start_col=32 end_line=44 end_col=32} ParmDecl=argv:44:34
+// CHECK: {start_line=44 start_col=33 end_line=44 end_col=33} FunctionDecl=main:44:5
+// CHECK: {start_line=44 start_col=34 end_line=44 end_col=39} ParmDecl=argv:44:34
+// CHECK: {start_line=44 start_col=40 end_line=45 end_col=1} FunctionDecl=main:44:5
+// CHECK: {start_line=45 start_col=2 end_line=45 end_col=4} ObjCClassRef=Baz:45:8
+// CHECK: {start_line=45 start_col=5 end_line=45 end_col=5} FunctionDecl=main:44:5
+// CHECK: {start_line=45 start_col=6 end_line=45 end_col=6} VarDecl=bee:45:8
+// CHECK: {start_line=45 start_col=7 end_line=45 end_col=7} FunctionDecl=main:44:5
+// CHECK: {start_line=45 start_col=8 end_line=45 end_col=10} VarDecl=bee:45:8
+// CHECK: {start_line=45 start_col=11 end_line=46 end_col=1} FunctionDecl=main:44:5
+// CHECK: {start_line=46 start_col=2 end_line=46 end_col=3} TypedefDecl=id:0:0
+// CHECK: {start_line=46 start_col=4 end_line=46 end_col=4} FunctionDecl=main:44:5
+// CHECK: {start_line=46 start_col=5 end_line=46 end_col=8} VarDecl=a:46:5
+// CHECK: {start_line=46 start_col=9 end_line=46 end_col=9} ObjCSelectorRef=foo:7:1
+// CHECK: {start_line=46 start_col=10 end_line=46 end_col=12} VarRef=bee:45:8
+// CHECK: {start_line=46 start_col=13 end_line=46 end_col=17} ObjCSelectorRef=foo:7:1
+// CHECK: {start_line=46 start_col=18 end_line=47 end_col=1} FunctionDecl=main:44:5
+// CHECK: {start_line=47 start_col=2 end_line=47 end_col=3} TypedefDecl=id:0:0
+// CHECK: {start_line=47 start_col=4 end_line=47 end_col=4} FunctionDecl=main:44:5
+// CHECK: {start_line=47 start_col=5 end_line=47 end_col=5} VarDecl=c:47:12
+// CHECK: {start_line=47 start_col=6 end_line=47 end_col=9} ObjCProtocolRef=SubP:47:12
+// CHECK: {start_line=47 start_col=10 end_line=47 end_col=10} VarDecl=c:47:12
+// CHECK: {start_line=47 start_col=11 end_line=47 end_col=11} FunctionDecl=main:44:5
+// CHECK: {start_line=47 start_col=12 end_line=47 end_col=15} VarDecl=c:47:12
+// CHECK: {start_line=47 start_col=16 end_line=47 end_col=25} ObjCSelectorRef=fooC:8:1
+// CHECK: {start_line=47 start_col=26 end_line=48 end_col=1} FunctionDecl=main:44:5
+// CHECK: {start_line=48 start_col=2 end_line=48 end_col=3} TypedefDecl=id:0:0
+// CHECK: {start_line=48 start_col=4 end_line=48 end_col=4} FunctionDecl=main:44:5
+// CHECK: {start_line=48 start_col=5 end_line=48 end_col=5} VarDecl=d:48:13
+// CHECK: {start_line=48 start_col=6 end_line=48 end_col=10} ObjCProtocolRef=Proto:48:13
+// CHECK: {start_line=48 start_col=11 end_line=48 end_col=11} VarDecl=d:48:13
+// CHECK: {start_line=48 start_col=12 end_line=48 end_col=12} FunctionDecl=main:44:5
+// CHECK: {start_line=48 start_col=13 end_line=48 end_col=13} VarDecl=d:48:13
+// CHECK: {start_line=48 start_col=14 end_line=49 end_col=1} FunctionDecl=main:44:5
+// CHECK: {start_line=49 start_col=2 end_line=49 end_col=2} VarRef=d:48:13
+// CHECK: {start_line=49 start_col=3 end_line=49 end_col=5} FunctionDecl=main:44:5
+// CHECK: {start_line=49 start_col=6 end_line=49 end_col=6} VarRef=c:47:12
+// CHECK: {start_line=49 start_col=7 end_line=50 end_col=1} FunctionDecl=main:44:5
+// CHECK: {start_line=50 start_col=2 end_line=50 end_col=2} ObjCSelectorRef=pMethod:24:1
+// CHECK: {start_line=50 start_col=3 end_line=50 end_col=3} VarRef=d:48:13
+// CHECK: {start_line=50 start_col=4 end_line=50 end_col=12} ObjCSelectorRef=pMethod:24:1
+// CHECK: {start_line=50 start_col=13 end_line=51 end_col=1} FunctionDecl=main:44:5
+// CHECK: {start_line=51 start_col=2 end_line=51 end_col=2} ObjCSelectorRef=catMethodWithFloat::19:1
+// CHECK: {start_line=51 start_col=3 end_line=51 end_col=5} VarRef=bee:45:8
+// CHECK: {start_line=51 start_col=6 end_line=51 end_col=25} ObjCSelectorRef=catMethodWithFloat::19:1
+// CHECK: {start_line=51 start_col=26 end_line=51 end_col=26} ObjCSelectorRef=floatMethod:20:1
+// CHECK: {start_line=51 start_col=27 end_line=51 end_col=29} VarRef=bee:45:8
+// CHECK: {start_line=51 start_col=30 end_line=51 end_col=42} ObjCSelectorRef=floatMethod:20:1
+// CHECK: {start_line=51 start_col=43 end_line=51 end_col=43} ObjCSelectorRef=catMethodWithFloat::19:1
+// CHECK: {start_line=51 start_col=44 end_line=52 end_col=2} FunctionDecl=main:44:5
+// CHECK: {start_line=52 start_col=3 end_line=52 end_col=6} FunctionRef=main:44:5
+// CHECK: {start_line=52 start_col=7 end_line=52 end_col=7} FunctionDecl=main:44:5
+// CHECK: {start_line=52 start_col=8 end_line=52 end_col=15} EnumConstantRef=someEnum:41:3
+// CHECK: {start_line=52 start_col=16 end_line=52 end_col=32} FunctionDecl=main:44:5
+// CHECK: {start_line=52 start_col=33 end_line=52 end_col=35} VarRef=bee:45:8
+// CHECK: {start_line=52 start_col=36 end_line=53 end_col=1} FunctionDecl=main:44:5
+// CHECK: {start_line=53 start_col=2 end_line=160 end_col=1} Invalid Cursor => NoDeclFound
+
diff --git a/test/Index/c-index-pch.c b/test/Index/c-index-pch.c
index aae4eb3..1ce1085 100644
--- a/test/Index/c-index-pch.c
+++ b/test/Index/c-index-pch.c
@@ -1,7 +1,7 @@
-// RUN: clang-cc -emit-pch -x c -o %t.pch %S/c-index-pch.h &&
-// RUN: clang-cc -include-pch %t.pch -x c -emit-pch -o %t.ast %s &&
-// RUN: c-index-test %t.ast all | FileCheck -check-prefix=ALL %s &&
-// RUN: c-index-test %t.ast local | FileCheck -check-prefix=LOCAL %s
+// RUN: clang-cc -emit-pch -x c -o %t.pch %S/Inputs/c-index-pch.h
+// RUN: clang-cc -include-pch %t.pch -x c -emit-pch -o %t.ast %s
+// RUN: c-index-test -test-load-tu %t.ast all | FileCheck -check-prefix=ALL %s
+// RUN: c-index-test -test-load-tu %t.ast local | FileCheck -check-prefix=LOCAL %s
// ALL: FunctionDecl=foo
// ALL: VarDecl=bar
// ALL: FunctionDecl=wibble
diff --git a/test/Index/code-completion.cpp b/test/Index/code-completion.cpp
new file mode 100644
index 0000000..44bd9d2
--- /dev/null
+++ b/test/Index/code-completion.cpp
@@ -0,0 +1,53 @@
+// Code-completion through the C interface
+#include "nonexistent_header.h"
+struct X {
+ int member;
+
+ enum E { Val1 };
+};
+
+struct Y {
+ float member;
+ void memfunc(int i = 17);
+};
+
+struct Z : X, Y {
+ double member;
+ operator int() const;
+};
+
+struct Z get_Z();
+
+void test_Z() {
+ // RUN: c-index-test -code-completion-at=%s:23:11 %s | FileCheck -check-prefix=CHECK-MEMBER %s
+ get_Z().member = 17;
+}
+
+
+float& overloaded(int i, long second);
+double& overloaded(float f, int second);
+int& overloaded(Z z, int second);
+
+void test_overloaded() {
+ // RUN: c-index-test -code-completion-at=%s:33:18 %s | FileCheck -check-prefix=CHECK-OVERLOAD %s
+ overloaded(Z(), 0);
+}
+
+// CHECK-MEMBER: EnumDecl:{Informative X::}{TypedText E}
+// CHECK-MEMBER: FieldDecl:{TypedText member}
+// CHECK-MEMBER: FunctionDecl:{Informative Y::}{TypedText memfunc}{LeftParen (}{Optional {Placeholder int i}}{RightParen )}
+// CHECK-MEMBER: EnumConstantDecl:{Informative E::}{TypedText Val1}
+// CHECK-MEMBER: FunctionDecl:{Informative X::}{TypedText ~X}{LeftParen (}{RightParen )}
+// CHECK-MEMBER: FunctionDecl:{TypedText operator int}{LeftParen (}{RightParen )}
+// CHECK-MEMBER: FunctionDecl:{TypedText operator=}{LeftParen (}{Placeholder struct Z const &}{RightParen )}
+// CHECK-MEMBER: StructDecl:{TypedText X}{Text ::}
+// CHECK-MEMBER: StructDecl:{TypedText Y}{Text ::}
+// CHECK-MEMBER: StructDecl:{TypedText Z}{Text ::}
+// CHECK-MEMBER: FieldDecl:{Text X::}{TypedText member}
+// CHECK-MEMBER: FieldDecl:{Text Y::}{TypedText member}
+// CHECK-MEMBER: FunctionDecl:{Text X::}{TypedText operator=}{LeftParen (}{Placeholder struct X const &}{RightParen )}
+// CHECK-MEMBER: FunctionDecl:{Text Y::}{TypedText operator=}{LeftParen (}{Placeholder struct Y const &}{RightParen )}
+
+// CHECK-OVERLOAD: NotImplemented:{Text overloaded}{LeftParen (}{Text struct Z z}{Comma , }{CurrentParameter int second}{RightParen )}
+// CHECK-OVERLOAD: NotImplemented:{Text overloaded}{LeftParen (}{Text int i}{Comma , }{CurrentParameter long second}{RightParen )}
+// CHECK-OVERLOAD: NotImplemented:{Text overloaded}{LeftParen (}{Text float f}{Comma , }{CurrentParameter int second}{RightParen )}
diff --git a/test/Index/comments.c b/test/Index/comments.c
index 689ce88..83bdbf6 100644
--- a/test/Index/comments.c
+++ b/test/Index/comments.c
@@ -19,16 +19,16 @@ void g(int);
void h(int); ///< This is a member comment.
-// RUN: clang-cc -emit-pch -o %t.ast %s &&
+// RUN: clang-cc -emit-pch -o %t.ast %s
-// RUN: index-test %t.ast -point-at %s:11:6 > %t &&
-// RUN: grep "starts here" %t &&
-// RUN: grep "block comment" %t &&
+// RUN: index-test %t.ast -point-at %s:11:6 > %t
+// RUN: grep "starts here" %t
+// RUN: grep "block comment" %t
-// RUN: index-test %t.ast -point-at %s:17:6 > %t &&
-// RUN: grep "BCPL" %t &&
-// RUN: grep "But" %t &&
+// RUN: index-test %t.ast -point-at %s:17:6 > %t
+// RUN: grep "BCPL" %t
+// RUN: grep "But" %t
-// RUN: index-test %t.ast -point-at %s:19:6 > %t &&
-// RUN: grep "NOT" %t | count 0 &&
+// RUN: index-test %t.ast -point-at %s:19:6 > %t
+// RUN: grep "NOT" %t | count 0
// RUN: grep "member" %t
diff --git a/test/Index/complete-member-access.m b/test/Index/complete-member-access.m
new file mode 100644
index 0000000..9202d05
--- /dev/null
+++ b/test/Index/complete-member-access.m
@@ -0,0 +1,30 @@
+/* Note: the RUN lines are near the end of the file, since line/column
+ matter for this test. */
+
+@protocol MyProtocol
+@property float ProtoProp;
+@end
+
+@interface Super {
+ int SuperIVar;
+}
+@end
+@interface Int : Super<MyProtocol>
+{
+ int IVar;
+}
+
+@property int prop1;
+@end
+
+void test_props(Int* ptr) {
+ ptr.prop1 = 0;
+ ptr->IVar = 0;
+}
+
+// RUN: c-index-test -code-completion-at=%s:21:7 %s | FileCheck -check-prefix=CHECK-CC1 %s
+// CHECK-CC1: ObjCPropertyDecl:{TypedText prop1}
+// CHECK-CC1: ObjCPropertyDecl:{TypedText ProtoProp}
+// RUN: c-index-test -code-completion-at=%s:22:8 %s | FileCheck -check-prefix=CHECK-CC2 %s
+// CHECK-CC2: ObjCIvarDecl:{TypedText IVar}
+// CHECK-CC2: ObjCIvarDecl:{TypedText SuperIVar}
diff --git a/test/Index/complete-objc-message.m b/test/Index/complete-objc-message.m
new file mode 100644
index 0000000..8f235d3
--- /dev/null
+++ b/test/Index/complete-objc-message.m
@@ -0,0 +1,107 @@
+// Note: the run lines follow their respective tests, since line/column
+// matter in this test.
+
+@protocol FooTestProtocol
++ protocolClassMethod;
+- protocolInstanceMethod : (int)value;
+@end
+@interface Foo <FooTestProtocol> {
+ void *isa;
+}
++ (int)classMethod1:a withKeyword:(int)b;
++ (void)classMethod2;
++ new;
+- instanceMethod1;
+@end
+
+@interface Foo (FooTestCategory)
++ categoryClassMethod;
+- categoryInstanceMethod;
+@end
+
+void func() {
+ Foo *obj = [Foo new];
+ [obj xx];
+}
+
+@interface MyClass { }
++ (int)MyClassMethod:(id)obj;
+- (int)MyInstMethod:(id)x second:(id)y;
+@end
+
+@interface MySubClass : MyClass { }
++ (int)MySubClassMethod;
+- (int)MySubInstMethod;
+@end
+
+@implementation MyClass
++ (int)MyClassMethod:(id)obj {
+ return 0;
+}
+
++ (int)MyPrivateMethod {
+ return 1;
+}
+
+- (int)MyInstMethod:(id)x second:(id)y {
+ return 2;
+}
+
+- (int)MyPrivateInstMethod {
+ return 3;
+}
+@end
+
+@implementation MySubClass
++ (int)MySubClassMethod {
+ return 2;
+}
+
++ (int)MySubPrivateMethod {
+ return [super MyPrivateMethod];
+}
+
+- (int)MySubInstMethod:(id)obj {
+ return [super MyInstMethod: obj second:obj];
+}
+
+- (int)MyInstMethod:(id)x second:(id)y {
+ return 3;
+}
+@end
+
+void test_super_var(MySubClass *super) {
+ [super MyInstMethod: super second:super];
+}
+
+@protocol FooTestProtocol2
+- (int)secondProtocolInstanceMethod;
+@end
+
+void test_qual_id(id<FooTestProtocol,FooTestProtocol2> ptr) {
+ [ptr protocolInstanceMethod:1];
+}
+
+// RUN: c-index-test -code-completion-at=%s:23:19 %s | FileCheck -check-prefix=CHECK-CC1 %s
+// CHECK-CC1: {TypedText categoryClassMethod}
+// CHECK-CC1: {TypedText classMethod1:}{Placeholder (id)a}{Text withKeyword:}{Placeholder (int)b}
+// CHECK-CC1: {TypedText classMethod2}
+// CHECK-CC1: {TypedText new}
+// CHECK-CC1: {TypedText protocolClassMethod}
+// RUN: c-index-test -code-completion-at=%s:24:8 %s | FileCheck -check-prefix=CHECK-CC2 %s
+// CHECK-CC2: {TypedText categoryInstanceMethod}
+// CHECK-CC2: {TypedText instanceMethod1}
+// CHECK-CC2: {TypedText protocolInstanceMethod:}{Placeholder (int)value}
+// RUN: c-index-test -code-completion-at=%s:61:16 %s | FileCheck -check-prefix=CHECK-CC3 %s
+// CHECK-CC3: ObjCClassMethodDecl:{TypedText MyClassMethod:}{Placeholder (id)obj}
+// CHECK-CC3: ObjCClassMethodDecl:{TypedText MyPrivateMethod}
+// RUN: c-index-test -code-completion-at=%s:65:16 %s | FileCheck -check-prefix=CHECK-CC4 %s
+// CHECK-CC4: ObjCInstanceMethodDecl:{TypedText MyInstMethod:}{Placeholder (id)x}{Text second:}{Placeholder (id)y}
+// CHECK-CC4: ObjCInstanceMethodDecl:{TypedText MyPrivateInstMethod}
+// RUN: c-index-test -code-completion-at=%s:74:9 %s | FileCheck -check-prefix=CHECK-CC5 %s
+// CHECK-CC5: ObjCInstanceMethodDecl:{TypedText MyInstMethod:}{Placeholder (id)x}{Text second:}{Placeholder (id)y}
+// CHECK-CC5: ObjCInstanceMethodDecl:{TypedText MySubInstMethod}
+// RUN: c-index-test -code-completion-at=%s:82:8 %s | FileCheck -check-prefix=CHECK-CC6 %s
+// CHECK-CC6: ObjCInstanceMethodDecl:{TypedText protocolInstanceMethod:}{Placeholder (int)value}
+// CHECK-CC6: ObjCInstanceMethodDecl:{TypedText secondProtocolInstanceMethod}
+
diff --git a/test/Index/complete-protocols.m b/test/Index/complete-protocols.m
new file mode 100644
index 0000000..89f61bc
--- /dev/null
+++ b/test/Index/complete-protocols.m
@@ -0,0 +1,25 @@
+/* Note: the RUN lines are near the end of the file, since line/column
+ matter for this test. */
+
+@protocol Protocol1
+@end
+
+@protocol Protocol2;
+
+void f(id<Protocol1,Protocol2>);
+
+@protocol Protocol0;
+@protocol NewProtocol
+{
+}
+@end
+
+// RUN: c-index-test -code-completion-at=%s:9:11 %s | FileCheck -check-prefix=CHECK-CC1 %s
+// CHECK-CC1: ObjCProtocolDecl:{TypedText Protocol1}
+// CHECK-CC1: ObjCProtocolDecl:{TypedText Protocol2}
+// RUN: c-index-test -code-completion-at=%s:9:21 %s | FileCheck -check-prefix=CHECK-CC2 %s
+// CHECK-CC2-NOT: ObjCProtocolDecl:{TypedText Protocol1}
+// CHECK-CC2: ObjCProtocolDecl:{TypedText Protocol2}
+// RUN: c-index-test -code-completion-at=%s:12:11 %s | FileCheck -check-prefix=CHECK-CC3 %s
+// CHECK-CC3: ObjCProtocolDecl:{TypedText Protocol0}
+// CHECK-CC3-NEXT: ObjCProtocolDecl:{TypedText Protocol2}
diff --git a/test/Index/find-decls.c b/test/Index/find-decls.c
index 50a233d..99a3242 100644
--- a/test/Index/find-decls.c
+++ b/test/Index/find-decls.c
@@ -1,25 +1,25 @@
-// RUN: clang-cc -fblocks -emit-pch %S/t1.c -o %t1.ast &&
-// RUN: clang-cc -fblocks -emit-pch %S/t2.c -o %t2.ast &&
+// RUN: clang-cc -fblocks -emit-pch %S/Inputs/t1.c -o %t1.ast
+// RUN: clang-cc -fblocks -emit-pch %S/Inputs/t2.c -o %t2.ast
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:8:7 -print-decls > %t &&
-// RUN: cat %t | count 3 &&
-// RUN: grep 'foo.h:4:6,' %t | count 2 &&
-// RUN: grep 't2.c:5:6,' %t &&
+// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/t1.c:8:7 -print-decls > %t
+// RUN: cat %t | count 3
+// RUN: grep 'foo.h:4:6,' %t | count 2
+// RUN: grep 't2.c:5:6,' %t
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:5:47 -print-decls > %t &&
-// RUN: cat %t | count 1 &&
-// RUN: grep 't1.c:5:12,' %t &&
+// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/t1.c:5:47 -print-decls > %t
+// RUN: cat %t | count 1
+// RUN: grep 't1.c:5:12,' %t
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:6:20 -print-decls > %t &&
-// RUN: cat %t | count 1 &&
-// RUN: grep 't1.c:3:19,' %t &&
+// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/t1.c:6:20 -print-decls > %t
+// RUN: cat %t | count 1
+// RUN: grep 't1.c:3:19,' %t
// field test
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:21:6 -print-decls > %t &&
-// RUN: cat %t | count 1 &&
-// RUN: grep 't1.c:12:7,' %t &&
+// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/t1.c:21:6 -print-decls > %t
+// RUN: cat %t | count 1
+// RUN: grep 't1.c:12:7,' %t
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:22:21 -print-decls > %t &&
-// RUN: cat %t | count 1 &&
+// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/t1.c:22:21 -print-decls > %t
+// RUN: cat %t | count 1
// RUN: grep 't1.c:16:7,' %t
diff --git a/test/Index/find-defs.c b/test/Index/find-defs.c
index 0e63ae7..fb54072 100644
--- a/test/Index/find-defs.c
+++ b/test/Index/find-defs.c
@@ -1,18 +1,18 @@
-// RUN: clang-cc -fblocks -emit-pch %S/t1.c -o %t1.ast &&
-// RUN: clang-cc -fblocks -emit-pch %S/t2.c -o %t2.ast &&
+// RUN: clang-cc -fblocks -emit-pch %S/Inputs/t1.c -o %t1.ast
+// RUN: clang-cc -fblocks -emit-pch %S/Inputs/t2.c -o %t2.ast
-// RUN: index-test %t1.ast %t2.ast -point-at %S/foo.h:1:14 -print-defs > %t &&
-// RUN: cat %t | count 1 &&
-// RUN: grep 't2.c:3:5,' %t &&
+// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/foo.h:1:14 -print-defs > %t
+// RUN: cat %t | count 1
+// RUN: grep 't2.c:3:5,' %t
-// RUN: index-test %t1.ast %t2.ast -point-at %S/foo.h:3:9 -print-defs > %t &&
-// RUN: cat %t | count 1 &&
-// RUN: grep 't1.c:3:6,' %t &&
+// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/foo.h:3:9 -print-defs > %t
+// RUN: cat %t | count 1
+// RUN: grep 't1.c:3:6,' %t
-// RUN: index-test %t1.ast %t2.ast -point-at %S/foo.h:4:9 -print-defs > %t &&
-// RUN: cat %t | count 1 &&
-// RUN: grep 't2.c:5:6,' %t &&
+// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/foo.h:4:9 -print-defs > %t
+// RUN: cat %t | count 1
+// RUN: grep 't2.c:5:6,' %t
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:8:7 -print-defs > %t &&
-// RUN: cat %t | count 1 &&
+// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/t1.c:8:7 -print-defs > %t
+// RUN: cat %t | count 1
// RUN: grep 't2.c:5:6,' %t
diff --git a/test/Index/find-refs.c b/test/Index/find-refs.c
index 1b58b37..5209e14 100644
--- a/test/Index/find-refs.c
+++ b/test/Index/find-refs.c
@@ -1,47 +1,47 @@
-// RUN: clang-cc -fblocks -emit-pch %S/t1.c -o %t1.ast &&
-// RUN: clang-cc -fblocks -emit-pch %S/t2.c -o %t2.ast &&
-
-// RUN: index-test %t1.ast %t2.ast -point-at %S/foo.h:1:14 -print-refs > %t &&
-// RUN: cat %t | count 4 &&
-// RUN: grep 't1.c:4:19,' %t &&
-// RUN: grep 't1.c:28:40,' %t &&
-// RUN: grep 't2.c:6:3,' %t &&
-// RUN: grep 't2.c:7:12,' %t &&
-
-// RUN: index-test %t1.ast %t2.ast -point-at %S/foo.h:3:9 -print-refs > %t &&
-// RUN: cat %t | count 1 &&
-// RUN: grep 't2.c:7:3,' %t &&
-
-// RUN: index-test %t1.ast %t2.ast -point-at %S/foo.h:4:9 -print-refs > %t &&
-// RUN: cat %t | count 1 &&
-// RUN: grep 't1.c:8:3,' %t &&
-
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:3:22 -print-refs > %t &&
-// RUN: cat %t | count 1 &&
-// RUN: grep 't1.c:6:17,' %t &&
-
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:4:11 -print-refs > %t &&
-// RUN: cat %t | count 1 &&
-// RUN: grep 't1.c:6:5,' %t &&
-
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:5:30 -print-refs > %t &&
-// RUN: cat %t | count 3 &&
-// RUN: grep 't1.c:5:27,' %t &&
-// RUN: grep 't1.c:5:44,' %t &&
-// RUN: grep 't1.c:6:26,' %t &&
+// RUN: clang-cc -fblocks -emit-pch %S/Inputs/t1.c -o %t1.ast
+// RUN: clang-cc -fblocks -emit-pch %S/Inputs/t2.c -o %t2.ast
+
+// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/foo.h:1:14 -print-refs > %t
+// RUN: cat %t | count 4
+// RUN: grep 't1.c:4:19,' %t
+// RUN: grep 't1.c:28:40,' %t
+// RUN: grep 't2.c:6:3,' %t
+// RUN: grep 't2.c:7:12,' %t
+
+// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/foo.h:3:9 -print-refs > %t
+// RUN: cat %t | count 1
+// RUN: grep 't2.c:7:3,' %t
+
+// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/foo.h:4:9 -print-refs > %t
+// RUN: cat %t | count 1
+// RUN: grep 't1.c:8:3,' %t
+
+// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/t1.c:3:22 -print-refs > %t
+// RUN: cat %t | count 1
+// RUN: grep 't1.c:6:17,' %t
+
+// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/t1.c:4:11 -print-refs > %t
+// RUN: cat %t | count 1
+// RUN: grep 't1.c:6:5,' %t
+
+// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/t1.c:5:30 -print-refs > %t
+// RUN: cat %t | count 3
+// RUN: grep 't1.c:5:27,' %t
+// RUN: grep 't1.c:5:44,' %t
+// RUN: grep 't1.c:6:26,' %t
// field test
// FIXME: References point at the start of MemberExpr, make them point at the field instead.
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:12:7 -print-refs > %t &&
-// RUN: cat %t | count 1 &&
-// RUN: grep 't1.c:21:3,' %t &&
+// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/t1.c:12:7 -print-refs > %t
+// RUN: cat %t | count 1
+// RUN: grep 't1.c:21:3,' %t
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:16:7 -print-refs > %t &&
-// RUN: cat %t | count 1 &&
-// RUN: grep 't1.c:22:3,' %t &&
+// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/t1.c:16:7 -print-refs > %t
+// RUN: cat %t | count 1
+// RUN: grep 't1.c:22:3,' %t
-// RUN: index-test %t1.ast %t2.ast -point-at %S/foo.h:7:11 -print-refs > %t &&
-// RUN: cat %t | count 2 &&
-// RUN: grep 't1.c:25:3,' %t &&
+// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/foo.h:7:11 -print-refs > %t
+// RUN: cat %t | count 2
+// RUN: grep 't1.c:25:3,' %t
// RUN: grep 't2.c:10:3,' %t
diff --git a/test/Index/multiple-redecls.c b/test/Index/multiple-redecls.c
index 6f1f75b..ea6d00b 100644
--- a/test/Index/multiple-redecls.c
+++ b/test/Index/multiple-redecls.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -emit-pch %s -o %t.ast &&
-// RUN: index-test %t.ast -point-at %s:8:4 -print-decls | count 2 &&
+// RUN: clang-cc -emit-pch %s -o %t.ast
+// RUN: index-test %t.ast -point-at %s:8:4 -print-decls | count 2
// RUN: index-test %t.ast -point-at %s:8:4 -print-defs | count 1
static void foo(int x);
diff --git a/test/Index/objc-decls.m b/test/Index/objc-decls.m
index 1a8ab4b..ff39678 100644
--- a/test/Index/objc-decls.m
+++ b/test/Index/objc-decls.m
@@ -1,16 +1,16 @@
-// RUN: clang-cc -emit-pch %S/t1.m -o %t1.m.ast &&
-// RUN: clang-cc -emit-pch %S/t2.m -o %t2.m.ast &&
+// RUN: clang-cc -emit-pch %S/Inputs/t1.m -o %t1.m.ast
+// RUN: clang-cc -emit-pch %S/Inputs/t2.m -o %t2.m.ast
-// RUN: index-test %t1.m.ast %t2.m.ast -point-at %S/t1.m:12:12 -print-decls > %t &&
-// RUN: cat %t | count 2 &&
-// RUN: grep 'objc.h:2:9,' %t | count 2 &&
+// RUN: index-test %t1.m.ast %t2.m.ast -point-at %S/Inputs/t1.m:12:12 -print-decls > %t
+// RUN: cat %t | count 2
+// RUN: grep 'objc.h:2:9,' %t | count 2
-// RUN: index-test %t1.m.ast %t2.m.ast -point-at %S/objc.h:5:13 -print-decls > %t &&
-// RUN: cat %t | count 3 &&
-// RUN: grep 'objc.h:5:1,' %t | count 2 &&
-// RUN: grep 't1.m:15:1,' %t | count 1 &&
+// RUN: index-test %t1.m.ast %t2.m.ast -point-at %S/Inputs/objc.h:5:13 -print-decls > %t
+// RUN: cat %t | count 3
+// RUN: grep 'objc.h:5:1,' %t | count 2
+// RUN: grep 't1.m:15:1,' %t | count 1
-// RUN: index-test %t1.m.ast %t2.m.ast -point-at %S/objc.h:10:13 -print-decls > %t &&
-// RUN: cat %t | count 3 &&
-// RUN: grep 'objc.h:10:1,' %t | count 2 &&
+// RUN: index-test %t1.m.ast %t2.m.ast -point-at %S/Inputs/objc.h:10:13 -print-decls > %t
+// RUN: cat %t | count 3
+// RUN: grep 'objc.h:10:1,' %t | count 2
// RUN: grep 't2.m:11:1,' %t | count 1
diff --git a/test/Index/objc-message.m b/test/Index/objc-message.m
index 45ce838..de61278 100644
--- a/test/Index/objc-message.m
+++ b/test/Index/objc-message.m
@@ -1,38 +1,38 @@
-// RUN: clang-cc -emit-pch %S/t1.m -o %t1.m.ast &&
-// RUN: clang-cc -emit-pch %S/t2.m -o %t2.m.ast &&
+// RUN: clang-cc -emit-pch %S/Inputs/t1.m -o %t1.m.ast
+// RUN: clang-cc -emit-pch %S/Inputs/t2.m -o %t2.m.ast
-// RUN: index-test %t1.m.ast %t2.m.ast -point-at %S/objc.h:5:13 -print-refs > %t &&
-// RUN: cat %t | count 1 &&
-// RUN: grep 't1.m:6:3,' %t &&
+// RUN: index-test %t1.m.ast %t2.m.ast -point-at %S/Inputs/objc.h:5:13 -print-refs > %t
+// RUN: cat %t | count 1
+// RUN: grep 't1.m:6:3,' %t
-// RUN: index-test %t1.m.ast %t2.m.ast -point-at %S/objc.h:6:13 -print-refs > %t &&
-// RUN: cat %t | count 2 &&
-// RUN: grep 't1.m:7:3,' %t &&
-// RUN: grep 't2.m:7:3,' %t &&
+// RUN: index-test %t1.m.ast %t2.m.ast -point-at %S/Inputs/objc.h:6:13 -print-refs > %t
+// RUN: cat %t | count 2
+// RUN: grep 't1.m:7:3,' %t
+// RUN: grep 't2.m:7:3,' %t
-// RUN: index-test %t1.m.ast %t2.m.ast -point-at %S/objc.h:10:13 -print-refs > %t &&
-// RUN: cat %t | count 2 &&
-// RUN: grep 't1.m:6:3,' %t &&
-// RUN: grep 't2.m:6:3,' %t &&
+// RUN: index-test %t1.m.ast %t2.m.ast -point-at %S/Inputs/objc.h:10:13 -print-refs > %t
+// RUN: cat %t | count 2
+// RUN: grep 't1.m:6:3,' %t
+// RUN: grep 't2.m:6:3,' %t
-// RUN: index-test %t1.m.ast %t2.m.ast -point-at %S/t1.m:6:15 -print-decls > %t &&
-// RUN: cat %t | count 6 &&
-// RUN: grep 'objc.h:5:1,' %t | count 2 &&
-// RUN: grep 'objc.h:10:1,' %t | count 2 &&
-// RUN: grep 't1.m:15:1,' %t &&
-// RUN: grep 't2.m:11:1,' %t &&
+// RUN: index-test %t1.m.ast %t2.m.ast -point-at %S/Inputs/t1.m:6:15 -print-decls > %t
+// RUN: cat %t | count 6
+// RUN: grep 'objc.h:5:1,' %t | count 2
+// RUN: grep 'objc.h:10:1,' %t | count 2
+// RUN: grep 't1.m:15:1,' %t
+// RUN: grep 't2.m:11:1,' %t
-// RUN: index-test %t1.m.ast %t2.m.ast -point-at %S/t1.m:7:15 -print-decls > %t &&
-// RUN: cat %t | count 3 &&
-// RUN: grep 'objc.h:6:1,' %t | count 2 &&
-// RUN: grep 't1.m:18:1,' %t &&
+// RUN: index-test %t1.m.ast %t2.m.ast -point-at %S/Inputs/t1.m:7:15 -print-decls > %t
+// RUN: cat %t | count 3
+// RUN: grep 'objc.h:6:1,' %t | count 2
+// RUN: grep 't1.m:18:1,' %t
-// RUN: index-test %t2.m.ast %t1.m.ast -point-at %S/t2.m:6:15 -print-decls > %t &&
-// RUN: cat %t | count 3 &&
-// RUN: grep 'objc.h:10:1,' %t | count 2 &&
-// RUN: grep 't2.m:11:1,' %t &&
+// RUN: index-test %t2.m.ast %t1.m.ast -point-at %S/Inputs/t2.m:6:15 -print-decls > %t
+// RUN: cat %t | count 3
+// RUN: grep 'objc.h:10:1,' %t | count 2
+// RUN: grep 't2.m:11:1,' %t
-// RUN: index-test %t2.m.ast %t1.m.ast -point-at %S/t2.m:7:15 -print-decls > %t &&
-// RUN: cat %t | count 3 &&
-// RUN: grep 'objc.h:6:1,' %t | count 2 &&
+// RUN: index-test %t2.m.ast %t1.m.ast -point-at %S/Inputs/t2.m:7:15 -print-decls > %t
+// RUN: cat %t | count 3
+// RUN: grep 'objc.h:6:1,' %t | count 2
// RUN: grep 't1.m:18:1,' %t
diff --git a/test/Index/resolve-loc.c b/test/Index/resolve-loc.c
index cae86f3..f469717 100644
--- a/test/Index/resolve-loc.c
+++ b/test/Index/resolve-loc.c
@@ -16,22 +16,22 @@ struct S {
};
-// RUN: clang-cc -emit-pch %s -o %t.ast &&
-// RUN: index-test %t.ast -point-at %s:3:8 | grep top_var &&
-// RUN: index-test %t.ast -point-at %s:5:15 | grep top_func_decl &&
-// RUN: index-test %t.ast -point-at %s:5:25 | grep param1 &&
-// RUN: index-test %t.ast -point-at %s:7:17 | grep top_func_def &&
-// RUN: index-test %t.ast -point-at %s:7:23 | grep param2 &&
-// RUN: index-test %t.ast -point-at %s:8:10 | grep local_var1 &&
-// RUN: index-test %t.ast -point-at %s:9:15 | grep for_var &&
-
-// RUN: index-test %t.ast -point-at %s:9:43 > %t &&
-// RUN: grep '++for_var' %t &&
-
-// RUN: index-test %t.ast -point-at %s:10:9 | grep local_var2 &&
-
-// RUN: index-test %t.ast -point-at %s:10:30 > %t &&
-// RUN: grep 'for_var + 1' %t &&
+// RUN: clang-cc -emit-pch %s -o %t.ast
+// RUN: index-test %t.ast -point-at %s:3:8 | grep top_var
+// RUN: index-test %t.ast -point-at %s:5:15 | grep top_func_decl
+// RUN: index-test %t.ast -point-at %s:5:25 | grep param1
+// RUN: index-test %t.ast -point-at %s:7:17 | grep top_func_def
+// RUN: index-test %t.ast -point-at %s:7:23 | grep param2
+// RUN: index-test %t.ast -point-at %s:8:10 | grep local_var1
+// RUN: index-test %t.ast -point-at %s:9:15 | grep for_var
+
+// RUN: index-test %t.ast -point-at %s:9:43 > %t
+// RUN: grep '++for_var' %t
+
+// RUN: index-test %t.ast -point-at %s:10:9 | grep local_var2
+
+// RUN: index-test %t.ast -point-at %s:10:30 > %t
+// RUN: grep 'for_var + 1' %t
// fields test.
// RUN: index-test %t.ast -point-at %s:15:10 | grep field_var
diff --git a/test/Lexer/block_cmt_end.c b/test/Lexer/block_cmt_end.c
index 83d6cf1..5efb77e 100644
--- a/test/Lexer/block_cmt_end.c
+++ b/test/Lexer/block_cmt_end.c
@@ -1,8 +1,8 @@
/*
- RUN: clang-cc -E -trigraphs %s | grep bar &&
- RUN: clang-cc -E -trigraphs %s | grep foo &&
- RUN: clang-cc -E -trigraphs %s | not grep abc &&
- RUN: clang-cc -E -trigraphs %s | not grep xyz &&
+ RUN: clang-cc -E -trigraphs %s | grep bar
+ RUN: clang-cc -E -trigraphs %s | grep foo
+ RUN: clang-cc -E -trigraphs %s | not grep abc
+ RUN: clang-cc -E -trigraphs %s | not grep xyz
RUN: clang-cc -fsyntax-only -trigraphs -verify %s
*/
diff --git a/test/Lexer/counter.c b/test/Lexer/counter.c
index 9b2c2c7..044570f 100644
--- a/test/Lexer/counter.c
+++ b/test/Lexer/counter.c
@@ -1,16 +1,16 @@
// __COUNTER__ support: rdar://4329310
-// RUN: clang -E %s > %t &&
+// RUN: clang -E %s > %t
#define PASTE2(x,y) x##y
#define PASTE1(x,y) PASTE2(x,y)
#define UNIQUE(x) PASTE1(x,__COUNTER__)
-// RUN: grep "A: 0" %t &&
+// RUN: grep "A: 0" %t
A: __COUNTER__
-// RUN: grep "B: foo1" %t &&
+// RUN: grep "B: foo1" %t
B: UNIQUE(foo);
-// RUN: grep "C: foo2" %t &&
+// RUN: grep "C: foo2" %t
C: UNIQUE(foo);
// RUN: grep "D: 3" %t
D: __COUNTER__
diff --git a/test/Lexer/digraph.c b/test/Lexer/digraph.c
index 4d494ca..3c92db1 100644
--- a/test/Lexer/digraph.c
+++ b/test/Lexer/digraph.c
@@ -1,6 +1,6 @@
// RUN: clang-cc -fsyntax-only -verify < %s
-%:include <stdio.h>
+%:include <stdint.h>
%:ifndef BUFSIZE
%:define BUFSIZE 512
diff --git a/test/Lexer/dollar-idents.c b/test/Lexer/dollar-idents.c
index f5c33b1..276545d 100644
--- a/test/Lexer/dollar-idents.c
+++ b/test/Lexer/dollar-idents.c
@@ -1,6 +1,6 @@
-// RUN: clang-cc -dump-tokens %s 2> %t &&
-// RUN: grep "identifier '\$A'" %t &&
-// RUN: clang-cc -dump-tokens -x assembler-with-cpp %s 2> %t &&
+// RUN: clang-cc -dump-tokens %s 2> %t
+// RUN: grep "identifier '\$A'" %t
+// RUN: clang-cc -dump-tokens -x assembler-with-cpp %s 2> %t
// RUN: grep "identifier 'A'" %t
// PR3808
diff --git a/test/Lexer/escape_newline.c b/test/Lexer/escape_newline.c
index ce120ed..d07f045 100644
--- a/test/Lexer/escape_newline.c
+++ b/test/Lexer/escape_newline.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -E -trigraphs %s | grep -- ' ->' &&
-// RUN: clang-cc -E -trigraphs %s 2>&1 | grep 'backslash and newline separated by space' &&
+// RUN: clang-cc -E -trigraphs %s | grep -- ' ->'
+// RUN: clang-cc -E -trigraphs %s 2>&1 | grep 'backslash and newline separated by space'
// RUN: clang-cc -E -trigraphs %s 2>&1 | grep 'trigraph converted'
// This is an ugly way to spell a -> token.
diff --git a/test/Lexer/rdr-6096838.c b/test/Lexer/rdr-6096838.c
index 60e5244..6a8899a 100644
--- a/test/Lexer/rdr-6096838.c
+++ b/test/Lexer/rdr-6096838.c
@@ -1,4 +1,4 @@
-/* RUN: clang-cc -fsyntax-only -verify %s &&
+/* RUN: clang-cc -fsyntax-only -verify %s
* RUN: clang-cc -std=gnu89 -fsyntax-only -verify %s
rdar://6096838
*/
diff --git a/test/Lexer/token-concat.c b/test/Lexer/token-concat.c
index 4e27d5d..9194932 100644
--- a/test/Lexer/token-concat.c
+++ b/test/Lexer/token-concat.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -E -x c -o %t %s &&
+// RUN: clang-cc -E -x c -o %t %s
// RUN: grep 'IDENT.2' %t
IDENT.2
diff --git a/test/Misc/caret-diags-macros.c b/test/Misc/caret-diags-macros.c
index 58d293f..fd3c617 100644
--- a/test/Misc/caret-diags-macros.c
+++ b/test/Misc/caret-diags-macros.c
@@ -1,22 +1,22 @@
-// RUN: clang-cc -fsyntax-only %s > %t 2>&1 &&
+// RUN: clang-cc -fsyntax-only %s > %t 2>&1
#define M1(x) x
-// RUN: grep ":6:12: note: instantiated from:" %t &&
+// RUN: grep ":6:12: note: instantiated from:" %t
#define M2 1;
void foo() {
- // RUN: grep ":10:2: warning: expression result unused" %t &&
+ // RUN: grep ":10:2: warning: expression result unused" %t
M1(
- // RUN: grep ":12:5: note: instantiated from:" %t &&
+ // RUN: grep ":12:5: note: instantiated from:" %t
M2)
}
-// RUN: grep ":16:11: note: instantiated from:" %t &&
+// RUN: grep ":16:11: note: instantiated from:" %t
#define A 1
-// RUN: grep ":18:11: note: instantiated from:" %t &&
+// RUN: grep ":18:11: note: instantiated from:" %t
#define B A
-// RUN: grep ":20:11: note: instantiated from:" %t &&
+// RUN: grep ":20:11: note: instantiated from:" %t
#define C B
void bar() {
diff --git a/test/Misc/diag-mapping.c b/test/Misc/diag-mapping.c
index dc07e0d..5816cf5 100644
--- a/test/Misc/diag-mapping.c
+++ b/test/Misc/diag-mapping.c
@@ -1,25 +1,25 @@
// This should warn by default.
-// RUN: clang-cc %s 2>&1 | grep "warning:" &&
+// RUN: clang-cc %s 2>&1 | grep "warning:"
// This should not emit anything.
-// RUN: clang-cc %s -Wno-extra-tokens 2>&1 | not grep diagnostic &&
+// RUN: clang-cc %s -Wno-extra-tokens 2>&1 | not grep diagnostic
// -Werror can map all warnings to error.
-// RUN: clang-cc %s -Werror 2>&1 | grep "error:" &&
+// RUN: clang-cc %s -Werror 2>&1 | grep "error:"
// -Werror can map this one warning to error.
-// RUN: clang-cc %s -Werror=extra-tokens 2>&1 | grep "error:" &&
+// RUN: clang-cc %s -Werror=extra-tokens 2>&1 | grep "error:"
// Mapping unrelated diags to errors doesn't affect this one.
-// RUN: clang-cc %s -Werror=trigraphs 2>&1 | grep "warning:" &&
+// RUN: clang-cc %s -Werror=trigraphs 2>&1 | grep "warning:"
// This should stay a warning with -pedantic.
-// RUN: clang-cc %s -pedantic 2>&1 | grep "warning:" &&
+// RUN: clang-cc %s -pedantic 2>&1 | grep "warning:"
// This should emit an error with -pedantic-errors.
-// RUN: clang-cc %s -pedantic-errors 2>&1 | grep "error:" &&
+// RUN: clang-cc %s -pedantic-errors 2>&1 | grep "error:"
// This should emit a warning, because -Wfoo overrides -pedantic*.
-// RUN: clang-cc %s -pedantic-errors -Wextra-tokens 2>&1 | grep "warning:" &&
+// RUN: clang-cc %s -pedantic-errors -Wextra-tokens 2>&1 | grep "warning:"
// This should emit nothing, because -Wno-extra-tokens overrides -pedantic*
// RUN: clang-cc %s -pedantic-errors -Wno-extra-tokens 2>&1 | not grep diagnostic
diff --git a/test/Misc/diag-mapping2.c b/test/Misc/diag-mapping2.c
index c5fd7ff..cde90e2 100644
--- a/test/Misc/diag-mapping2.c
+++ b/test/Misc/diag-mapping2.c
@@ -1,18 +1,18 @@
// This should warn by default.
-// RUN: clang-cc %s 2>&1 | grep "warning:" &&
+// RUN: clang-cc %s 2>&1 | grep "warning:"
// This should not emit anything.
-// RUN: clang-cc %s -w 2>&1 | not grep diagnostic &&
-// RUN: clang-cc %s -Wno-#warnings 2>&1 | not grep diagnostic &&
+// RUN: clang-cc %s -w 2>&1 | not grep diagnostic
+// RUN: clang-cc %s -Wno-#warnings 2>&1 | not grep diagnostic
// -Werror can map all warnings to error.
-// RUN: clang-cc %s -Werror 2>&1 | grep "error:" &&
+// RUN: clang-cc %s -Werror 2>&1 | grep "error:"
// -Werror can map this one warning to error.
-// RUN: clang-cc %s -Werror=#warnings 2>&1 | grep "error:" &&
+// RUN: clang-cc %s -Werror=#warnings 2>&1 | grep "error:"
// -Wno-error= overrides -Werror. rdar://3158301
-// RUN: clang-cc %s -Werror -Wno-error=#warnings 2>&1 | grep "warning:" &&
+// RUN: clang-cc %s -Werror -Wno-error=#warnings 2>&1 | grep "warning:"
// -Wno-error overrides -Werror. PR4715
// RUN: clang-cc %s -Werror -Wno-error 2>&1 | grep "warning:"
diff --git a/test/Misc/message-length.c b/test/Misc/message-length.c
index 4502951..841ffc9 100644
--- a/test/Misc/message-length.c
+++ b/test/Misc/message-length.c
@@ -1,4 +1,4 @@
-// RUN: clang -fsyntax-only -fmessage-length=72 %s 2>&1 | FileCheck -strict-whitespace %s &&
+// RUN: clang -fsyntax-only -fmessage-length=72 %s 2>&1 | FileCheck -strict-whitespace %s
// RUN: clang -fsyntax-only -fmessage-length=1 %s
// Hack so we can check things better, force the file name and line.
diff --git a/test/PCH/asm.c b/test/PCH/asm.c
index bff271de..61665d6 100644
--- a/test/PCH/asm.c
+++ b/test/PCH/asm.c
@@ -1,8 +1,8 @@
// Test this without pch.
-// RUN: clang-cc -triple i386-unknown-unknown -include %S/asm.h -fsyntax-only -verify %s &&
+// RUN: clang-cc -triple i386-unknown-unknown -include %S/asm.h -fsyntax-only -verify %s
// Test with pch.
-// RUN: clang-cc -triple i386-unknown-unknown -emit-pch -o %t %S/asm.h &&
+// RUN: clang-cc -triple i386-unknown-unknown -emit-pch -o %t %S/asm.h
// RUN: clang-cc -triple i386-unknown-unknown -include-pch %t -fsyntax-only -verify %s
diff --git a/test/PCH/attrs.c b/test/PCH/attrs.c
index 1ffb467..f381f23 100644
--- a/test/PCH/attrs.c
+++ b/test/PCH/attrs.c
@@ -1,8 +1,8 @@
// Test this without pch.
-// RUN: clang-cc -include %S/attrs.h -fsyntax-only -verify %s &&
+// RUN: clang-cc -include %S/attrs.h -fsyntax-only -verify %s
// Test with pch.
-// RUN: clang-cc -emit-pch -o %t %S/attrs.h &&
+// RUN: clang-cc -emit-pch -o %t %S/attrs.h
// RUN: clang-cc -include-pch %t -fsyntax-only -verify %s
// expected-note{{previous overload}}
double f(double); // expected-error{{overloadable}}
diff --git a/test/PCH/blocks.c b/test/PCH/blocks.c
index f3efc8a..ccecd36 100644
--- a/test/PCH/blocks.c
+++ b/test/PCH/blocks.c
@@ -1,8 +1,8 @@
// Test this without pch.
-// RUN: clang-cc -fblocks -include %S/blocks.h -fsyntax-only -emit-llvm -o - %s &&
+// RUN: clang-cc -fblocks -include %S/blocks.h -fsyntax-only -emit-llvm -o - %s
// Test with pch.
-// RUN: clang-cc -emit-pch -fblocks -o %t %S/blocks.h &&
+// RUN: clang-cc -emit-pch -fblocks -o %t %S/blocks.h
// RUN: clang-cc -fblocks -include-pch %t -fsyntax-only -emit-llvm -o - %s
int do_add(int x, int y) { return add(x, y); }
diff --git a/test/PCH/builtins.c b/test/PCH/builtins.c
index 3d1786b..796b9dc 100644
--- a/test/PCH/builtins.c
+++ b/test/PCH/builtins.c
@@ -1,8 +1,8 @@
// Test this without pch.
-// RUN: clang-cc -include %S/builtins.h -fsyntax-only -verify %s &&
+// RUN: clang-cc -include %S/builtins.h -fsyntax-only -verify %s
// Test with pch.
-// RUN: clang-cc -emit-pch -o %t %S/builtins.h &&
+// RUN: clang-cc -emit-pch -o %t %S/builtins.h
// RUN: clang-cc -include-pch %t -fsyntax-only -verify %s
void hello() {
diff --git a/test/PCH/enum.c b/test/PCH/enum.c
index 45b0491..607de59 100644
--- a/test/PCH/enum.c
+++ b/test/PCH/enum.c
@@ -1,8 +1,8 @@
// Test this without pch.
-// RUN: clang-cc -include %S/enum.h -fsyntax-only -verify %s &&
+// RUN: clang-cc -include %S/enum.h -fsyntax-only -verify %s
// Test with pch.
-// RUN: clang-cc -emit-pch -o %t %S/enum.h &&
+// RUN: clang-cc -emit-pch -o %t %S/enum.h
// RUN: clang-cc -include-pch %t -fsyntax-only -verify %s
int i = Red;
diff --git a/test/PCH/exprs.c b/test/PCH/exprs.c
index c8e6d1d..6cd1ee7 100644
--- a/test/PCH/exprs.c
+++ b/test/PCH/exprs.c
@@ -1,8 +1,8 @@
// Test this without pch.
-// RUN: clang-cc -fblocks -include %S/exprs.h -fsyntax-only -verify %s &&
+// RUN: clang-cc -fblocks -include %S/exprs.h -fsyntax-only -verify %s
// Test with pch.
-// RUN: clang-cc -emit-pch -fblocks -o %t %S/exprs.h &&
+// RUN: clang-cc -emit-pch -fblocks -o %t %S/exprs.h
// RUN: clang-cc -fblocks -include-pch %t -fsyntax-only -verify %s
int integer;
diff --git a/test/PCH/ext_vector.c b/test/PCH/ext_vector.c
index 4b5c259..314dbfc 100644
--- a/test/PCH/ext_vector.c
+++ b/test/PCH/ext_vector.c
@@ -1,8 +1,8 @@
// Test this without pch.
-// RUN: clang-cc -include %S/ext_vector.h -fsyntax-only -verify %s &&
+// RUN: clang-cc -include %S/ext_vector.h -fsyntax-only -verify %s
// Test with pch.
-// RUN: clang-cc -emit-pch -o %t %S/ext_vector.h &&
+// RUN: clang-cc -emit-pch -o %t %S/ext_vector.h
// RUN: clang-cc -include-pch %t -fsyntax-only -verify %s
int test(float4 f4) {
diff --git a/test/PCH/external-defs.c b/test/PCH/external-defs.c
index b7eb700..447124c 100644
--- a/test/PCH/external-defs.c
+++ b/test/PCH/external-defs.c
@@ -1,15 +1,15 @@
// Test with pch.
-// RUN: clang-cc -triple x86_64-apple-darwin9 -emit-pch -o %t.pch %S/external-defs.h &&
-// RUN: clang-cc -triple x86_64-apple-darwin9 -include-pch %t.pch -emit-llvm -o %t %s &&
+// RUN: clang-cc -triple x86_64-apple-darwin9 -emit-pch -o %t.pch %S/external-defs.h
+// RUN: clang-cc -triple x86_64-apple-darwin9 -include-pch %t.pch -emit-llvm -o %t %s
-// RUN: grep "@x = common global i32 0" %t | count 1 &&
-// RUN: grep "@z" %t | count 0 &&
+// RUN: grep "@x = common global i32 0" %t | count 1
+// RUN: grep "@z" %t | count 0
-// RUN: grep "@x2 = global i32 19" %t | count 1 &&
+// RUN: grep "@x2 = global i32 19" %t | count 1
int x2 = 19;
-// RUN: grep "@incomplete_array = common global .*1 x i32" %t | count 1 &&
-// RUN: grep "@incomplete_array2 = common global .*17 x i32" %t | count 1 &&
+// RUN: grep "@incomplete_array = common global .*1 x i32" %t | count 1
+// RUN: grep "@incomplete_array2 = common global .*17 x i32" %t | count 1
int incomplete_array2[17];
// RUN: grep "@incomplete_array3 = common global .*1 x i32" %t | count 1
int incomplete_array3[];
diff --git a/test/PCH/functions.c b/test/PCH/functions.c
index 6d3c5a0..2121b9a 100644
--- a/test/PCH/functions.c
+++ b/test/PCH/functions.c
@@ -1,8 +1,8 @@
// Test this without pch.
-// RUN: clang-cc -include %S/functions.h -fsyntax-only -verify %s &&
+// RUN: clang-cc -include %S/functions.h -fsyntax-only -verify %s
// Test with pch.
-// RUN: clang-cc -emit-pch -o %t %S/functions.h &&
+// RUN: clang-cc -emit-pch -o %t %S/functions.h
// RUN: clang-cc -include-pch %t -fsyntax-only -verify %s
int f0(int x0, int y0, ...) { return x0 + y0; }
diff --git a/test/PCH/fuzzy-pch.c b/test/PCH/fuzzy-pch.c
index 2ddcb8b..b29638b 100644
--- a/test/PCH/fuzzy-pch.c
+++ b/test/PCH/fuzzy-pch.c
@@ -1,7 +1,7 @@
// Test with pch.
-// RUN: clang-cc -emit-pch -DFOO -o %t %S/variables.h &&
-// RUN: clang-cc -DBAR=int -include-pch %t -fsyntax-only -pedantic %s &&
-// RUN: clang-cc -DFOO -DBAR=int -include-pch %t -Werror %s &&
+// RUN: clang-cc -emit-pch -DFOO -o %t %S/variables.h
+// RUN: clang-cc -DBAR=int -include-pch %t -fsyntax-only -pedantic %s
+// RUN: clang-cc -DFOO -DBAR=int -include-pch %t -Werror %s
// RUN: not clang-cc -DFOO -DBAR=int -DX=5 -include-pch %t -Werror %s
BAR bar = 17;
diff --git a/test/PCH/line-directive.c b/test/PCH/line-directive.c
index 53edb3c..9eed4f4 100644
--- a/test/PCH/line-directive.c
+++ b/test/PCH/line-directive.c
@@ -1,8 +1,8 @@
// Test this without pch.
-// RUN: clang-cc -include %S/line-directive.h -fsyntax-only %s 2>&1|grep "25:5" &&
+// RUN: clang-cc -include %S/line-directive.h -fsyntax-only %s 2>&1|grep "25:5"
// Test with pch.
-// RUN: clang-cc -emit-pch -o %t %S/line-directive.h &&
+// RUN: clang-cc -emit-pch -o %t %S/line-directive.h
// RUN: clang-cc -include-pch %t -fsyntax-only %s 2>&1|grep "25:5"
double x; // expected-error{{redefinition of 'x' with a different type}}
diff --git a/test/PCH/method_pool.m b/test/PCH/method_pool.m
index 8dd7834..3fe45a6 100644
--- a/test/PCH/method_pool.m
+++ b/test/PCH/method_pool.m
@@ -1,8 +1,8 @@
// Test this without pch.
-// RUN: clang-cc -include %S/method_pool.h -fsyntax-only -verify %s &&
+// RUN: clang-cc -include %S/method_pool.h -fsyntax-only -verify %s
// Test with pch.
-// RUN: clang-cc -x=objective-c -emit-pch -o %t %S/method_pool.h &&
+// RUN: clang-cc -x=objective-c -emit-pch -o %t %S/method_pool.h
// RUN: clang-cc -include-pch %t -fsyntax-only -verify %s
int message_id(id x) {
diff --git a/test/PCH/multiple_decls.c b/test/PCH/multiple_decls.c
index 4b2fc62..2702cd6 100644
--- a/test/PCH/multiple_decls.c
+++ b/test/PCH/multiple_decls.c
@@ -1,8 +1,8 @@
// Test this without pch.
-// RUN: clang-cc -include %S/multiple_decls.h -fsyntax-only -ast-print -o - %s &&
+// RUN: clang-cc -include %S/multiple_decls.h -fsyntax-only -ast-print -o - %s
// Test with pch.
-// RUN: clang-cc -emit-pch -o %t %S/multiple_decls.h &&
+// RUN: clang-cc -emit-pch -o %t %S/multiple_decls.h
// RUN: clang-cc -include-pch %t -fsyntax-only -ast-print -o - %s
void f0(char c) {
diff --git a/test/PCH/nonvisible-external-defs.c b/test/PCH/nonvisible-external-defs.c
index bfe5cca..a786749 100644
--- a/test/PCH/nonvisible-external-defs.c
+++ b/test/PCH/nonvisible-external-defs.c
@@ -1,8 +1,8 @@
// Test this without pch.
-// RUN: clang-cc -include %S/nonvisible-external-defs.h -fsyntax-only -verify %s &&
+// RUN: clang-cc -include %S/nonvisible-external-defs.h -fsyntax-only -verify %s
// Test with pch.
-// RUN: clang-cc -emit-pch -o %t %S/nonvisible-external-defs.h &&
+// RUN: clang-cc -emit-pch -o %t %S/nonvisible-external-defs.h
// RUN: clang-cc -include-pch %t -fsyntax-only -verify %s
int g(int, float); // expected-error{{conflicting types}}
diff --git a/test/PCH/objc_exprs.m b/test/PCH/objc_exprs.m
index 48966f3..9eb5a11 100644
--- a/test/PCH/objc_exprs.m
+++ b/test/PCH/objc_exprs.m
@@ -1,8 +1,8 @@
// Test this without pch.
-// RUN: clang-cc -fblocks -include %S/objc_exprs.h -fsyntax-only -verify %s &&
+// RUN: clang-cc -fblocks -include %S/objc_exprs.h -fsyntax-only -verify %s
// Test with pch.
-// RUN: clang-cc -x objective-c-header -emit-pch -fblocks -o %t %S/objc_exprs.h &&
+// RUN: clang-cc -x objective-c-header -emit-pch -fblocks -o %t %S/objc_exprs.h
// RUN: clang-cc -fblocks -include-pch %t -fsyntax-only -verify %s
// Expressions
diff --git a/test/PCH/objc_import.m b/test/PCH/objc_import.m
index 86c1c25..83f389c 100644
--- a/test/PCH/objc_import.m
+++ b/test/PCH/objc_import.m
@@ -1,8 +1,8 @@
// Test this without pch.
-// RUN: clang-cc -include %S/objc_import.h -fsyntax-only -verify %s &&
+// RUN: clang-cc -include %S/objc_import.h -fsyntax-only -verify %s
// Test with pch.
-// RUN: clang-cc -x=objective-c -emit-pch -o %t %S/objc_import.h &&
+// RUN: clang-cc -x=objective-c -emit-pch -o %t %S/objc_import.h
// RUN: clang-cc -include-pch %t -fsyntax-only -verify %s
#import "objc_import.h"
diff --git a/test/PCH/objc_methods.m b/test/PCH/objc_methods.m
index 1a198b1..aff34d1 100644
--- a/test/PCH/objc_methods.m
+++ b/test/PCH/objc_methods.m
@@ -1,8 +1,8 @@
// Test this without pch.
-// RUN: clang-cc -include %S/objc_methods.h -fsyntax-only -verify %s &&
+// RUN: clang-cc -include %S/objc_methods.h -fsyntax-only -verify %s
// Test with pch.
-// RUN: clang-cc -x=objective-c -emit-pch -o %t %S/objc_methods.h &&
+// RUN: clang-cc -x=objective-c -emit-pch -o %t %S/objc_methods.h
// RUN: clang-cc -include-pch %t -fsyntax-only -verify %s
void func() {
diff --git a/test/PCH/objc_property.m b/test/PCH/objc_property.m
index 5cf6de7..a1d3eb9 100644
--- a/test/PCH/objc_property.m
+++ b/test/PCH/objc_property.m
@@ -1,8 +1,8 @@
// Test this without pch.
-// RUN: clang-cc -include %S/objc_property.h -fsyntax-only -verify %s &&
+// RUN: clang-cc -include %S/objc_property.h -fsyntax-only -verify %s
// Test with pch.
-// RUN: clang-cc -x=objective-c -emit-pch -o %t %S/objc_property.h &&
+// RUN: clang-cc -x=objective-c -emit-pch -o %t %S/objc_property.h
// RUN: clang-cc -include-pch %t -fsyntax-only -verify %s
void func() {
diff --git a/test/PCH/pr4489.c b/test/PCH/pr4489.c
index d05d5cd..aaf5aac 100644
--- a/test/PCH/pr4489.c
+++ b/test/PCH/pr4489.c
@@ -1,5 +1,5 @@
-// RUN: clang -x c-header -o %t.pch %s &&
-// RUN: echo > %t.empty.c &&
+// RUN: clang -x c-header -o %t.pch %s
+// RUN: echo > %t.empty.c
// RUN: clang -include %t -x c %t.empty.c -emit-llvm -S -o -
// PR 4489: Crash with PCH
// PR 4492: Crash with PCH (round two)
diff --git a/test/PCH/preprocess.c b/test/PCH/preprocess.c
index 128cc0a..7a6c2c5 100644
--- a/test/PCH/preprocess.c
+++ b/test/PCH/preprocess.c
@@ -1,5 +1,8 @@
-// RUN: clang-cc -emit-pch -o %t %S/preprocess.h &&
-// RUN: clang-cc -include-pch %t -E -o - %s | grep -c "a_typedef" | count 1
-#include "preprocess.h"
+// Check that -E mode is invariant when using an implicit PCH.
-int a_value;
+// RUN: clang-cc -include %S/preprocess.h -E -o %t.orig %s
+// RUN: clang-cc -emit-pch -o %t %S/preprocess.h
+// RUN: clang-cc -include-pch %t -E -o %t.from_pch %s
+// RUN: diff %t.orig %t.from_pch
+
+a_typedef a_value;
diff --git a/test/PCH/reloc.c b/test/PCH/reloc.c
index b08187f..36247d5 100644
--- a/test/PCH/reloc.c
+++ b/test/PCH/reloc.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -emit-pch -o %t --relocatable-pch -isysroot %S/libroot %S/libroot/usr/include/reloc.h &&
-// RUN: clang-cc -include-pch %t -isysroot %S/libroot %s -verify &&
+// RUN: clang-cc -emit-pch -o %t --relocatable-pch -isysroot %S/libroot %S/libroot/usr/include/reloc.h
+// RUN: clang-cc -include-pch %t -isysroot %S/libroot %s -verify
// RUN: not clang-cc -include-pch %t %s
#include <reloc.h>
diff --git a/test/PCH/stmts.c b/test/PCH/stmts.c
index 0d906f2..69c7ec7 100644
--- a/test/PCH/stmts.c
+++ b/test/PCH/stmts.c
@@ -1,8 +1,8 @@
// Test this without pch.
-// RUN: clang-cc -include %S/stmts.h -fsyntax-only -emit-llvm -o - %s &&
+// RUN: clang-cc -include %S/stmts.h -fsyntax-only -emit-llvm -o - %s
// Test with pch.
-// RUN: clang-cc -emit-pch -o %t %S/stmts.h &&
+// RUN: clang-cc -emit-pch -o %t %S/stmts.h
// RUN: clang-cc -include-pch %t -fsyntax-only -emit-llvm -o - %s
void g0(void) { f0(5); }
diff --git a/test/PCH/struct.c b/test/PCH/struct.c
index f1e2811..6595a2f 100644
--- a/test/PCH/struct.c
+++ b/test/PCH/struct.c
@@ -1,8 +1,8 @@
// Test this without pch.
-// RUN: clang-cc -include %S/struct.h -fsyntax-only -verify %s &&
+// RUN: clang-cc -include %S/struct.h -fsyntax-only -verify %s
// Test with pch.
-// RUN: clang-cc -emit-pch -o %t %S/struct.h &&
+// RUN: clang-cc -emit-pch -o %t %S/struct.h
// RUN: clang-cc -include-pch %t -fsyntax-only -verify %s
struct Point *p1;
diff --git a/test/PCH/tentative-defs.c b/test/PCH/tentative-defs.c
index 980cfab..5b85fcc 100644
--- a/test/PCH/tentative-defs.c
+++ b/test/PCH/tentative-defs.c
@@ -1,8 +1,8 @@
// Test with pch.
-// RUN: clang-cc -triple x86_64-apple-darwin9 -emit-pch -o %t.pch %S/tentative-defs.h &&
-// RUN: clang-cc -triple x86_64-apple-darwin9 -include-pch %t.pch -verify -emit-llvm -o %t %s &&
+// RUN: clang-cc -triple x86_64-apple-darwin9 -emit-pch -o %t.pch %S/tentative-defs.h
+// RUN: clang-cc -triple x86_64-apple-darwin9 -include-pch %t.pch -verify -emit-llvm -o %t %s
-// RUN: grep "@variable = common global i32 0" %t | count 1 &&
+// RUN: grep "@variable = common global i32 0" %t | count 1
// RUN: grep "@incomplete_array = common global .*1 x i32" %t | count 1
diff --git a/test/PCH/types.c b/test/PCH/types.c
index c111c9e..a7efaef 100644
--- a/test/PCH/types.c
+++ b/test/PCH/types.c
@@ -1,8 +1,8 @@
// Test this without pch.
-// RUN: clang-cc -fblocks -include %S/types.h -fsyntax-only -verify %s &&
+// RUN: clang-cc -fblocks -include %S/types.h -fsyntax-only -verify %s
// Test with pch.
-// RUN: clang-cc -emit-pch -fblocks -o %t %S/types.h &&
+// RUN: clang-cc -emit-pch -fblocks -o %t %S/types.h
// RUN: clang-cc -fblocks -include-pch %t -fsyntax-only -verify %s
typedef int INT;
diff --git a/test/PCH/va_arg.c b/test/PCH/va_arg.c
index 75cee06..6f7ccf4 100644
--- a/test/PCH/va_arg.c
+++ b/test/PCH/va_arg.c
@@ -1,8 +1,8 @@
// Test this without pch.
-// RUN: clang-cc -triple=x86_64-unknown-freebsd7.0 -include %S/va_arg.h %s -emit-llvm -o - &&
+// RUN: clang-cc -triple=x86_64-unknown-freebsd7.0 -include %S/va_arg.h %s -emit-llvm -o -
// Test with pch.
-// RUN: clang-cc -triple=x86_64-unknown-freebsd7.0 -emit-pch -o %t %S/va_arg.h &&
+// RUN: clang-cc -triple=x86_64-unknown-freebsd7.0 -emit-pch -o %t %S/va_arg.h
// RUN: clang-cc -triple=x86_64-unknown-freebsd7.0 -include-pch %t %s -emit-llvm -o -
char *g0(char** argv, int argc) { return argv[argc]; }
diff --git a/test/PCH/variables.c b/test/PCH/variables.c
index c988a59..f79b684 100644
--- a/test/PCH/variables.c
+++ b/test/PCH/variables.c
@@ -1,8 +1,8 @@
// Test this without pch.
-// RUN: clang-cc -include %S/variables.h -fsyntax-only -verify %s &&
+// RUN: clang-cc -include %S/variables.h -fsyntax-only -verify %s
// Test with pch.
-// RUN: clang-cc -emit-pch -o %t %S/variables.h &&
+// RUN: clang-cc -emit-pch -o %t %S/variables.h
// RUN: clang-cc -include-pch %t -fsyntax-only -verify %s
int *ip2 = &x;
diff --git a/test/Parser/2008-10-31-parse-noop-failure.c b/test/Parser/2008-10-31-parse-noop-failure.c
index 0598ea7..8243cb9 100755
--- a/test/Parser/2008-10-31-parse-noop-failure.c
+++ b/test/Parser/2008-10-31-parse-noop-failure.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -verify -parse-noop %t
+// RUN: clang-cc -verify -parse-noop %s
void add_attribute(id) int id; {}
diff --git a/test/Parser/block-block-storageclass.c b/test/Parser/block-block-storageclass.c
index d24ec5f..df94234 100644
--- a/test/Parser/block-block-storageclass.c
+++ b/test/Parser/block-block-storageclass.c
@@ -1,6 +1,6 @@
// RUN: clang-cc -fsyntax-only -verify -parse-noop %s
#if 0
-#include <stdio.h>
+int printf(const char *, ...);
void _Block_byref_release(void*src){}
int main() {
diff --git a/test/Parser/control-scope.c b/test/Parser/control-scope.c
index 7ffc6ac..8c4e199 100644
--- a/test/Parser/control-scope.c
+++ b/test/Parser/control-scope.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc %s -std=c90 -verify &&
+// RUN: clang-cc %s -std=c90 -verify
// RUN: clang-cc %s -std=c99
int f (int z) {
diff --git a/test/Parser/cxx-using-declaration.cpp b/test/Parser/cxx-using-declaration.cpp
index 212a7d8..a2bc8c5 100644
--- a/test/Parser/cxx-using-declaration.cpp
+++ b/test/Parser/cxx-using-declaration.cpp
@@ -1,6 +1,6 @@
// FIXME: Disabled, appears to have undefined behavior, and needs to be updated to match new warnings.
-// RUN: true
-// RUNX: clang-cc -fsyntax-only -verify %s
+// RUN: clang-cc -fsyntax-only -verify %s
+// XFAIL: *
namespace A {
int VA;
diff --git a/test/Parser/objc-init.m b/test/Parser/objc-init.m
index a91ac9c..bc88e33 100644
--- a/test/Parser/objc-init.m
+++ b/test/Parser/objc-init.m
@@ -39,3 +39,21 @@ void test5(NSNumber *x) {
.x [x METH2] // expected-error {{expected '=' or another designator}}
};
}
+
+// rdar://7370882
+@interface SemicolonsAppDelegate
+{
+ id i;
+}
+@property (assign) id window;
+@end
+
+@implementation SemicolonsAppDelegate
+{
+ id i;
+}
+ @synthesize window=i;
+@end
+
+
+
diff --git a/test/Parser/objc-try-catch-1.m b/test/Parser/objc-try-catch-1.m
index a8d37f0..98c6d16 100644
--- a/test/Parser/objc-try-catch-1.m
+++ b/test/Parser/objc-try-catch-1.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fsyntax-only -verify %s &&
+// RUN: clang-cc -fsyntax-only -verify %s
// RUN: clang-cc -fsyntax-only -verify -x objective-c++ %s
void * proc();
diff --git a/test/Preprocessor/_Pragma-dependency.c b/test/Preprocessor/_Pragma-dependency.c
index da1d87f..17c5355 100644
--- a/test/Preprocessor/_Pragma-dependency.c
+++ b/test/Preprocessor/_Pragma-dependency.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc %s -E 2>&1 | grep 'DO_PRAGMA (STR' &&
+// RUN: clang-cc %s -E 2>&1 | grep 'DO_PRAGMA (STR'
// RUN: clang-cc %s -E 2>&1 | grep '7:3'
#define DO_PRAGMA _Pragma
diff --git a/test/Preprocessor/_Pragma-physloc.c b/test/Preprocessor/_Pragma-physloc.c
index 8737949..016c97b 100644
--- a/test/Preprocessor/_Pragma-physloc.c
+++ b/test/Preprocessor/_Pragma-physloc.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc %s -E | grep '#pragma x y z' &&
+// RUN: clang-cc %s -E | grep '#pragma x y z'
// RUN: clang-cc %s -E | grep '#pragma a b c'
_Pragma("x y z")
diff --git a/test/Preprocessor/assembler-with-cpp.c b/test/Preprocessor/assembler-with-cpp.c
index 4f1c443..693d5b8 100644
--- a/test/Preprocessor/assembler-with-cpp.c
+++ b/test/Preprocessor/assembler-with-cpp.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -x assembler-with-cpp -fdollars-in-identifiers=0 -E %s -o - | FileCheck -strict-whitespace -check-prefix=CHECK-Identifiers-False %s &&
+// RUN: clang-cc -x assembler-with-cpp -fdollars-in-identifiers=0 -E %s -o - | FileCheck -strict-whitespace -check-prefix=CHECK-Identifiers-False %s
#ifndef __ASSEMBLER__
#error "__ASSEMBLER__ not defined"
@@ -49,7 +49,7 @@
6: FOO(blarg)
// CHECK-Identifiers-False: 6: blarg $foo
-// RUN: clang-cc -x assembler-with-cpp -fdollars-in-identifiers=1 -E %s -o - | FileCheck -check-prefix=CHECK-Identifiers-True -strict-whitespace %s &&
+// RUN: clang-cc -x assembler-with-cpp -fdollars-in-identifiers=1 -E %s -o - | FileCheck -check-prefix=CHECK-Identifiers-True -strict-whitespace %s
#define FOO(name) name ## $foo
7: FOO(blarg)
// CHECK-Identifiers-True: 7: blarg$foo
@@ -72,4 +72,3 @@
11: T11(b)
// CHECK-Identifiers-True: 11: #0
-// RUN: true
diff --git a/test/Preprocessor/builtin_line.c b/test/Preprocessor/builtin_line.c
index db01e47..06a2ac20 100644
--- a/test/Preprocessor/builtin_line.c
+++ b/test/Preprocessor/builtin_line.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc %s -E | grep "^ 4" &&
+// RUN: clang-cc %s -E | grep "^ 4"
#define FOO __LINE__
FOO
diff --git a/test/Preprocessor/comment_save_macro.c b/test/Preprocessor/comment_save_macro.c
index b9a25ed..76a21bf 100644
--- a/test/Preprocessor/comment_save_macro.c
+++ b/test/Preprocessor/comment_save_macro.c
@@ -1,7 +1,7 @@
-// RUN: clang-cc -E -C %s | FileCheck -check-prefix=CHECK-C -strict-whitespace %s &&
+// RUN: clang-cc -E -C %s | FileCheck -check-prefix=CHECK-C -strict-whitespace %s
// CHECK-C: boo bork bar // zot
-// RUN: clang-cc -E -CC %s | FileCheck -check-prefix=CHECK-CC -strict-whitespace %s &&
+// RUN: clang-cc -E -CC %s | FileCheck -check-prefix=CHECK-CC -strict-whitespace %s
// CHECK-CC: boo bork /* blah*/ bar // zot
// RUN: clang-cc -E %s | FileCheck -check-prefix=CHECK -strict-whitespace %s
diff --git a/test/Preprocessor/cxx_and.cpp b/test/Preprocessor/cxx_and.cpp
index 971b7bc..7470913 100644
--- a/test/Preprocessor/cxx_and.cpp
+++ b/test/Preprocessor/cxx_and.cpp
@@ -1,6 +1,6 @@
-// RUN: clang-cc -DA -DB -E %s | grep 'int a = 37 == 37' &&
-// RUN: clang-cc -DA -E %s | grep 'int a = 927 == 927' &&
-// RUN: clang-cc -DB -E %s | grep 'int a = 927 == 927' &&
+// RUN: clang-cc -DA -DB -E %s | grep 'int a = 37 == 37'
+// RUN: clang-cc -DA -E %s | grep 'int a = 927 == 927'
+// RUN: clang-cc -DB -E %s | grep 'int a = 927 == 927'
// RUN: clang-cc -E %s | grep 'int a = 927 == 927'
#if defined(A) and defined(B)
#define X 37
diff --git a/test/Preprocessor/cxx_bitand.cpp b/test/Preprocessor/cxx_bitand.cpp
index 8d7fe67..e6b7c2c 100644
--- a/test/Preprocessor/cxx_bitand.cpp
+++ b/test/Preprocessor/cxx_bitand.cpp
@@ -1,5 +1,5 @@
-// RUN: clang-cc -DA=1 -DB=2 -E %s | grep 'int a = 927 == 927' &&
-// RUN: clang-cc -DA=1 -DB=1 -E %s | grep 'int a = 37 == 37' &&
+// RUN: clang-cc -DA=1 -DB=2 -E %s | grep 'int a = 927 == 927'
+// RUN: clang-cc -DA=1 -DB=1 -E %s | grep 'int a = 37 == 37'
// RUN: clang-cc -E %s | grep 'int a = 927 == 927'
#if A bitand B
#define X 37
diff --git a/test/Preprocessor/cxx_bitor.cpp b/test/Preprocessor/cxx_bitor.cpp
index 7645c7e..e72fcb4 100644
--- a/test/Preprocessor/cxx_bitor.cpp
+++ b/test/Preprocessor/cxx_bitor.cpp
@@ -1,7 +1,7 @@
-// RUN: clang-cc -DA=1 -DB=1 -E %s | grep 'int a = 37 == 37' &&
-// RUN: clang-cc -DA=0 -DB=1 -E %s | grep 'int a = 37 == 37' &&
-// RUN: clang-cc -DA=1 -DB=0 -E %s | grep 'int a = 37 == 37' &&
-// RUN: clang-cc -DA=0 -DB=0 -E %s | grep 'int a = 927 == 927' &&
+// RUN: clang-cc -DA=1 -DB=1 -E %s | grep 'int a = 37 == 37'
+// RUN: clang-cc -DA=0 -DB=1 -E %s | grep 'int a = 37 == 37'
+// RUN: clang-cc -DA=1 -DB=0 -E %s | grep 'int a = 37 == 37'
+// RUN: clang-cc -DA=0 -DB=0 -E %s | grep 'int a = 927 == 927'
// RUN: clang-cc -E %s | grep 'int a = 927 == 927'
#if A bitor B
#define X 37
diff --git a/test/Preprocessor/cxx_compl.cpp b/test/Preprocessor/cxx_compl.cpp
index f1cc6d2..b319c51 100644
--- a/test/Preprocessor/cxx_compl.cpp
+++ b/test/Preprocessor/cxx_compl.cpp
@@ -1,5 +1,5 @@
-// RUN: clang-cc -DA=1 -E %s | grep 'int a = 37 == 37' &&
-// RUN: clang-cc -DA=0 -E %s | grep 'int a = 927 == 927' &&
+// RUN: clang-cc -DA=1 -E %s | grep 'int a = 37 == 37'
+// RUN: clang-cc -DA=0 -E %s | grep 'int a = 927 == 927'
// RUN: clang-cc -E %s | grep 'int a = 927 == 927'
#if compl 0 bitand A
#define X 37
diff --git a/test/Preprocessor/cxx_not.cpp b/test/Preprocessor/cxx_not.cpp
index dd31901..2272941 100644
--- a/test/Preprocessor/cxx_not.cpp
+++ b/test/Preprocessor/cxx_not.cpp
@@ -1,4 +1,4 @@
-// RUN: clang-cc -DA=1 -E %s | grep 'int a = 927 == 927' &&
+// RUN: clang-cc -DA=1 -E %s | grep 'int a = 927 == 927'
// RUN: clang-cc -E %s | grep 'int a = 37 == 37'
#if not defined(A)
#define X 37
diff --git a/test/Preprocessor/cxx_not_eq.cpp b/test/Preprocessor/cxx_not_eq.cpp
index 4940f3b..92418b2 100644
--- a/test/Preprocessor/cxx_not_eq.cpp
+++ b/test/Preprocessor/cxx_not_eq.cpp
@@ -1,5 +1,5 @@
-// RUN: clang-cc -DA=1 -DB=1 -E %s | grep 'int a = 927 == 927' &&
-// RUN: clang-cc -E %s | grep 'int a = 927 == 927' &&
+// RUN: clang-cc -DA=1 -DB=1 -E %s | grep 'int a = 927 == 927'
+// RUN: clang-cc -E %s | grep 'int a = 927 == 927'
// RUN: clang-cc -DA=1 -DB=2 -E %s | grep 'int a = 37 == 37'
#if A not_eq B
#define X 37
diff --git a/test/Preprocessor/cxx_oper_keyword.cpp b/test/Preprocessor/cxx_oper_keyword.cpp
index faae687..0464e97 100644
--- a/test/Preprocessor/cxx_oper_keyword.cpp
+++ b/test/Preprocessor/cxx_oper_keyword.cpp
@@ -1,4 +1,4 @@
-// RUN: not clang-cc %s -E &&
+// RUN: not clang-cc %s -E
// RUN: clang-cc %s -E -fno-operator-names
// Not valid in C++ unless -fno-operator-names is passed.
diff --git a/test/Preprocessor/cxx_or.cpp b/test/Preprocessor/cxx_or.cpp
index 133f285..2f7c0a5 100644
--- a/test/Preprocessor/cxx_or.cpp
+++ b/test/Preprocessor/cxx_or.cpp
@@ -1,6 +1,6 @@
-// RUN: clang-cc -DA -DB -E %s | grep 'int a = 37 == 37' &&
-// RUN: clang-cc -DA -E %s | grep 'int a = 37 == 37' &&
-// RUN: clang-cc -DB -E %s | grep 'int a = 37 == 37' &&
+// RUN: clang-cc -DA -DB -E %s | grep 'int a = 37 == 37'
+// RUN: clang-cc -DA -E %s | grep 'int a = 37 == 37'
+// RUN: clang-cc -DB -E %s | grep 'int a = 37 == 37'
// RUN: clang-cc -E %s | grep 'int a = 927 == 927'
#if defined(A) or defined(B)
#define X 37
diff --git a/test/Preprocessor/cxx_true.cpp b/test/Preprocessor/cxx_true.cpp
index e35c54d..80aa04e 100644
--- a/test/Preprocessor/cxx_true.cpp
+++ b/test/Preprocessor/cxx_true.cpp
@@ -1,5 +1,5 @@
-/* RUN: clang-cc -E %s -x=c++ | grep block_1 &&
- RUN: clang-cc -E %s -x=c++ | not grep block_2 &&
+/* RUN: clang-cc -E %s -x=c++ | grep block_1
+ RUN: clang-cc -E %s -x=c++ | not grep block_2
RUN: clang-cc -E %s -x=c | not grep block
*/
diff --git a/test/Preprocessor/cxx_xor.cpp b/test/Preprocessor/cxx_xor.cpp
index a38c3c5..e6df9bb 100644
--- a/test/Preprocessor/cxx_xor.cpp
+++ b/test/Preprocessor/cxx_xor.cpp
@@ -1,7 +1,7 @@
-// RUN: clang-cc -DA=1 -DB=1 -E %s | grep 'int a = 927 == 927' &&
-// RUN: clang-cc -DA=0 -DB=1 -E %s | grep 'int a = 37 == 37' &&
-// RUN: clang-cc -DA=1 -DB=0 -E %s | grep 'int a = 37 == 37' &&
-// RUN: clang-cc -DA=0 -DB=0 -E %s | grep 'int a = 927 == 927' &&
+// RUN: clang-cc -DA=1 -DB=1 -E %s | grep 'int a = 927 == 927'
+// RUN: clang-cc -DA=0 -DB=1 -E %s | grep 'int a = 37 == 37'
+// RUN: clang-cc -DA=1 -DB=0 -E %s | grep 'int a = 37 == 37'
+// RUN: clang-cc -DA=0 -DB=0 -E %s | grep 'int a = 927 == 927'
// RUN: clang-cc -E %s | grep 'int a = 927 == 927'
#if A xor B
#define X 37
diff --git a/test/Preprocessor/dependencies-and-pp.c b/test/Preprocessor/dependencies-and-pp.c
index 1dc4d02..5359d0a 100644
--- a/test/Preprocessor/dependencies-and-pp.c
+++ b/test/Preprocessor/dependencies-and-pp.c
@@ -1,5 +1,5 @@
-// RUN: clang -E -o %t.1 %s &&
-// RUN: clang -E -MD -MF %t.d -MT foo -o %t.2 %s &&
-// RUN: diff %t.1 %t.2 &&
-// RUN: grep "foo:" %t.d &&
+// RUN: clang -E -o %t.1 %s
+// RUN: clang -E -MD -MF %t.d -MT foo -o %t.2 %s
+// RUN: diff %t.1 %t.2
+// RUN: grep "foo:" %t.d
// RUN: grep "dependencies-and-pp.c" %t.d
diff --git a/test/Preprocessor/dump-options.c b/test/Preprocessor/dump-options.c
index 6910e1a..8302f1a 100644
--- a/test/Preprocessor/dump-options.c
+++ b/test/Preprocessor/dump-options.c
@@ -1,3 +1,3 @@
-// RUN: clang %s -E -dD | grep __INTMAX_MAX__ &&
+// RUN: clang %s -E -dD | grep __INTMAX_MAX__
// RUN: clang %s -E -dM | grep __INTMAX_MAX__
diff --git a/test/Preprocessor/dump_macros.c b/test/Preprocessor/dump_macros.c
index d3e06b2..bdc6953 100644
--- a/test/Preprocessor/dump_macros.c
+++ b/test/Preprocessor/dump_macros.c
@@ -1,29 +1,29 @@
-// RUN: clang-cc -E -dM %s -o %t &&
+// RUN: clang-cc -E -dM %s -o %t
// Space even without expansion tokens
-// RUN: grep "#define A(x) " %t &&
+// RUN: grep "#define A(x) " %t
#define A(x)
// Space before expansion list.
-// RUN: grep "#define B(x,y) x y" %t &&
+// RUN: grep "#define B(x,y) x y" %t
#define B(x,y)x y
// No space in expansion list.
-// RUN: grep "#define C(x,y) x y" %t &&
+// RUN: grep "#define C(x,y) x y" %t
#define C(x, y) x y
// No paste avoidance.
-// RUN: grep "#define X() .." %t &&
+// RUN: grep "#define X() .." %t
#define X() ..
// Simple test.
-// RUN: grep "#define Y ." %t &&
-// RUN: grep "#define Z X()Y" %t &&
+// RUN: grep "#define Y ." %t
+// RUN: grep "#define Z X()Y" %t
#define Y .
#define Z X()Y
// gcc prints macros at end of translation unit, so last one wins.
-// RUN: grep "#define foo 2" %t &&
+// RUN: grep "#define foo 2" %t
// RUN: not grep "#define foo 1" %t
#define foo 1
#undef foo
diff --git a/test/Preprocessor/expr_comma.c b/test/Preprocessor/expr_comma.c
index 0a24bac..88ceabf 100644
--- a/test/Preprocessor/expr_comma.c
+++ b/test/Preprocessor/expr_comma.c
@@ -1,5 +1,5 @@
// Comma is not allowed in C89
-// RUN: not clang-cc -E %s -std=c89 -pedantic-errors &&
+// RUN: not clang-cc -E %s -std=c89 -pedantic-errors
// Comma is allowed if unevaluated in C99
// RUN: clang-cc -E %s -std=c99 -pedantic-errors
diff --git a/test/Preprocessor/expr_invalid_tok.c b/test/Preprocessor/expr_invalid_tok.c
index 5e750a4..8bc2b8e 100644
--- a/test/Preprocessor/expr_invalid_tok.c
+++ b/test/Preprocessor/expr_invalid_tok.c
@@ -1,5 +1,5 @@
-// RUN: not clang-cc -E %s 2>&1 | grep 'invalid token at start of a preprocessor expression' &&
-// RUN: not clang-cc -E %s 2>&1 | grep 'token is not a valid binary operator in a preprocessor subexpression' &&
+// RUN: not clang-cc -E %s 2>&1 | grep 'invalid token at start of a preprocessor expression'
+// RUN: not clang-cc -E %s 2>&1 | grep 'token is not a valid binary operator in a preprocessor subexpression'
// RUN: not clang-cc -E %s 2>&1 | grep ':14: error: expected end of line in preprocessor expression'
// PR2220
diff --git a/test/Preprocessor/expr_liveness.c b/test/Preprocessor/expr_liveness.c
index 3d1e25e..d44b196 100644
--- a/test/Preprocessor/expr_liveness.c
+++ b/test/Preprocessor/expr_liveness.c
@@ -1,4 +1,4 @@
-/* RUN: clang-cc -E %s -DNO_ERRORS -Werror -Wundef &&
+/* RUN: clang-cc -E %s -DNO_ERRORS -Werror -Wundef
RUN: not clang-cc -E %s
*/
diff --git a/test/Preprocessor/feature_tests.c b/test/Preprocessor/feature_tests.c
index 9a29ab9..dbfde4b 100644
--- a/test/Preprocessor/feature_tests.c
+++ b/test/Preprocessor/feature_tests.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc %s --triple=i686-apple-darwin9 &&
+// RUN: clang-cc %s --triple=i686-apple-darwin9
// RUN: clang-cc %s -E --triple=i686-apple-darwin9
#ifndef __has_feature
#error Should have __has_feature
diff --git a/test/Preprocessor/hash_line.c b/test/Preprocessor/hash_line.c
index 7ed65d1..31f708c 100644
--- a/test/Preprocessor/hash_line.c
+++ b/test/Preprocessor/hash_line.c
@@ -1,6 +1,6 @@
// The 1 and # should not go on the same line.
-// RUN: clang-cc %s -E | not grep "1 #" &&
-// RUN: clang-cc %s -E | grep '^1$' &&
+// RUN: clang-cc %s -E | not grep "1 #"
+// RUN: clang-cc %s -E | grep '^1$'
// RUN: clang-cc %s -E | grep '^ #$'
1
#define EMPTY
diff --git a/test/Preprocessor/header_lookup1.c b/test/Preprocessor/header_lookup1.c
index df58a6e..10049ad 100644
--- a/test/Preprocessor/header_lookup1.c
+++ b/test/Preprocessor/header_lookup1.c
@@ -1,2 +1,2 @@
-// RUN: clang-cc -I /usr/include %s -E | grep 'stdio.h.*3.*4'
+// RUN: clang -I /usr/include %s -E | grep 'stdio.h.*3.*4'
#include <stdio.h>
diff --git a/test/Preprocessor/if_warning.c b/test/Preprocessor/if_warning.c
index 5567513..2ce7b31 100644
--- a/test/Preprocessor/if_warning.c
+++ b/test/Preprocessor/if_warning.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc %s -Eonly -Werror=undef -verify &&
+// RUN: clang-cc %s -Eonly -Werror=undef -verify
// RUN: clang-cc %s -Eonly -Werror-undef -verify
extern int x;
diff --git a/test/Preprocessor/include-pth.c b/test/Preprocessor/include-pth.c
index 2afc66a..5634d71 100644
--- a/test/Preprocessor/include-pth.c
+++ b/test/Preprocessor/include-pth.c
@@ -1,3 +1,3 @@
-// RUN: clang-cc -emit-pth %s -o %t &&
+// RUN: clang-cc -emit-pth %s -o %t
// RUN: clang-cc -include-pth %t %s -E | grep 'file_to_include' | count 2
#include "file_to_include.h"
diff --git a/test/Preprocessor/init.c b/test/Preprocessor/init.c
index 800b750..2926900 100644
--- a/test/Preprocessor/init.c
+++ b/test/Preprocessor/init.c
@@ -1,15 +1,15 @@
-// RUN: clang-cc -E -dM -x=assembler-with-cpp < /dev/null | FileCheck -check-prefix ASM %s &&
+// RUN: clang-cc -E -dM -x=assembler-with-cpp < /dev/null | FileCheck -check-prefix ASM %s
//
// ASM:#define __ASSEMBLER__ 1
//
//
-// RUN: clang-cc -fblocks -E -dM < /dev/null | FileCheck -check-prefix BLOCKS %s &&
+// RUN: clang-cc -fblocks -E -dM < /dev/null | FileCheck -check-prefix BLOCKS %s
//
// BLOCKS:#define __BLOCKS__ 1
// BLOCKS:#define __block __attribute__((__blocks__(byref)))
//
//
-// RUN: clang-cc -x=c++ -std=c++0x -E -dM < /dev/null | FileCheck -check-prefix CXX0X %s &&
+// RUN: clang-cc -x=c++ -std=c++0x -E -dM < /dev/null | FileCheck -check-prefix CXX0X %s
//
// CXX0X:#define _GNU_SOURCE 1
// CXX0X:#define __DEPRECATED 1
@@ -20,7 +20,7 @@
// CXX0X:#define __private_extern__ extern
//
//
-// RUN: clang-cc -x=c++ -std=c++98 -E -dM < /dev/null | FileCheck -check-prefix CXX98 %s &&
+// RUN: clang-cc -x=c++ -std=c++98 -E -dM < /dev/null | FileCheck -check-prefix CXX98 %s
//
// CXX98:#define _GNU_SOURCE 1
// CXX98:#define __DEPRECATED 1
@@ -30,13 +30,13 @@
// CXX98:#define __private_extern__ extern
//
//
-// RUN: clang-cc -std=c99 -E -dM < /dev/null | FileCheck -check-prefix C99 %s &&
+// RUN: clang-cc -std=c99 -E -dM < /dev/null | FileCheck -check-prefix C99 %s
//
// C99:#define __STDC_VERSION__ 199901L
// C99:#define __STRICT_ANSI__ 1
//
//
-// RUN: clang-cc -E -dM -fms-extensions=0 < /dev/null | FileCheck -check-prefix COMMON %s &&
+// RUN: clang-cc -E -dM -fms-extensions=0 < /dev/null | FileCheck -check-prefix COMMON %s
//
// COMMON:#define __CONSTANT_CFSTRINGS__ 1
// COMMON:#define __FINITE_MATH_ONLY__ 0
@@ -53,10 +53,10 @@
// COMMON:#define __llvm__ 1
//
//
-// RUN: clang-cc -ffreestanding -E -dM < /dev/null | FileCheck -check-prefix FREESTANDING %s &&
+// RUN: clang-cc -ffreestanding -E -dM < /dev/null | FileCheck -check-prefix FREESTANDING %s
// FREESTANDING:#define __STDC_HOSTED__ 0
//
-// RUN: clang-cc -x=c++ -std=gnu++98 -E -dM < /dev/null | FileCheck -check-prefix GXX98 %s &&
+// RUN: clang-cc -x=c++ -std=gnu++98 -E -dM < /dev/null | FileCheck -check-prefix GXX98 %s
//
// GXX98:#define _GNU_SOURCE 1
// GXX98:#define __DEPRECATED 1
@@ -66,12 +66,12 @@
// GXX98:#define __private_extern__ extern
//
//
-// RUN: clang-cc -std=iso9899:199409 -E -dM < /dev/null | FileCheck -check-prefix C94 %s &&
+// RUN: clang-cc -std=iso9899:199409 -E -dM < /dev/null | FileCheck -check-prefix C94 %s
//
// C94:#define __STDC_VERSION__ 199409L
//
//
-// RUN: clang-cc -fms-extensions -E -dM < /dev/null | FileCheck -check-prefix MSEXT %s &&
+// RUN: clang-cc -fms-extensions -E -dM < /dev/null | FileCheck -check-prefix MSEXT %s
//
// MSEXT-NOT:#define __STDC__
// MSEXT:#define __int16 __INT16_TYPE__
@@ -80,45 +80,41 @@
// MSEXT:#define __int8 __INT8_TYPE__
//
//
-// RUN: clang-cc -x=objective-c -E -dM < /dev/null | FileCheck -check-prefix OBJC %s &&
+// RUN: clang-cc -x=objective-c -E -dM < /dev/null | FileCheck -check-prefix OBJC %s
//
// OBJC:#define OBJC_NEW_PROPERTIES 1
+// OBJC:#define __NEXT_RUNTIME__ 1
// OBJC:#define __OBJC__ 1
//
-//
-// RUN: clang-cc -x=objective-c -fobjc-gc -E -dM < /dev/null | FileCheck -check-prefix OBJCGC %s &&
//
-// OBJCGC:#define __OBJC_GC__ 1
+// RUN: clang-cc -x=objective-c -fobjc-gc -E -dM < /dev/null | FileCheck -check-prefix OBJCGC %s
//
-//
-// RUN: clang-cc -x=objective-c -fnext-runtime -E -dM < /dev/null | FileCheck -check-prefix NEXTRT %s &&
-//
-// NEXTRT:#define __NEXT_RUNTIME__ 1
+// OBJCGC:#define __OBJC_GC__ 1
//
//
-// RUN: clang-cc -x=objective-c -fobjc-nonfragile-abi -E -dM < /dev/null | FileCheck -check-prefix NONFRAGILE %s &&
+// RUN: clang-cc -x=objective-c -fobjc-nonfragile-abi -E -dM < /dev/null | FileCheck -check-prefix NONFRAGILE %s
//
// NONFRAGILE:#define OBJC_ZEROCOST_EXCEPTIONS 1
// NONFRAGILE:#define __OBJC2__ 1
//
//
-// RUN: clang-cc -O1 -E -dM < /dev/null | FileCheck -check-prefix O1 %s &&
+// RUN: clang-cc -O1 -E -dM < /dev/null | FileCheck -check-prefix O1 %s
//
// O1:#define __OPTIMIZE__ 1
//
//
-// RUN: clang-cc -fpascal-strings -E -dM < /dev/null | FileCheck -check-prefix PASCAL %s &&
+// RUN: clang-cc -fpascal-strings -E -dM < /dev/null | FileCheck -check-prefix PASCAL %s
//
// PASCAL:#define __PASCAL_STRINGS__ 1
//
//
-// RUN: clang-cc -fsigned-char -E -dM -fms-extensions=0 < /dev/null | FileCheck -check-prefix SCHAR %s &&
+// RUN: clang-cc -fsigned-char -E -dM -fms-extensions=0 < /dev/null | FileCheck -check-prefix SCHAR %s
//
// SCHAR:#define __STDC__ 1
// SCHAR-NOT:#define __UNSIGNED_CHAR__
// SCHAR:#define __clang__ 1
//
-// RUN: clang-cc -E -dM -ffreestanding -triple=arm-none-none < /dev/null | FileCheck -check-prefix ARM %s &&
+// RUN: clang-cc -E -dM -ffreestanding -triple=arm-none-none < /dev/null | FileCheck -check-prefix ARM %s
//
// ARM:#define __APCS_32__ 1
// ARM:#define __ARMEL__ 1
@@ -155,6 +151,7 @@
// ARM:#define __FLT_RADIX__ 2
// ARM:#define __INT16_TYPE__ short
// ARM:#define __INT32_TYPE__ int
+// ARM:#define __INT64_C_SUFFIX__ LL
// ARM:#define __INT64_TYPE__ long long int
// ARM:#define __INT8_TYPE__ char
// ARM:#define __INTMAX_MAX__ 9223372036854775807LL
@@ -193,7 +190,7 @@
// ARM:#define __arm 1
// ARM:#define __arm__ 1
//
-// RUN: clang-cc -E -dM -ffreestanding -triple=bfin-none-none < /dev/null | FileCheck -check-prefix BFIN %s &&
+// RUN: clang-cc -E -dM -ffreestanding -triple=bfin-none-none < /dev/null | FileCheck -check-prefix BFIN %s
//
// BFIN:#define BFIN 1
// BFIN:#define __ADSPBLACKFIN__ 1
@@ -232,6 +229,7 @@
// BFIN:#define __FLT_RADIX__ 2
// BFIN:#define __INT16_TYPE__ short
// BFIN:#define __INT32_TYPE__ int
+// BFIN:#define __INT64_C_SUFFIX__ LL
// BFIN:#define __INT64_TYPE__ long long int
// BFIN:#define __INT8_TYPE__ char
// BFIN:#define __INTMAX_MAX__ 9223372036854775807LL
@@ -268,7 +266,7 @@
// BFIN:#define __bfin__ 1
// BFIN:#define bfin 1
//
-// RUN: clang-cc -E -dM -ffreestanding -triple=i386-none-none < /dev/null | FileCheck -check-prefix I386 %s &&
+// RUN: clang-cc -E -dM -ffreestanding -triple=i386-none-none < /dev/null | FileCheck -check-prefix I386 %s
//
// I386:#define __CHAR_BIT__ 8
// I386:#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
@@ -302,6 +300,7 @@
// I386:#define __FLT_RADIX__ 2
// I386:#define __INT16_TYPE__ short
// I386:#define __INT32_TYPE__ int
+// I386:#define __INT64_C_SUFFIX__ LL
// I386:#define __INT64_TYPE__ long long int
// I386:#define __INT8_TYPE__ char
// I386:#define __INTMAX_MAX__ 9223372036854775807LL
@@ -344,7 +343,7 @@
// I386:#define __tune_nocona__ 1
// I386:#define i386 1
//
-// RUN: clang-cc -E -dM -ffreestanding -triple=msp430-none-none < /dev/null | FileCheck -check-prefix MSP430 %s &&
+// RUN: clang-cc -E -dM -ffreestanding -triple=msp430-none-none < /dev/null | FileCheck -check-prefix MSP430 %s
//
// MSP430:#define MSP430 1
// MSP430:#define __CHAR_BIT__ 8
@@ -378,7 +377,8 @@
// MSP430:#define __FLT_MIN__ 1.17549435e-38F
// MSP430:#define __FLT_RADIX__ 2
// MSP430:#define __INT16_TYPE__ short
-// MSP430:#define __INT32_TYPE__ long long
+// MSP430:#define __INT32_C_SUFFIX__ L
+// MSP430:#define __INT32_TYPE__ long int
// MSP430:#define __INT8_TYPE__ char
// MSP430:#define __INTMAX_MAX__ 2147483647L
// MSP430:#define __INTMAX_TYPE__ long int
@@ -408,12 +408,12 @@
// MSP430:#define __SIZE_TYPE__ unsigned int
// MSP430:#define __UINTMAX_TYPE__ long unsigned int
// MSP430:#define __USER_LABEL_PREFIX__ _
-// MSP430:#define __WCHAR_MAX__ 2147483647
+// MSP430:#define __WCHAR_MAX__ 32767
// MSP430:#define __WCHAR_TYPE__ int
// MSP430:#define __WINT_TYPE__ int
// MSP430:#define __clang__ 1
//
-// RUN: clang-cc -E -dM -ffreestanding -triple=pic16-none-none < /dev/null | FileCheck -check-prefix PIC16 %s &&
+// RUN: clang-cc -E -dM -ffreestanding -triple=pic16-none-none < /dev/null | FileCheck -check-prefix PIC16 %s
//
// PIC16:#define _CONFIG(conf) asm("CONFIG "#conf)
// PIC16:#define __CHAR_BIT__ 8
@@ -447,7 +447,8 @@
// PIC16:#define __FLT_MIN__ 1.17549435e-38F
// PIC16:#define __FLT_RADIX__ 2
// PIC16:#define __INT16_TYPE__ short
-// PIC16:#define __INT32_TYPE__ long long
+// PIC16:#define __INT32_C_SUFFIX__ L
+// PIC16:#define __INT32_TYPE__ long int
// PIC16:#define __INT8_TYPE__ char
// PIC16:#define __INTMAX_MAX__ 2147483647L
// PIC16:#define __INTMAX_TYPE__ long int
@@ -476,7 +477,7 @@
// PIC16:#define __SIZE_TYPE__ unsigned int
// PIC16:#define __UINTMAX_TYPE__ long unsigned int
// PIC16:#define __USER_LABEL_PREFIX__ _
-// PIC16:#define __WCHAR_MAX__ 2147483647
+// PIC16:#define __WCHAR_MAX__ 32767
// PIC16:#define __WCHAR_TYPE__ int
// PIC16:#define __WINT_TYPE__ int
// PIC16:#define __clang__ 1
@@ -488,7 +489,7 @@
// PIC16:#define ram __attribute__((address_space(0)))
// PIC16:#define rom __attribute__((address_space(1)))
//
-// RUN: clang-cc -E -dM -ffreestanding -triple=powerpc64-none-none < /dev/null | FileCheck -check-prefix PPC64 %s &&
+// RUN: clang-cc -E -dM -ffreestanding -triple=powerpc64-none-none -fsigned-char=0 < /dev/null | FileCheck -check-prefix PPC64 %s
//
// PPC64:#define _ARCH_PPC 1
// PPC64:#define _ARCH_PPC64 1
@@ -528,6 +529,7 @@
// PPC64:#define __FLT_RADIX__ 2
// PPC64:#define __INT16_TYPE__ short
// PPC64:#define __INT32_TYPE__ int
+// PPC64:#define __INT64_C_SUFFIX__ L
// PPC64:#define __INT64_TYPE__ long int
// PPC64:#define __INT8_TYPE__ char
// PPC64:#define __INTMAX_MAX__ 9223372036854775807L
@@ -568,7 +570,7 @@
// PPC64:#define __ppc64__ 1
// PPC64:#define __ppc__ 1
//
-// RUN: clang-cc -E -dM -ffreestanding -triple=powerpc-none-none < /dev/null | FileCheck -check-prefix PPC %s &&
+// RUN: clang-cc -E -dM -ffreestanding -triple=powerpc-none-none -fsigned-char=0 < /dev/null | FileCheck -check-prefix PPC %s
//
// PPC:#define _ARCH_PPC 1
// PPC:#define _BIG_ENDIAN 1
@@ -606,6 +608,7 @@
// PPC:#define __FLT_RADIX__ 2
// PPC:#define __INT16_TYPE__ short
// PPC:#define __INT32_TYPE__ int
+// PPC:#define __INT64_C_SUFFIX__ LL
// PPC:#define __INT64_TYPE__ long long int
// PPC:#define __INT8_TYPE__ char
// PPC:#define __INTMAX_MAX__ 9223372036854775807LL
@@ -644,7 +647,7 @@
// PPC:#define __WINT_TYPE__ int
// PPC:#define __ppc__ 1
//
-// RUN: clang-cc -E -dM -ffreestanding -triple=s390x-none-none < /dev/null | FileCheck -check-prefix S390X %s &&
+// RUN: clang-cc -E -dM -ffreestanding -triple=s390x-none-none -fsigned-char=0 < /dev/null | FileCheck -check-prefix S390X %s
//
// S390X:#define __CHAR_BIT__ 8
// S390X:#define __CHAR_UNSIGNED__ 1
@@ -679,7 +682,8 @@
// S390X:#define __FLT_RADIX__ 2
// S390X:#define __INT16_TYPE__ short
// S390X:#define __INT32_TYPE__ int
-// S390X:#define __INT64_TYPE__ long long int
+// S390X:#define __INT64_C_SUFFIX__ L
+// S390X:#define __INT64_TYPE__ long int
// S390X:#define __INT8_TYPE__ char
// S390X:#define __INTMAX_MAX__ 9223372036854775807LL
// S390X:#define __INTMAX_TYPE__ long long int
@@ -714,7 +718,7 @@
// S390X:#define __s390__ 1
// S390X:#define __s390x__ 1
//
-// RUN: clang-cc -E -dM -ffreestanding -triple=sparc-none-none < /dev/null | FileCheck -check-prefix SPARC %s &&
+// RUN: clang-cc -E -dM -ffreestanding -triple=sparc-none-none < /dev/null | FileCheck -check-prefix SPARC %s
//
// SPARC:#define __CHAR_BIT__ 8
// SPARC:#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
@@ -748,6 +752,7 @@
// SPARC:#define __FLT_RADIX__ 2
// SPARC:#define __INT16_TYPE__ short
// SPARC:#define __INT32_TYPE__ int
+// SPARC:#define __INT64_C_SUFFIX__ LL
// SPARC:#define __INT64_TYPE__ long long int
// SPARC:#define __INT8_TYPE__ char
// SPARC:#define __INTMAX_MAX__ 9223372036854775807LL
@@ -787,7 +792,7 @@
// SPARC:#define __sparcv8 1
// SPARC:#define sparc 1
//
-// RUN: clang-cc -E -dM -ffreestanding -triple=tce-none-none < /dev/null | FileCheck -check-prefix TCE %s &&
+// RUN: clang-cc -E -dM -ffreestanding -triple=tce-none-none < /dev/null | FileCheck -check-prefix TCE %s
//
// TCE:#define __CHAR_BIT__ 8
// TCE:#define __DBL_DENORM_MIN__ 1.40129846e-45F
@@ -858,7 +863,7 @@
// TCE:#define __tce__ 1
// TCE:#define tce 1
//
-// RUN: clang-cc -E -dM -ffreestanding -triple=x86_64-none-none < /dev/null | FileCheck -check-prefix X86_64 %s &&
+// RUN: clang-cc -E -dM -ffreestanding -triple=x86_64-none-none < /dev/null | FileCheck -check-prefix X86_64 %s
//
// X86_64:#define _LP64 1
// X86_64:#define __CHAR_BIT__ 8
@@ -893,6 +898,7 @@
// X86_64:#define __FLT_RADIX__ 2
// X86_64:#define __INT16_TYPE__ short
// X86_64:#define __INT32_TYPE__ int
+// X86_64:#define __INT64_C_SUFFIX__ L
// X86_64:#define __INT64_TYPE__ long int
// X86_64:#define __INT8_TYPE__ char
// X86_64:#define __INTMAX_MAX__ 9223372036854775807L
@@ -942,4 +948,3 @@
// X86_64:#define __x86_64 1
// X86_64:#define __x86_64__ 1
//
-// RUN: true
diff --git a/test/Preprocessor/line-directive.c b/test/Preprocessor/line-directive.c
index 4ebf95b..b79b1d9 100644
--- a/test/Preprocessor/line-directive.c
+++ b/test/Preprocessor/line-directive.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -fsyntax-only -verify -pedantic -fms-extensions=0 %s &&
-// RUN: clang-cc -E %s 2>&1 | grep 'blonk.c:92:2: error: #error ABC' &&
+// RUN: clang-cc -fsyntax-only -verify -pedantic -fms-extensions=0 %s
+// RUN: clang-cc -E %s 2>&1 | grep 'blonk.c:92:2: error: #error ABC'
// RUN: clang-cc -E %s 2>&1 | grep 'blonk.c:93:2: error: #error DEF'
#line 'a' // expected-error {{#line directive requires a positive integer argument}}
diff --git a/test/Preprocessor/macro-multiline.c b/test/Preprocessor/macro-multiline.c
index ba98825..9f24ae8 100644
--- a/test/Preprocessor/macro-multiline.c
+++ b/test/Preprocessor/macro-multiline.c
@@ -1,6 +1,6 @@
-// RUN: clang -E %s "-DX=A &&
-// RUN: THIS_SHOULD_NOT_EXIST_IN_THE_OUTPUT" > %t &&
-// RUN: grep "GOOD: A" %t &&
+// RUN: clang -E %s "-DX=A
+// RUN: THIS_SHOULD_NOT_EXIST_IN_THE_OUTPUT" > %t
+// RUN: grep "GOOD: A" %t
// RUN: not grep THIS_SHOULD_NOT_EXIST_IN_THE_OUTPUT %t
// rdar://6762183
diff --git a/test/Preprocessor/macro_disable.c b/test/Preprocessor/macro_disable.c
index ff861d2..f102dddd 100644
--- a/test/Preprocessor/macro_disable.c
+++ b/test/Preprocessor/macro_disable.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -E %s | grep 'a: 2 + M_0(3)(4)(5);' &&
+// RUN: clang-cc -E %s | grep 'a: 2 + M_0(3)(4)(5);'
// RUN: clang-cc -E %s | grep 'b: 4 + 4 + 3 + 2 + 1 + M_0(3)(2)(1);'
#define M_0(x) M_ ## x
diff --git a/test/Preprocessor/macro_expand.c b/test/Preprocessor/macro_expand.c
index 74b3922..a93c04e 100644
--- a/test/Preprocessor/macro_expand.c
+++ b/test/Preprocessor/macro_expand.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -E %s | grep '^A: Y$' &&
-// RUN: clang-cc -E %s | grep '^B: f()$' &&
+// RUN: clang-cc -E %s | grep '^A: Y$'
+// RUN: clang-cc -E %s | grep '^B: f()$'
// RUN: clang-cc -E %s | grep '^C: for()$'
#define X() Y
diff --git a/test/Preprocessor/macro_fn_comma_swallow.c b/test/Preprocessor/macro_fn_comma_swallow.c
index d39d4e7..c98e378 100644
--- a/test/Preprocessor/macro_fn_comma_swallow.c
+++ b/test/Preprocessor/macro_fn_comma_swallow.c
@@ -1,7 +1,7 @@
// Test the GNU comma swallowing extension.
-// RUN: clang-cc %s -E | grep 'foo{A, }' &&
-// RUN: clang-cc %s -E | grep 'fo2{A,}' &&
-// RUN: clang-cc %s -E | grep '{foo}' &&
+// RUN: clang-cc %s -E | grep 'foo{A, }'
+// RUN: clang-cc %s -E | grep 'fo2{A,}'
+// RUN: clang-cc %s -E | grep '{foo}'
#define X(Y) foo{A, Y}
X()
diff --git a/test/Preprocessor/macro_fn_disable_expand.c b/test/Preprocessor/macro_fn_disable_expand.c
index d99c018..c3b067d 100644
--- a/test/Preprocessor/macro_fn_disable_expand.c
+++ b/test/Preprocessor/macro_fn_disable_expand.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc %s -E | grep 'bar foo (2)' &&
+// RUN: clang-cc %s -E | grep 'bar foo (2)'
// RUN: clang-cc %s -E | grep 'm(ABCD)'
#define foo(x) bar x
diff --git a/test/Preprocessor/macro_fn_lparen_scan.c b/test/Preprocessor/macro_fn_lparen_scan.c
index 1056fd8..77e1fb9 100644
--- a/test/Preprocessor/macro_fn_lparen_scan.c
+++ b/test/Preprocessor/macro_fn_lparen_scan.c
@@ -1,6 +1,6 @@
-// RUN: clang-cc -E %s | grep 'noexp: foo y' &&
-// RUN: clang-cc -E %s | grep 'expand: abc' &&
-// RUN: clang-cc -E %s | grep 'noexp2: foo nonexp' &&
+// RUN: clang-cc -E %s | grep 'noexp: foo y'
+// RUN: clang-cc -E %s | grep 'expand: abc'
+// RUN: clang-cc -E %s | grep 'noexp2: foo nonexp'
// RUN: clang-cc -E %s | grep 'expand2: abc'
#define A foo
diff --git a/test/Preprocessor/macro_fn_preexpand.c b/test/Preprocessor/macro_fn_preexpand.c
index a392263..ac3b353 100644
--- a/test/Preprocessor/macro_fn_preexpand.c
+++ b/test/Preprocessor/macro_fn_preexpand.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc %s -E | grep 'pre: 1 1 X' &&
+// RUN: clang-cc %s -E | grep 'pre: 1 1 X'
// RUN: clang-cc %s -E | grep 'nopre: 1A(X)'
/* Preexpansion of argument. */
diff --git a/test/Preprocessor/macro_fn_varargs_iso.c b/test/Preprocessor/macro_fn_varargs_iso.c
index 78ad212..b1e5c52 100644
--- a/test/Preprocessor/macro_fn_varargs_iso.c
+++ b/test/Preprocessor/macro_fn_varargs_iso.c
@@ -1,6 +1,6 @@
-// RUN: clang-cc -E %s | grep 'foo{a, b, c, d, e}' &&
-// RUN: clang-cc -E %s | grep 'foo2{d, C, B}' &&
+// RUN: clang-cc -E %s | grep 'foo{a, b, c, d, e}'
+// RUN: clang-cc -E %s | grep 'foo2{d, C, B}'
// RUN: clang-cc -E %s | grep 'foo2{d,e, C, B}'
#define va1(...) foo{a, __VA_ARGS__, e}
diff --git a/test/Preprocessor/macro_fn_varargs_named.c b/test/Preprocessor/macro_fn_varargs_named.c
index c2841b1..94770a2 100644
--- a/test/Preprocessor/macro_fn_varargs_named.c
+++ b/test/Preprocessor/macro_fn_varargs_named.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -E %s | grep '^a: x$' &&
-// RUN: clang-cc -E %s | grep '^b: x y, z,h$' &&
+// RUN: clang-cc -E %s | grep '^a: x$'
+// RUN: clang-cc -E %s | grep '^b: x y, z,h$'
// RUN: clang-cc -E %s | grep '^c: foo(x)$'
#define A(b, c...) b c
diff --git a/test/Preprocessor/macro_paste_c_block_comment.c b/test/Preprocessor/macro_paste_c_block_comment.c
index 86f8124..2e5a214 100644
--- a/test/Preprocessor/macro_paste_c_block_comment.c
+++ b/test/Preprocessor/macro_paste_c_block_comment.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc %s -Eonly 2>&1 | grep error &&
-// RUN: clang-cc %s -Eonly 2>&1 | not grep unterminated &&
+// RUN: clang-cc %s -Eonly 2>&1 | grep error
+// RUN: clang-cc %s -Eonly 2>&1 | not grep unterminated
// RUN: clang-cc %s -Eonly 2>&1 | not grep scratch
#define COMM / ## *
diff --git a/test/Preprocessor/macro_paste_commaext.c b/test/Preprocessor/macro_paste_commaext.c
index e98849b..fe9c92a 100644
--- a/test/Preprocessor/macro_paste_commaext.c
+++ b/test/Preprocessor/macro_paste_commaext.c
@@ -1,7 +1,7 @@
-// RUN: clang-cc %s -E | grep 'V);' &&
-// RUN: clang-cc %s -E | grep 'W, 1, 2);' &&
-// RUN: clang-cc %s -E | grep 'X, 1, 2);' &&
-// RUN: clang-cc %s -E | grep 'Y, );' &&
+// RUN: clang-cc %s -E | grep 'V);'
+// RUN: clang-cc %s -E | grep 'W, 1, 2);'
+// RUN: clang-cc %s -E | grep 'X, 1, 2);'
+// RUN: clang-cc %s -E | grep 'Y, );'
// RUN: clang-cc %s -E | grep 'Z, );'
#define debug(format, ...) format, ## __VA_ARGS__)
diff --git a/test/Preprocessor/macro_paste_empty.c b/test/Preprocessor/macro_paste_empty.c
index 75504bc..41843cd 100644
--- a/test/Preprocessor/macro_paste_empty.c
+++ b/test/Preprocessor/macro_paste_empty.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -E %s | grep 'a:Y' &&
-// RUN: clang-cc -E %s | grep 'b:Y' &&
+// RUN: clang-cc -E %s | grep 'a:Y'
+// RUN: clang-cc -E %s | grep 'b:Y'
// RUN: clang-cc -E %s | grep 'c:YY'
#define FOO(X) X ## Y
diff --git a/test/Preprocessor/macro_paste_hard.c b/test/Preprocessor/macro_paste_hard.c
index 25b6c19..adc447c 100644
--- a/test/Preprocessor/macro_paste_hard.c
+++ b/test/Preprocessor/macro_paste_hard.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -E %s | grep '1: aaab 2' &&
-// RUN: clang-cc -E %s | grep '2: 2 baaa' &&
+// RUN: clang-cc -E %s | grep '1: aaab 2'
+// RUN: clang-cc -E %s | grep '2: 2 baaa'
// RUN: clang-cc -E %s | grep '3: 2 xx'
#define a(n) aaa ## n
diff --git a/test/Preprocessor/macro_rescan.c b/test/Preprocessor/macro_rescan.c
index 17b4dc2..c6a807a 100644
--- a/test/Preprocessor/macro_rescan.c
+++ b/test/Preprocessor/macro_rescan.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -E %s | grep 'ei_1 = (17 +1);' &&
+// RUN: clang-cc -E %s | grep 'ei_1 = (17 +1);'
// RUN: clang-cc -E %s | grep 'ei_2 = (M1)(17);'
#define M1(a) (a+1)
diff --git a/test/Preprocessor/macro_rescan2.c b/test/Preprocessor/macro_rescan2.c
index 6914ae0..9c198c9 100644
--- a/test/Preprocessor/macro_rescan2.c
+++ b/test/Preprocessor/macro_rescan2.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc %s -E | grep 'a: 2\*f(9)' &&
+// RUN: clang-cc %s -E | grep 'a: 2\*f(9)'
// RUN: clang-cc %s -E | grep 'b: 2\*9\*g'
#define f(a) a*g
diff --git a/test/Preprocessor/objc-pp.m b/test/Preprocessor/objc-pp.m
index 4ab2f07..977789e 100644
--- a/test/Preprocessor/objc-pp.m
+++ b/test/Preprocessor/objc-pp.m
@@ -1,4 +1,4 @@
// RUN: clang-cc %s -fsyntax-only -verify -pedantic
-#import <limits.h> // no warning on #import in objc mode.
+#import <stdint.h> // no warning on #import in objc mode.
diff --git a/test/Preprocessor/optimize.c b/test/Preprocessor/optimize.c
index 46df2a6..973d27f 100644
--- a/test/Preprocessor/optimize.c
+++ b/test/Preprocessor/optimize.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -Eonly %s -DOPT_O2 -O2 -verify &&
+// RUN: clang-cc -Eonly %s -DOPT_O2 -O2 -verify
#ifdef OPT_O2
#ifndef __OPTIMIZE__
#error "__OPTIMIZE__ not defined"
@@ -8,7 +8,7 @@
#endif
#endif
-// RUN: clang-cc -Eonly %s -DOPT_O0 -O0 -verify &&
+// RUN: clang-cc -Eonly %s -DOPT_O0 -O0 -verify
#ifdef OPT_O0
#ifdef __OPTIMIZE__
#error "__OPTIMIZE__ defined"
diff --git a/test/Preprocessor/pic.c b/test/Preprocessor/pic.c
index 1cddaa1..b8068fa 100644
--- a/test/Preprocessor/pic.c
+++ b/test/Preprocessor/pic.c
@@ -1,10 +1,9 @@
-// RUN: clang -ccc-host-triple i386-unknown-unknown -static -dM -E -o %t %s &&
-// RUN: grep '#define __PIC__' %t | count 0 &&
-// RUN: grep '#define __pic__' %t | count 0 &&
-// RUN: clang -ccc-host-triple i386-unknown-unknown -fpic -dM -E -o %t %s &&
-// RUN: grep '#define __PIC__ 1' %t | count 1 &&
-// RUN: grep '#define __pic__ 1' %t | count 1 &&
-// RUN: clang -ccc-host-triple i386-unknown-unknown -fPIC -dM -E -o %t %s &&
-// RUN: grep '#define __PIC__ 2' %t | count 1 &&
-// RUN: grep '#define __pic__ 2' %t | count 1 &&
-// RUN: true
+// RUN: clang -ccc-host-triple i386-unknown-unknown -static -dM -E -o %t %s
+// RUN: grep '#define __PIC__' %t | count 0
+// RUN: grep '#define __pic__' %t | count 0
+// RUN: clang -ccc-host-triple i386-unknown-unknown -fpic -dM -E -o %t %s
+// RUN: grep '#define __PIC__ 1' %t | count 1
+// RUN: grep '#define __pic__ 1' %t | count 1
+// RUN: clang -ccc-host-triple i386-unknown-unknown -fPIC -dM -E -o %t %s
+// RUN: grep '#define __PIC__ 2' %t | count 1
+// RUN: grep '#define __pic__ 2' %t | count 1
diff --git a/test/Preprocessor/pragma_unknown.c b/test/Preprocessor/pragma_unknown.c
index 16bf43b..c0355e7 100644
--- a/test/Preprocessor/pragma_unknown.c
+++ b/test/Preprocessor/pragma_unknown.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -E %s | grep '#pragma foo bar' &&
+// RUN: clang-cc -E %s | grep '#pragma foo bar'
// RUN: clang-cc -fsyntax-only -Wunknown-pragmas -verify %s
// GCC doesn't expand macro args for unrecognized pragmas.
diff --git a/test/Preprocessor/print_line_track.c b/test/Preprocessor/print_line_track.c
index 539433d..553c186 100644
--- a/test/Preprocessor/print_line_track.c
+++ b/test/Preprocessor/print_line_track.c
@@ -1,7 +1,7 @@
-/* RUN: clang-cc -E %s | grep 'a 3' &&
- * RUN: clang-cc -E %s | grep 'b 16' &&
- * RUN: clang-cc -E -P %s | grep 'a 3' &&
- * RUN: clang-cc -E -P %s | grep 'b 16' &&
+/* RUN: clang-cc -E %s | grep 'a 3'
+ * RUN: clang-cc -E %s | grep 'b 16'
+ * RUN: clang-cc -E -P %s | grep 'a 3'
+ * RUN: clang-cc -E -P %s | grep 'b 16'
* RUN: clang-cc -E %s | not grep '# 0 '
* PR1848
* PR3437
diff --git a/test/Preprocessor/stdint.c b/test/Preprocessor/stdint.c
index d47b51d..641f704 100644
--- a/test/Preprocessor/stdint.c
+++ b/test/Preprocessor/stdint.c
@@ -1,20 +1,20 @@
-// RUN: clang-cc -E -ffreestanding -triple=arm-none-none %s | FileCheck -check-prefix ARM %s &&
+// RUN: clang-cc -E -ffreestanding -triple=arm-none-none %s | FileCheck -check-prefix ARM %s
//
-// ARM:typedef long long int int64_t;
+// ARM:typedef signed long long int int64_t;
// ARM:typedef unsigned long long int uint64_t;
// ARM:typedef int64_t int_least64_t;
// ARM:typedef uint64_t uint_least64_t;
// ARM:typedef int64_t int_fast64_t;
// ARM:typedef uint64_t uint_fast64_t;
//
-// ARM:typedef int int32_t;
+// ARM:typedef signed int int32_t;
// ARM:typedef unsigned int uint32_t;
// ARM:typedef int32_t int_least32_t;
// ARM:typedef uint32_t uint_least32_t;
// ARM:typedef int32_t int_fast32_t;
// ARM:typedef uint32_t uint_fast32_t;
//
-// ARM:typedef short int16_t;
+// ARM:typedef signed short int16_t;
// ARM:typedef unsigned short uint16_t;
// ARM:typedef int16_t int_least16_t;
// ARM:typedef uint16_t uint_least16_t;
@@ -35,22 +35,22 @@
// ARM:typedef long long unsigned int uintmax_t;
//
// ARM:INT8_MAX_ 127
-// ARM:INT8_MIN_ (-128)
+// ARM:INT8_MIN_ (-127 -1)
// ARM:UINT8_MAX_ 255
-// ARM:INT_LEAST8_MIN_ (-128)
+// ARM:INT_LEAST8_MIN_ (-127 -1)
// ARM:INT_LEAST8_MAX_ 127
// ARM:UINT_LEAST8_MAX_ 255
-// ARM:INT_FAST8_MIN_ (-128)
+// ARM:INT_FAST8_MIN_ (-127 -1)
// ARM:INT_FAST8_MAX_ 127
// ARM:UINT_FAST8_MAX_ 255
//
// ARM:INT16_MAX_ 32767
-// ARM:INT16_MIN_ (-32768)
+// ARM:INT16_MIN_ (-32767 -1)
// ARM:UINT16_MAX_ 65535
-// ARM:INT_LEAST16_MIN_ (-32768)
+// ARM:INT_LEAST16_MIN_ (-32767 -1)
// ARM:INT_LEAST16_MAX_ 32767
// ARM:UINT_LEAST16_MAX_ 65535
-// ARM:INT_FAST16_MIN_ (-32768)
+// ARM:INT_FAST16_MIN_ (-32767 -1)
// ARM:INT_FAST16_MAX_ 32767
// ARM:UINT_FAST16_MAX_ 65535
//
@@ -93,36 +93,36 @@
// ARM:WCHAR_MAX_ 2147483647
// ARM:WCHAR_MIN_ (-2147483647 -1)
//
-// ARM:INT8_C_(0) (0)
-// ARM:UINT8_C_(0) (0U)
-// ARM:INT16_C_(0) (0)
-// ARM:UINT16_C_(0) (0U)
-// ARM:INT32_C_(0) (0)
-// ARM:UINT32_C_(0) (0U)
-// ARM:INT64_C_(0) (0LL)
-// ARM:UINT64_C_(0) (0ULL)
+// ARM:INT8_C_(0) 0
+// ARM:UINT8_C_(0) 0U
+// ARM:INT16_C_(0) 0
+// ARM:UINT16_C_(0) 0U
+// ARM:INT32_C_(0) 0
+// ARM:UINT32_C_(0) 0U
+// ARM:INT64_C_(0) 0LL
+// ARM:UINT64_C_(0) 0ULL
//
-// ARM:INTMAX_C_(0) (0LL)
-// ARM:UINTMAX_C_(0) (0ULL)
+// ARM:INTMAX_C_(0) 0LL
+// ARM:UINTMAX_C_(0) 0ULL
//
//
-// RUN: clang-cc -E -ffreestanding -triple=bfin-none-none %s | FileCheck -check-prefix BFIN %s &&
+// RUN: clang-cc -E -ffreestanding -triple=bfin-none-none %s | FileCheck -check-prefix BFIN %s
//
-// BFIN:typedef long long int int64_t;
+// BFIN:typedef signed long long int int64_t;
// BFIN:typedef unsigned long long int uint64_t;
// BFIN:typedef int64_t int_least64_t;
// BFIN:typedef uint64_t uint_least64_t;
// BFIN:typedef int64_t int_fast64_t;
// BFIN:typedef uint64_t uint_fast64_t;
//
-// BFIN:typedef int int32_t;
+// BFIN:typedef signed int int32_t;
// BFIN:typedef unsigned int uint32_t;
// BFIN:typedef int32_t int_least32_t;
// BFIN:typedef uint32_t uint_least32_t;
// BFIN:typedef int32_t int_fast32_t;
// BFIN:typedef uint32_t uint_fast32_t;
//
-// BFIN:typedef short int16_t;
+// BFIN:typedef signed short int16_t;
// BFIN:typedef unsigned short uint16_t;
// BFIN:typedef int16_t int_least16_t;
// BFIN:typedef uint16_t uint_least16_t;
@@ -143,22 +143,22 @@
// BFIN:typedef long long unsigned int uintmax_t;
//
// BFIN:INT8_MAX_ 127
-// BFIN:INT8_MIN_ (-128)
+// BFIN:INT8_MIN_ (-127 -1)
// BFIN:UINT8_MAX_ 255
-// BFIN:INT_LEAST8_MIN_ (-128)
+// BFIN:INT_LEAST8_MIN_ (-127 -1)
// BFIN:INT_LEAST8_MAX_ 127
// BFIN:UINT_LEAST8_MAX_ 255
-// BFIN:INT_FAST8_MIN_ (-128)
+// BFIN:INT_FAST8_MIN_ (-127 -1)
// BFIN:INT_FAST8_MAX_ 127
// BFIN:UINT_FAST8_MAX_ 255
//
// BFIN:INT16_MAX_ 32767
-// BFIN:INT16_MIN_ (-32768)
+// BFIN:INT16_MIN_ (-32767 -1)
// BFIN:UINT16_MAX_ 65535
-// BFIN:INT_LEAST16_MIN_ (-32768)
+// BFIN:INT_LEAST16_MIN_ (-32767 -1)
// BFIN:INT_LEAST16_MAX_ 32767
// BFIN:UINT_LEAST16_MAX_ 65535
-// BFIN:INT_FAST16_MIN_ (-32768)
+// BFIN:INT_FAST16_MIN_ (-32767 -1)
// BFIN:INT_FAST16_MAX_ 32767
// BFIN:UINT_FAST16_MAX_ 65535
//
@@ -201,36 +201,36 @@
// BFIN:WCHAR_MAX_ 2147483647
// BFIN:WCHAR_MIN_ (-2147483647 -1)
//
-// BFIN:INT8_C_(0) (0)
-// BFIN:UINT8_C_(0) (0U)
-// BFIN:INT16_C_(0) (0)
-// BFIN:UINT16_C_(0) (0U)
-// BFIN:INT32_C_(0) (0)
-// BFIN:UINT32_C_(0) (0U)
-// BFIN:INT64_C_(0) (0LL)
-// BFIN:UINT64_C_(0) (0ULL)
+// BFIN:INT8_C_(0) 0
+// BFIN:UINT8_C_(0) 0U
+// BFIN:INT16_C_(0) 0
+// BFIN:UINT16_C_(0) 0U
+// BFIN:INT32_C_(0) 0
+// BFIN:UINT32_C_(0) 0U
+// BFIN:INT64_C_(0) 0LL
+// BFIN:UINT64_C_(0) 0ULL
//
-// BFIN:INTMAX_C_(0) (0LL)
-// BFIN:UINTMAX_C_(0) (0ULL)
+// BFIN:INTMAX_C_(0) 0LL
+// BFIN:UINTMAX_C_(0) 0ULL
//
//
-// RUN: clang-cc -E -ffreestanding -triple=i386-none-none %s | FileCheck -check-prefix I386 %s &&
+// RUN: clang-cc -E -ffreestanding -triple=i386-none-none %s | FileCheck -check-prefix I386 %s
//
-// I386:typedef long long int int64_t;
+// I386:typedef signed long long int int64_t;
// I386:typedef unsigned long long int uint64_t;
// I386:typedef int64_t int_least64_t;
// I386:typedef uint64_t uint_least64_t;
// I386:typedef int64_t int_fast64_t;
// I386:typedef uint64_t uint_fast64_t;
//
-// I386:typedef int int32_t;
+// I386:typedef signed int int32_t;
// I386:typedef unsigned int uint32_t;
// I386:typedef int32_t int_least32_t;
// I386:typedef uint32_t uint_least32_t;
// I386:typedef int32_t int_fast32_t;
// I386:typedef uint32_t uint_fast32_t;
//
-// I386:typedef short int16_t;
+// I386:typedef signed short int16_t;
// I386:typedef unsigned short uint16_t;
// I386:typedef int16_t int_least16_t;
// I386:typedef uint16_t uint_least16_t;
@@ -251,22 +251,22 @@
// I386:typedef long long unsigned int uintmax_t;
//
// I386:INT8_MAX_ 127
-// I386:INT8_MIN_ (-128)
+// I386:INT8_MIN_ (-127 -1)
// I386:UINT8_MAX_ 255
-// I386:INT_LEAST8_MIN_ (-128)
+// I386:INT_LEAST8_MIN_ (-127 -1)
// I386:INT_LEAST8_MAX_ 127
// I386:UINT_LEAST8_MAX_ 255
-// I386:INT_FAST8_MIN_ (-128)
+// I386:INT_FAST8_MIN_ (-127 -1)
// I386:INT_FAST8_MAX_ 127
// I386:UINT_FAST8_MAX_ 255
//
// I386:INT16_MAX_ 32767
-// I386:INT16_MIN_ (-32768)
+// I386:INT16_MIN_ (-32767 -1)
// I386:UINT16_MAX_ 65535
-// I386:INT_LEAST16_MIN_ (-32768)
+// I386:INT_LEAST16_MIN_ (-32767 -1)
// I386:INT_LEAST16_MAX_ 32767
// I386:UINT_LEAST16_MAX_ 65535
-// I386:INT_FAST16_MIN_ (-32768)
+// I386:INT_FAST16_MIN_ (-32767 -1)
// I386:INT_FAST16_MAX_ 32767
// I386:UINT_FAST16_MAX_ 65535
//
@@ -309,28 +309,28 @@
// I386:WCHAR_MAX_ 2147483647
// I386:WCHAR_MIN_ (-2147483647 -1)
//
-// I386:INT8_C_(0) (0)
-// I386:UINT8_C_(0) (0U)
-// I386:INT16_C_(0) (0)
-// I386:UINT16_C_(0) (0U)
-// I386:INT32_C_(0) (0)
-// I386:UINT32_C_(0) (0U)
-// I386:INT64_C_(0) (0LL)
-// I386:UINT64_C_(0) (0ULL)
+// I386:INT8_C_(0) 0
+// I386:UINT8_C_(0) 0U
+// I386:INT16_C_(0) 0
+// I386:UINT16_C_(0) 0U
+// I386:INT32_C_(0) 0
+// I386:UINT32_C_(0) 0U
+// I386:INT64_C_(0) 0LL
+// I386:UINT64_C_(0) 0ULL
//
-// I386:INTMAX_C_(0) (0LL)
-// I386:UINTMAX_C_(0) (0ULL)
+// I386:INTMAX_C_(0) 0LL
+// I386:UINTMAX_C_(0) 0ULL
//
-// RUN: clang-cc -E -ffreestanding -triple=msp430-none-none %s | FileCheck -check-prefix MSP430 %s &&
+// RUN: clang-cc -E -ffreestanding -triple=msp430-none-none %s | FileCheck -check-prefix MSP430 %s
//
-// MSP430:typedef long long int32_t;
-// MSP430:typedef unsigned long long uint32_t;
+// MSP430:typedef signed long int int32_t;
+// MSP430:typedef unsigned long int uint32_t;
// MSP430:typedef int32_t int_least32_t;
// MSP430:typedef uint32_t uint_least32_t;
// MSP430:typedef int32_t int_fast32_t;
// MSP430:typedef uint32_t uint_fast32_t;
//
-// MSP430:typedef short int16_t;
+// MSP430:typedef signed short int16_t;
// MSP430:typedef unsigned short uint16_t;
// MSP430:typedef int16_t int_least16_t;
// MSP430:typedef uint16_t uint_least16_t;
@@ -351,34 +351,34 @@
// MSP430:typedef long unsigned int uintmax_t;
//
// MSP430:INT8_MAX_ 127
-// MSP430:INT8_MIN_ (-128)
+// MSP430:INT8_MIN_ (-127 -1)
// MSP430:UINT8_MAX_ 255
-// MSP430:INT_LEAST8_MIN_ (-128)
+// MSP430:INT_LEAST8_MIN_ (-127 -1)
// MSP430:INT_LEAST8_MAX_ 127
// MSP430:UINT_LEAST8_MAX_ 255
-// MSP430:INT_FAST8_MIN_ (-128)
+// MSP430:INT_FAST8_MIN_ (-127 -1)
// MSP430:INT_FAST8_MAX_ 127
// MSP430:UINT_FAST8_MAX_ 255
//
// MSP430:INT16_MAX_ 32767
-// MSP430:INT16_MIN_ (-32768)
+// MSP430:INT16_MIN_ (-32767 -1)
// MSP430:UINT16_MAX_ 65535
-// MSP430:INT_LEAST16_MIN_ (-32768)
+// MSP430:INT_LEAST16_MIN_ (-32767 -1)
// MSP430:INT_LEAST16_MAX_ 32767
// MSP430:UINT_LEAST16_MAX_ 65535
-// MSP430:INT_FAST16_MIN_ (-32768)
+// MSP430:INT_FAST16_MIN_ (-32767 -1)
// MSP430:INT_FAST16_MAX_ 32767
// MSP430:UINT_FAST16_MAX_ 65535
//
-// MSP430:INT32_MAX_ 2147483647
-// MSP430:INT32_MIN_ (-2147483647 -1)
-// MSP430:UINT32_MAX_ 4294967295U
-// MSP430:INT_LEAST32_MIN_ (-2147483647 -1)
-// MSP430:INT_LEAST32_MAX_ 2147483647
-// MSP430:UINT_LEAST32_MAX_ 4294967295U
-// MSP430:INT_FAST32_MIN_ (-2147483647 -1)
-// MSP430:INT_FAST32_MAX_ 2147483647
-// MSP430:UINT_FAST32_MAX_ 4294967295U
+// MSP430:INT32_MAX_ 2147483647L
+// MSP430:INT32_MIN_ (-2147483647L -1)
+// MSP430:UINT32_MAX_ 4294967295UL
+// MSP430:INT_LEAST32_MIN_ (-2147483647L -1)
+// MSP430:INT_LEAST32_MAX_ 2147483647L
+// MSP430:UINT_LEAST32_MAX_ 4294967295UL
+// MSP430:INT_FAST32_MIN_ (-2147483647L -1)
+// MSP430:INT_FAST32_MAX_ 2147483647L
+// MSP430:UINT_FAST32_MAX_ 4294967295UL
//
// MSP430:INT64_MAX_ INT64_MAX
// MSP430:INT64_MIN_ INT64_MIN
@@ -390,10 +390,10 @@
// MSP430:INT_FAST64_MAX_ INT_FAST64_MAX
// MSP430:UINT_FAST64_MAX_ UINT_FAST64_MAX
//
-// MSP430:INTPTR_MIN_ (-32768)
+// MSP430:INTPTR_MIN_ (-32767 -1)
// MSP430:INTPTR_MAX_ 32767
// MSP430:UINTPTR_MAX_ 65535
-// MSP430:PTRDIFF_MIN_ (-32768)
+// MSP430:PTRDIFF_MIN_ (-32767 -1)
// MSP430:PTRDIFF_MAX_ 32767
// MSP430:SIZE_MAX_ 65535
//
@@ -401,36 +401,36 @@
// MSP430:INTMAX_MAX_ 2147483647L
// MSP430:UINTMAX_MAX_ (2147483647L*2ULL +1ULL)
//
-// MSP430:SIG_ATOMIC_MIN_ (-2147483647 -1)
-// MSP430:SIG_ATOMIC_MAX_ 2147483647
-// MSP430:WINT_MIN_ (-2147483647 -1)
-// MSP430:WINT_MAX_ 2147483647
+// MSP430:SIG_ATOMIC_MIN_ (-2147483647L -1)
+// MSP430:SIG_ATOMIC_MAX_ 2147483647L
+// MSP430:WINT_MIN_ (-2147483647L -1)
+// MSP430:WINT_MAX_ 2147483647L
//
-// MSP430:WCHAR_MAX_ 2147483647
-// MSP430:WCHAR_MIN_ (-2147483647 -1)
+// MSP430:WCHAR_MAX_ 32767
+// MSP430:WCHAR_MIN_ (-32767 -1)
//
-// MSP430:INT8_C_(0) (0)
-// MSP430:UINT8_C_(0) (0U)
-// MSP430:INT16_C_(0) (0)
-// MSP430:UINT16_C_(0) (0U)
-// MSP430:INT32_C_(0) (0)
-// MSP430:UINT32_C_(0) (0U)
+// MSP430:INT8_C_(0) 0
+// MSP430:UINT8_C_(0) 0U
+// MSP430:INT16_C_(0) 0
+// MSP430:UINT16_C_(0) 0U
+// MSP430:INT32_C_(0) 0L
+// MSP430:UINT32_C_(0) 0UL
// MSP430:INT64_C_(0) INT64_C(0)
// MSP430:UINT64_C_(0) UINT64_C(0)
//
-// MSP430:INTMAX_C_(0) (0LL)
-// MSP430:UINTMAX_C_(0) (0ULL)
+// MSP430:INTMAX_C_(0) 0LL
+// MSP430:UINTMAX_C_(0) 0ULL
//
-// RUN: clang-cc -E -ffreestanding -triple=pic16-none-none %s | FileCheck -check-prefix PIC16 %s &&
+// RUN: clang-cc -E -ffreestanding -triple=pic16-none-none %s | FileCheck -check-prefix PIC16 %s
//
-// PIC16:typedef long long int32_t;
-// PIC16:typedef unsigned long long uint32_t;
+// PIC16:typedef signed long int int32_t;
+// PIC16:typedef unsigned long int uint32_t;
// PIC16:typedef int32_t int_least32_t;
// PIC16:typedef uint32_t uint_least32_t;
// PIC16:typedef int32_t int_fast32_t;
// PIC16:typedef uint32_t uint_fast32_t;
//
-// PIC16:typedef short int16_t;
+// PIC16:typedef signed short int16_t;
// PIC16:typedef unsigned short uint16_t;
// PIC16:typedef int16_t int_least16_t;
// PIC16:typedef uint16_t uint_least16_t;
@@ -451,34 +451,34 @@
// PIC16:typedef long unsigned int uintmax_t;
//
// PIC16:INT8_MAX_ 127
-// PIC16:INT8_MIN_ (-128)
+// PIC16:INT8_MIN_ (-127 -1)
// PIC16:UINT8_MAX_ 255
-// PIC16:INT_LEAST8_MIN_ (-128)
+// PIC16:INT_LEAST8_MIN_ (-127 -1)
// PIC16:INT_LEAST8_MAX_ 127
// PIC16:UINT_LEAST8_MAX_ 255
-// PIC16:INT_FAST8_MIN_ (-128)
+// PIC16:INT_FAST8_MIN_ (-127 -1)
// PIC16:INT_FAST8_MAX_ 127
// PIC16:UINT_FAST8_MAX_ 255
//
// PIC16:INT16_MAX_ 32767
-// PIC16:INT16_MIN_ (-32768)
+// PIC16:INT16_MIN_ (-32767 -1)
// PIC16:UINT16_MAX_ 65535
-// PIC16:INT_LEAST16_MIN_ (-32768)
+// PIC16:INT_LEAST16_MIN_ (-32767 -1)
// PIC16:INT_LEAST16_MAX_ 32767
// PIC16:UINT_LEAST16_MAX_ 65535
-// PIC16:INT_FAST16_MIN_ (-32768)
+// PIC16:INT_FAST16_MIN_ (-32767 -1)
// PIC16:INT_FAST16_MAX_ 32767
// PIC16:UINT_FAST16_MAX_ 65535
//
-// PIC16:INT32_MAX_ 2147483647
-// PIC16:INT32_MIN_ (-2147483647 -1)
-// PIC16:UINT32_MAX_ 4294967295U
-// PIC16:INT_LEAST32_MIN_ (-2147483647 -1)
-// PIC16:INT_LEAST32_MAX_ 2147483647
-// PIC16:UINT_LEAST32_MAX_ 4294967295U
-// PIC16:INT_FAST32_MIN_ (-2147483647 -1)
-// PIC16:INT_FAST32_MAX_ 2147483647
-// PIC16:UINT_FAST32_MAX_ 4294967295U
+// PIC16:INT32_MAX_ 2147483647L
+// PIC16:INT32_MIN_ (-2147483647L -1)
+// PIC16:UINT32_MAX_ 4294967295UL
+// PIC16:INT_LEAST32_MIN_ (-2147483647L -1)
+// PIC16:INT_LEAST32_MAX_ 2147483647L
+// PIC16:UINT_LEAST32_MAX_ 4294967295UL
+// PIC16:INT_FAST32_MIN_ (-2147483647L -1)
+// PIC16:INT_FAST32_MAX_ 2147483647L
+// PIC16:UINT_FAST32_MAX_ 4294967295UL
//
// PIC16:INT64_MAX_ INT64_MAX
// PIC16:INT64_MIN_ INT64_MIN
@@ -490,10 +490,10 @@
// PIC16:INT_FAST64_MAX_ INT_FAST64_MAX
// PIC16:UINT_FAST64_MAX_ UINT_FAST64_MAX
//
-// PIC16:INTPTR_MIN_ (-32768)
+// PIC16:INTPTR_MIN_ (-32767 -1)
// PIC16:INTPTR_MAX_ 32767
// PIC16:UINTPTR_MAX_ 65535
-// PIC16:PTRDIFF_MIN_ (-32768)
+// PIC16:PTRDIFF_MIN_ (-32767 -1)
// PIC16:PTRDIFF_MAX_ 32767
// PIC16:SIZE_MAX_ 65535
//
@@ -501,43 +501,43 @@
// PIC16:INTMAX_MAX_ 2147483647L
// PIC16:UINTMAX_MAX_ (2147483647L*2ULL +1ULL)
//
-// PIC16:SIG_ATOMIC_MIN_ (-2147483647 -1)
-// PIC16:SIG_ATOMIC_MAX_ 2147483647
-// PIC16:WINT_MIN_ (-2147483647 -1)
-// PIC16:WINT_MAX_ 2147483647
+// PIC16:SIG_ATOMIC_MIN_ (-2147483647L -1)
+// PIC16:SIG_ATOMIC_MAX_ 2147483647L
+// PIC16:WINT_MIN_ (-2147483647L -1)
+// PIC16:WINT_MAX_ 2147483647L
//
-// PIC16:WCHAR_MAX_ 2147483647
-// PIC16:WCHAR_MIN_ (-2147483647 -1)
+// PIC16:WCHAR_MAX_ 32767
+// PIC16:WCHAR_MIN_ (-32767 -1)
//
-// PIC16:INT8_C_(0) (0)
-// PIC16:UINT8_C_(0) (0U)
-// PIC16:INT16_C_(0) (0)
-// PIC16:UINT16_C_(0) (0U)
-// PIC16:INT32_C_(0) (0)
-// PIC16:UINT32_C_(0) (0U)
+// PIC16:INT8_C_(0) 0
+// PIC16:UINT8_C_(0) 0U
+// PIC16:INT16_C_(0) 0
+// PIC16:UINT16_C_(0) 0U
+// PIC16:INT32_C_(0) 0L
+// PIC16:UINT32_C_(0) 0UL
// PIC16:INT64_C_(0) INT64_C(0)
// PIC16:UINT64_C_(0) UINT64_C(0)
//
-// PIC16:INTMAX_C_(0) (0LL)
-// PIC16:UINTMAX_C_(0) (0ULL)
+// PIC16:INTMAX_C_(0) 0LL
+// PIC16:UINTMAX_C_(0) 0ULL
//
-// RUN: clang-cc -E -ffreestanding -triple=powerpc64-none-none %s | FileCheck -check-prefix PPC64 %s &&
+// RUN: clang-cc -E -ffreestanding -triple=powerpc64-none-none %s | FileCheck -check-prefix PPC64 %s
//
-// PPC64:typedef long int int64_t;
+// PPC64:typedef signed long int int64_t;
// PPC64:typedef unsigned long int uint64_t;
// PPC64:typedef int64_t int_least64_t;
// PPC64:typedef uint64_t uint_least64_t;
// PPC64:typedef int64_t int_fast64_t;
// PPC64:typedef uint64_t uint_fast64_t;
//
-// PPC64:typedef int int32_t;
+// PPC64:typedef signed int int32_t;
// PPC64:typedef unsigned int uint32_t;
// PPC64:typedef int32_t int_least32_t;
// PPC64:typedef uint32_t uint_least32_t;
// PPC64:typedef int32_t int_fast32_t;
// PPC64:typedef uint32_t uint_fast32_t;
//
-// PPC64:typedef short int16_t;
+// PPC64:typedef signed short int16_t;
// PPC64:typedef unsigned short uint16_t;
// PPC64:typedef int16_t int_least16_t;
// PPC64:typedef uint16_t uint_least16_t;
@@ -558,22 +558,22 @@
// PPC64:typedef long unsigned int uintmax_t;
//
// PPC64:INT8_MAX_ 127
-// PPC64:INT8_MIN_ (-128)
+// PPC64:INT8_MIN_ (-127 -1)
// PPC64:UINT8_MAX_ 255
-// PPC64:INT_LEAST8_MIN_ (-128)
+// PPC64:INT_LEAST8_MIN_ (-127 -1)
// PPC64:INT_LEAST8_MAX_ 127
// PPC64:UINT_LEAST8_MAX_ 255
-// PPC64:INT_FAST8_MIN_ (-128)
+// PPC64:INT_FAST8_MIN_ (-127 -1)
// PPC64:INT_FAST8_MAX_ 127
// PPC64:UINT_FAST8_MAX_ 255
//
// PPC64:INT16_MAX_ 32767
-// PPC64:INT16_MIN_ (-32768)
+// PPC64:INT16_MIN_ (-32767 -1)
// PPC64:UINT16_MAX_ 65535
-// PPC64:INT_LEAST16_MIN_ (-32768)
+// PPC64:INT_LEAST16_MIN_ (-32767 -1)
// PPC64:INT_LEAST16_MAX_ 32767
// PPC64:UINT_LEAST16_MAX_ 65535
-// PPC64:INT_FAST16_MIN_ (-32768)
+// PPC64:INT_FAST16_MIN_ (-32767 -1)
// PPC64:INT_FAST16_MAX_ 32767
// PPC64:UINT_FAST16_MAX_ 65535
//
@@ -587,22 +587,22 @@
// PPC64:INT_FAST32_MAX_ 2147483647
// PPC64:UINT_FAST32_MAX_ 4294967295U
//
-// PPC64:INT64_MAX_ 9223372036854775807LL
-// PPC64:INT64_MIN_ (-9223372036854775807LL -1)
-// PPC64:UINT64_MAX_ 18446744073709551615ULL
-// PPC64:INT_LEAST64_MIN_ (-9223372036854775807LL -1)
-// PPC64:INT_LEAST64_MAX_ 9223372036854775807LL
-// PPC64:UINT_LEAST64_MAX_ 18446744073709551615ULL
-// PPC64:INT_FAST64_MIN_ (-9223372036854775807LL -1)
-// PPC64:INT_FAST64_MAX_ 9223372036854775807LL
-// PPC64:UINT_FAST64_MAX_ 18446744073709551615ULL
-//
-// PPC64:INTPTR_MIN_ (-9223372036854775807LL -1)
-// PPC64:INTPTR_MAX_ 9223372036854775807LL
-// PPC64:UINTPTR_MAX_ 18446744073709551615ULL
-// PPC64:PTRDIFF_MIN_ (-9223372036854775807LL -1)
-// PPC64:PTRDIFF_MAX_ 9223372036854775807LL
-// PPC64:SIZE_MAX_ 18446744073709551615ULL
+// PPC64:INT64_MAX_ 9223372036854775807L
+// PPC64:INT64_MIN_ (-9223372036854775807L -1)
+// PPC64:UINT64_MAX_ 18446744073709551615UL
+// PPC64:INT_LEAST64_MIN_ (-9223372036854775807L -1)
+// PPC64:INT_LEAST64_MAX_ 9223372036854775807L
+// PPC64:UINT_LEAST64_MAX_ 18446744073709551615UL
+// PPC64:INT_FAST64_MIN_ (-9223372036854775807L -1)
+// PPC64:INT_FAST64_MAX_ 9223372036854775807L
+// PPC64:UINT_FAST64_MAX_ 18446744073709551615UL
+//
+// PPC64:INTPTR_MIN_ (-9223372036854775807L -1)
+// PPC64:INTPTR_MAX_ 9223372036854775807L
+// PPC64:UINTPTR_MAX_ 18446744073709551615UL
+// PPC64:PTRDIFF_MIN_ (-9223372036854775807L -1)
+// PPC64:PTRDIFF_MAX_ 9223372036854775807L
+// PPC64:SIZE_MAX_ 18446744073709551615UL
//
// PPC64:INTMAX_MIN_ (-9223372036854775807L -1)
// PPC64:INTMAX_MAX_ 9223372036854775807L
@@ -616,36 +616,36 @@
// PPC64:WCHAR_MAX_ 2147483647
// PPC64:WCHAR_MIN_ (-2147483647 -1)
//
-// PPC64:INT8_C_(0) (0)
-// PPC64:UINT8_C_(0) (0U)
-// PPC64:INT16_C_(0) (0)
-// PPC64:UINT16_C_(0) (0U)
-// PPC64:INT32_C_(0) (0)
-// PPC64:UINT32_C_(0) (0U)
-// PPC64:INT64_C_(0) (0LL)
-// PPC64:UINT64_C_(0) (0ULL)
+// PPC64:INT8_C_(0) 0
+// PPC64:UINT8_C_(0) 0U
+// PPC64:INT16_C_(0) 0
+// PPC64:UINT16_C_(0) 0U
+// PPC64:INT32_C_(0) 0
+// PPC64:UINT32_C_(0) 0U
+// PPC64:INT64_C_(0) 0L
+// PPC64:UINT64_C_(0) 0UL
//
-// PPC64:INTMAX_C_(0) (0LL)
-// PPC64:UINTMAX_C_(0) (0ULL)
+// PPC64:INTMAX_C_(0) 0LL
+// PPC64:UINTMAX_C_(0) 0ULL
//
-// RUN: clang-cc -E -ffreestanding -triple=powerpc-none-none %s | FileCheck -check-prefix PPC %s &&
+// RUN: clang-cc -E -ffreestanding -triple=powerpc-none-none %s | FileCheck -check-prefix PPC %s
//
//
-// PPC:typedef long long int int64_t;
+// PPC:typedef signed long long int int64_t;
// PPC:typedef unsigned long long int uint64_t;
// PPC:typedef int64_t int_least64_t;
// PPC:typedef uint64_t uint_least64_t;
// PPC:typedef int64_t int_fast64_t;
// PPC:typedef uint64_t uint_fast64_t;
//
-// PPC:typedef int int32_t;
+// PPC:typedef signed int int32_t;
// PPC:typedef unsigned int uint32_t;
// PPC:typedef int32_t int_least32_t;
// PPC:typedef uint32_t uint_least32_t;
// PPC:typedef int32_t int_fast32_t;
// PPC:typedef uint32_t uint_fast32_t;
//
-// PPC:typedef short int16_t;
+// PPC:typedef signed short int16_t;
// PPC:typedef unsigned short uint16_t;
// PPC:typedef int16_t int_least16_t;
// PPC:typedef uint16_t uint_least16_t;
@@ -666,22 +666,22 @@
// PPC:typedef long long unsigned int uintmax_t;
//
// PPC:INT8_MAX_ 127
-// PPC:INT8_MIN_ (-128)
+// PPC:INT8_MIN_ (-127 -1)
// PPC:UINT8_MAX_ 255
-// PPC:INT_LEAST8_MIN_ (-128)
+// PPC:INT_LEAST8_MIN_ (-127 -1)
// PPC:INT_LEAST8_MAX_ 127
// PPC:UINT_LEAST8_MAX_ 255
-// PPC:INT_FAST8_MIN_ (-128)
+// PPC:INT_FAST8_MIN_ (-127 -1)
// PPC:INT_FAST8_MAX_ 127
// PPC:UINT_FAST8_MAX_ 255
//
// PPC:INT16_MAX_ 32767
-// PPC:INT16_MIN_ (-32768)
+// PPC:INT16_MIN_ (-32767 -1)
// PPC:UINT16_MAX_ 65535
-// PPC:INT_LEAST16_MIN_ (-32768)
+// PPC:INT_LEAST16_MIN_ (-32767 -1)
// PPC:INT_LEAST16_MAX_ 32767
// PPC:UINT_LEAST16_MAX_ 65535
-// PPC:INT_FAST16_MIN_ (-32768)
+// PPC:INT_FAST16_MIN_ (-32767 -1)
// PPC:INT_FAST16_MAX_ 32767
// PPC:UINT_FAST16_MAX_ 65535
//
@@ -724,35 +724,35 @@
// PPC:WCHAR_MAX_ 2147483647
// PPC:WCHAR_MIN_ (-2147483647 -1)
//
-// PPC:INT8_C_(0) (0)
-// PPC:UINT8_C_(0) (0U)
-// PPC:INT16_C_(0) (0)
-// PPC:UINT16_C_(0) (0U)
-// PPC:INT32_C_(0) (0)
-// PPC:UINT32_C_(0) (0U)
-// PPC:INT64_C_(0) (0LL)
-// PPC:UINT64_C_(0) (0ULL)
+// PPC:INT8_C_(0) 0
+// PPC:UINT8_C_(0) 0U
+// PPC:INT16_C_(0) 0
+// PPC:UINT16_C_(0) 0U
+// PPC:INT32_C_(0) 0
+// PPC:UINT32_C_(0) 0U
+// PPC:INT64_C_(0) 0LL
+// PPC:UINT64_C_(0) 0ULL
//
-// PPC:INTMAX_C_(0) (0LL)
-// PPC:UINTMAX_C_(0) (0ULL)
+// PPC:INTMAX_C_(0) 0LL
+// PPC:UINTMAX_C_(0) 0ULL
//
-// RUN: clang-cc -E -ffreestanding -triple=s390x-none-none %s | FileCheck -check-prefix S390X %s &&
+// RUN: clang-cc -E -ffreestanding -triple=s390x-none-none %s | FileCheck -check-prefix S390X %s
//
-// S390X:typedef long long int int64_t;
-// S390X:typedef unsigned long long int uint64_t;
+// S390X:typedef signed long int int64_t;
+// S390X:typedef unsigned long int uint64_t;
// S390X:typedef int64_t int_least64_t;
// S390X:typedef uint64_t uint_least64_t;
// S390X:typedef int64_t int_fast64_t;
// S390X:typedef uint64_t uint_fast64_t;
//
-// S390X:typedef int int32_t;
+// S390X:typedef signed int int32_t;
// S390X:typedef unsigned int uint32_t;
// S390X:typedef int32_t int_least32_t;
// S390X:typedef uint32_t uint_least32_t;
// S390X:typedef int32_t int_fast32_t;
// S390X:typedef uint32_t uint_fast32_t;
//
-// S390X:typedef short int16_t;
+// S390X:typedef signed short int16_t;
// S390X:typedef unsigned short uint16_t;
// S390X:typedef int16_t int_least16_t;
// S390X:typedef uint16_t uint_least16_t;
@@ -773,22 +773,22 @@
// S390X:typedef long long unsigned int uintmax_t;
//
// S390X:INT8_MAX_ 127
-// S390X:INT8_MIN_ (-128)
+// S390X:INT8_MIN_ (-127 -1)
// S390X:UINT8_MAX_ 255
-// S390X:INT_LEAST8_MIN_ (-128)
+// S390X:INT_LEAST8_MIN_ (-127 -1)
// S390X:INT_LEAST8_MAX_ 127
// S390X:UINT_LEAST8_MAX_ 255
-// S390X:INT_FAST8_MIN_ (-128)
+// S390X:INT_FAST8_MIN_ (-127 -1)
// S390X:INT_FAST8_MAX_ 127
// S390X:UINT_FAST8_MAX_ 255
//
// S390X:INT16_MAX_ 32767
-// S390X:INT16_MIN_ (-32768)
+// S390X:INT16_MIN_ (-32767 -1)
// S390X:UINT16_MAX_ 65535
-// S390X:INT_LEAST16_MIN_ (-32768)
+// S390X:INT_LEAST16_MIN_ (-32767 -1)
// S390X:INT_LEAST16_MAX_ 32767
// S390X:UINT_LEAST16_MAX_ 65535
-// S390X:INT_FAST16_MIN_ (-32768)
+// S390X:INT_FAST16_MIN_ (-32767 -1)
// S390X:INT_FAST16_MAX_ 32767
// S390X:UINT_FAST16_MAX_ 65535
//
@@ -802,22 +802,22 @@
// S390X:INT_FAST32_MAX_ 2147483647
// S390X:UINT_FAST32_MAX_ 4294967295U
//
-// S390X:INT64_MAX_ 9223372036854775807LL
-// S390X:INT64_MIN_ (-9223372036854775807LL -1)
-// S390X:UINT64_MAX_ 18446744073709551615ULL
-// S390X:INT_LEAST64_MIN_ (-9223372036854775807LL -1)
-// S390X:INT_LEAST64_MAX_ 9223372036854775807LL
-// S390X:UINT_LEAST64_MAX_ 18446744073709551615ULL
-// S390X:INT_FAST64_MIN_ (-9223372036854775807LL -1)
-// S390X:INT_FAST64_MAX_ 9223372036854775807LL
-// S390X:UINT_FAST64_MAX_ 18446744073709551615ULL
-//
-// S390X:INTPTR_MIN_ (-9223372036854775807LL -1)
-// S390X:INTPTR_MAX_ 9223372036854775807LL
-// S390X:UINTPTR_MAX_ 18446744073709551615ULL
-// S390X:PTRDIFF_MIN_ (-9223372036854775807LL -1)
-// S390X:PTRDIFF_MAX_ 9223372036854775807LL
-// S390X:SIZE_MAX_ 18446744073709551615ULL
+// S390X:INT64_MAX_ 9223372036854775807L
+// S390X:INT64_MIN_ (-9223372036854775807L -1)
+// S390X:UINT64_MAX_ 18446744073709551615UL
+// S390X:INT_LEAST64_MIN_ (-9223372036854775807L -1)
+// S390X:INT_LEAST64_MAX_ 9223372036854775807L
+// S390X:UINT_LEAST64_MAX_ 18446744073709551615UL
+// S390X:INT_FAST64_MIN_ (-9223372036854775807L -1)
+// S390X:INT_FAST64_MAX_ 9223372036854775807L
+// S390X:UINT_FAST64_MAX_ 18446744073709551615UL
+//
+// S390X:INTPTR_MIN_ (-9223372036854775807L -1)
+// S390X:INTPTR_MAX_ 9223372036854775807L
+// S390X:UINTPTR_MAX_ 18446744073709551615UL
+// S390X:PTRDIFF_MIN_ (-9223372036854775807L -1)
+// S390X:PTRDIFF_MAX_ 9223372036854775807L
+// S390X:SIZE_MAX_ 18446744073709551615UL
//
// S390X:INTMAX_MIN_ (-9223372036854775807LL -1)
// S390X:INTMAX_MAX_ 9223372036854775807LL
@@ -831,35 +831,35 @@
// S390X:WCHAR_MAX_ 2147483647
// S390X:WCHAR_MIN_ (-2147483647 -1)
//
-// S390X:INT8_C_(0) (0)
-// S390X:UINT8_C_(0) (0U)
-// S390X:INT16_C_(0) (0)
-// S390X:UINT16_C_(0) (0U)
-// S390X:INT32_C_(0) (0)
-// S390X:UINT32_C_(0) (0U)
-// S390X:INT64_C_(0) (0LL)
-// S390X:UINT64_C_(0) (0ULL)
+// S390X:INT8_C_(0) 0
+// S390X:UINT8_C_(0) 0U
+// S390X:INT16_C_(0) 0
+// S390X:UINT16_C_(0) 0U
+// S390X:INT32_C_(0) 0
+// S390X:UINT32_C_(0) 0U
+// S390X:INT64_C_(0) 0L
+// S390X:UINT64_C_(0) 0UL
//
-// S390X:INTMAX_C_(0) (0LL)
-// S390X:UINTMAX_C_(0) (0ULL)
+// S390X:INTMAX_C_(0) 0LL
+// S390X:UINTMAX_C_(0) 0ULL
//
-// RUN: clang-cc -E -ffreestanding -triple=sparc-none-none %s | FileCheck -check-prefix SPARC %s &&
+// RUN: clang-cc -E -ffreestanding -triple=sparc-none-none %s | FileCheck -check-prefix SPARC %s
//
-// SPARC:typedef long long int int64_t;
+// SPARC:typedef signed long long int int64_t;
// SPARC:typedef unsigned long long int uint64_t;
// SPARC:typedef int64_t int_least64_t;
// SPARC:typedef uint64_t uint_least64_t;
// SPARC:typedef int64_t int_fast64_t;
// SPARC:typedef uint64_t uint_fast64_t;
//
-// SPARC:typedef int int32_t;
+// SPARC:typedef signed int int32_t;
// SPARC:typedef unsigned int uint32_t;
// SPARC:typedef int32_t int_least32_t;
// SPARC:typedef uint32_t uint_least32_t;
// SPARC:typedef int32_t int_fast32_t;
// SPARC:typedef uint32_t uint_fast32_t;
//
-// SPARC:typedef short int16_t;
+// SPARC:typedef signed short int16_t;
// SPARC:typedef unsigned short uint16_t;
// SPARC:typedef int16_t int_least16_t;
// SPARC:typedef uint16_t uint_least16_t;
@@ -880,22 +880,22 @@
// SPARC:typedef long long unsigned int uintmax_t;
//
// SPARC:INT8_MAX_ 127
-// SPARC:INT8_MIN_ (-128)
+// SPARC:INT8_MIN_ (-127 -1)
// SPARC:UINT8_MAX_ 255
-// SPARC:INT_LEAST8_MIN_ (-128)
+// SPARC:INT_LEAST8_MIN_ (-127 -1)
// SPARC:INT_LEAST8_MAX_ 127
// SPARC:UINT_LEAST8_MAX_ 255
-// SPARC:INT_FAST8_MIN_ (-128)
+// SPARC:INT_FAST8_MIN_ (-127 -1)
// SPARC:INT_FAST8_MAX_ 127
// SPARC:UINT_FAST8_MAX_ 255
//
// SPARC:INT16_MAX_ 32767
-// SPARC:INT16_MIN_ (-32768)
+// SPARC:INT16_MIN_ (-32767 -1)
// SPARC:UINT16_MAX_ 65535
-// SPARC:INT_LEAST16_MIN_ (-32768)
+// SPARC:INT_LEAST16_MIN_ (-32767 -1)
// SPARC:INT_LEAST16_MAX_ 32767
// SPARC:UINT_LEAST16_MAX_ 65535
-// SPARC:INT_FAST16_MIN_ (-32768)
+// SPARC:INT_FAST16_MIN_ (-32767 -1)
// SPARC:INT_FAST16_MAX_ 32767
// SPARC:UINT_FAST16_MAX_ 65535
//
@@ -938,28 +938,28 @@
// SPARC:WCHAR_MAX_ 2147483647
// SPARC:WCHAR_MIN_ (-2147483647 -1)
//
-// SPARC:INT8_C_(0) (0)
-// SPARC:UINT8_C_(0) (0U)
-// SPARC:INT16_C_(0) (0)
-// SPARC:UINT16_C_(0) (0U)
-// SPARC:INT32_C_(0) (0)
-// SPARC:UINT32_C_(0) (0U)
-// SPARC:INT64_C_(0) (0LL)
-// SPARC:UINT64_C_(0) (0ULL)
+// SPARC:INT8_C_(0) 0
+// SPARC:UINT8_C_(0) 0U
+// SPARC:INT16_C_(0) 0
+// SPARC:UINT16_C_(0) 0U
+// SPARC:INT32_C_(0) 0
+// SPARC:UINT32_C_(0) 0U
+// SPARC:INT64_C_(0) 0LL
+// SPARC:UINT64_C_(0) 0ULL
//
-// SPARC:INTMAX_C_(0) (0LL)
-// SPARC:UINTMAX_C_(0) (0ULL)
+// SPARC:INTMAX_C_(0) 0LL
+// SPARC:UINTMAX_C_(0) 0ULL
//
-// RUN: clang-cc -E -ffreestanding -triple=tce-none-none %s | FileCheck -check-prefix TCE %s &&
+// RUN: clang-cc -E -ffreestanding -triple=tce-none-none %s | FileCheck -check-prefix TCE %s
//
-// TCE:typedef int int32_t;
+// TCE:typedef signed int int32_t;
// TCE:typedef unsigned int uint32_t;
// TCE:typedef int32_t int_least32_t;
// TCE:typedef uint32_t uint_least32_t;
// TCE:typedef int32_t int_fast32_t;
// TCE:typedef uint32_t uint_fast32_t;
//
-// TCE:typedef short int16_t;
+// TCE:typedef signed short int16_t;
// TCE:typedef unsigned short uint16_t;
// TCE:typedef int16_t int_least16_t;
// TCE:typedef uint16_t uint_least16_t;
@@ -980,22 +980,22 @@
// TCE:typedef long unsigned int uintmax_t;
//
// TCE:INT8_MAX_ 127
-// TCE:INT8_MIN_ (-128)
+// TCE:INT8_MIN_ (-127 -1)
// TCE:UINT8_MAX_ 255
-// TCE:INT_LEAST8_MIN_ (-128)
+// TCE:INT_LEAST8_MIN_ (-127 -1)
// TCE:INT_LEAST8_MAX_ 127
// TCE:UINT_LEAST8_MAX_ 255
-// TCE:INT_FAST8_MIN_ (-128)
+// TCE:INT_FAST8_MIN_ (-127 -1)
// TCE:INT_FAST8_MAX_ 127
// TCE:UINT_FAST8_MAX_ 255
//
// TCE:INT16_MAX_ 32767
-// TCE:INT16_MIN_ (-32768)
+// TCE:INT16_MIN_ (-32767 -1)
// TCE:UINT16_MAX_ 65535
-// TCE:INT_LEAST16_MIN_ (-32768)
+// TCE:INT_LEAST16_MIN_ (-32767 -1)
// TCE:INT_LEAST16_MAX_ 32767
// TCE:UINT_LEAST16_MAX_ 65535
-// TCE:INT_FAST16_MIN_ (-32768)
+// TCE:INT_FAST16_MIN_ (-32767 -1)
// TCE:INT_FAST16_MAX_ 32767
// TCE:UINT_FAST16_MAX_ 65535
//
@@ -1038,36 +1038,36 @@
// TCE:WCHAR_MAX_ 2147483647
// TCE:WCHAR_MIN_ (-2147483647 -1)
//
-// TCE:INT8_C_(0) (0)
-// TCE:UINT8_C_(0) (0U)
-// TCE:INT16_C_(0) (0)
-// TCE:UINT16_C_(0) (0U)
-// TCE:INT32_C_(0) (0)
-// TCE:UINT32_C_(0) (0U)
+// TCE:INT8_C_(0) 0
+// TCE:UINT8_C_(0) 0U
+// TCE:INT16_C_(0) 0
+// TCE:UINT16_C_(0) 0U
+// TCE:INT32_C_(0) 0
+// TCE:UINT32_C_(0) 0U
// TCE:INT64_C_(0) INT64_C(0)
// TCE:UINT64_C_(0) UINT64_C(0)
//
-// TCE:INTMAX_C_(0) (0LL)
-// TCE:UINTMAX_C_(0) (0ULL)
+// TCE:INTMAX_C_(0) 0LL
+// TCE:UINTMAX_C_(0) 0ULL
//
-// RUN: clang-cc -E -ffreestanding -triple=x86_64-none-none %s | FileCheck -check-prefix X86_64 %s &&
+// RUN: clang-cc -E -ffreestanding -triple=x86_64-none-none %s | FileCheck -check-prefix X86_64 %s
//
//
-// X86_64:typedef long int int64_t;
+// X86_64:typedef signed long int int64_t;
// X86_64:typedef unsigned long int uint64_t;
// X86_64:typedef int64_t int_least64_t;
// X86_64:typedef uint64_t uint_least64_t;
// X86_64:typedef int64_t int_fast64_t;
// X86_64:typedef uint64_t uint_fast64_t;
//
-// X86_64:typedef int int32_t;
+// X86_64:typedef signed int int32_t;
// X86_64:typedef unsigned int uint32_t;
// X86_64:typedef int32_t int_least32_t;
// X86_64:typedef uint32_t uint_least32_t;
// X86_64:typedef int32_t int_fast32_t;
// X86_64:typedef uint32_t uint_fast32_t;
//
-// X86_64:typedef short int16_t;
+// X86_64:typedef signed short int16_t;
// X86_64:typedef unsigned short uint16_t;
// X86_64:typedef int16_t int_least16_t;
// X86_64:typedef uint16_t uint_least16_t;
@@ -1088,22 +1088,22 @@
// X86_64:typedef long unsigned int uintmax_t;
//
// X86_64:INT8_MAX_ 127
-// X86_64:INT8_MIN_ (-128)
+// X86_64:INT8_MIN_ (-127 -1)
// X86_64:UINT8_MAX_ 255
-// X86_64:INT_LEAST8_MIN_ (-128)
+// X86_64:INT_LEAST8_MIN_ (-127 -1)
// X86_64:INT_LEAST8_MAX_ 127
// X86_64:UINT_LEAST8_MAX_ 255
-// X86_64:INT_FAST8_MIN_ (-128)
+// X86_64:INT_FAST8_MIN_ (-127 -1)
// X86_64:INT_FAST8_MAX_ 127
// X86_64:UINT_FAST8_MAX_ 255
//
// X86_64:INT16_MAX_ 32767
-// X86_64:INT16_MIN_ (-32768)
+// X86_64:INT16_MIN_ (-32767 -1)
// X86_64:UINT16_MAX_ 65535
-// X86_64:INT_LEAST16_MIN_ (-32768)
+// X86_64:INT_LEAST16_MIN_ (-32767 -1)
// X86_64:INT_LEAST16_MAX_ 32767
// X86_64:UINT_LEAST16_MAX_ 65535
-// X86_64:INT_FAST16_MIN_ (-32768)
+// X86_64:INT_FAST16_MIN_ (-32767 -1)
// X86_64:INT_FAST16_MAX_ 32767
// X86_64:UINT_FAST16_MAX_ 65535
//
@@ -1117,22 +1117,22 @@
// X86_64:INT_FAST32_MAX_ 2147483647
// X86_64:UINT_FAST32_MAX_ 4294967295U
//
-// X86_64:INT64_MAX_ 9223372036854775807LL
-// X86_64:INT64_MIN_ (-9223372036854775807LL -1)
-// X86_64:UINT64_MAX_ 18446744073709551615ULL
-// X86_64:INT_LEAST64_MIN_ (-9223372036854775807LL -1)
-// X86_64:INT_LEAST64_MAX_ 9223372036854775807LL
-// X86_64:UINT_LEAST64_MAX_ 18446744073709551615ULL
-// X86_64:INT_FAST64_MIN_ (-9223372036854775807LL -1)
-// X86_64:INT_FAST64_MAX_ 9223372036854775807LL
-// X86_64:UINT_FAST64_MAX_ 18446744073709551615ULL
-//
-// X86_64:INTPTR_MIN_ (-9223372036854775807LL -1)
-// X86_64:INTPTR_MAX_ 9223372036854775807LL
-// X86_64:UINTPTR_MAX_ 18446744073709551615ULL
-// X86_64:PTRDIFF_MIN_ (-9223372036854775807LL -1)
-// X86_64:PTRDIFF_MAX_ 9223372036854775807LL
-// X86_64:SIZE_MAX_ 18446744073709551615ULL
+// X86_64:INT64_MAX_ 9223372036854775807L
+// X86_64:INT64_MIN_ (-9223372036854775807L -1)
+// X86_64:UINT64_MAX_ 18446744073709551615UL
+// X86_64:INT_LEAST64_MIN_ (-9223372036854775807L -1)
+// X86_64:INT_LEAST64_MAX_ 9223372036854775807L
+// X86_64:UINT_LEAST64_MAX_ 18446744073709551615UL
+// X86_64:INT_FAST64_MIN_ (-9223372036854775807L -1)
+// X86_64:INT_FAST64_MAX_ 9223372036854775807L
+// X86_64:UINT_FAST64_MAX_ 18446744073709551615UL
+//
+// X86_64:INTPTR_MIN_ (-9223372036854775807L -1)
+// X86_64:INTPTR_MAX_ 9223372036854775807L
+// X86_64:UINTPTR_MAX_ 18446744073709551615UL
+// X86_64:PTRDIFF_MIN_ (-9223372036854775807L -1)
+// X86_64:PTRDIFF_MAX_ 9223372036854775807L
+// X86_64:SIZE_MAX_ 18446744073709551615UL
//
// X86_64:INTMAX_MIN_ (-9223372036854775807L -1)
// X86_64:INTMAX_MAX_ 9223372036854775807L
@@ -1146,19 +1146,18 @@
// X86_64:WCHAR_MAX_ 2147483647
// X86_64:WCHAR_MIN_ (-2147483647 -1)
//
-// X86_64:INT8_C_(0) (0)
-// X86_64:UINT8_C_(0) (0U)
-// X86_64:INT16_C_(0) (0)
-// X86_64:UINT16_C_(0) (0U)
-// X86_64:INT32_C_(0) (0)
-// X86_64:UINT32_C_(0) (0U)
-// X86_64:INT64_C_(0) (0LL)
-// X86_64:UINT64_C_(0) (0ULL)
+// X86_64:INT8_C_(0) 0
+// X86_64:UINT8_C_(0) 0U
+// X86_64:INT16_C_(0) 0
+// X86_64:UINT16_C_(0) 0U
+// X86_64:INT32_C_(0) 0
+// X86_64:UINT32_C_(0) 0U
+// X86_64:INT64_C_(0) 0L
+// X86_64:UINT64_C_(0) 0UL
//
-// X86_64:INTMAX_C_(0) (0LL)
-// X86_64:UINTMAX_C_(0) (0ULL)
+// X86_64:INTMAX_C_(0) 0LL
+// X86_64:UINTMAX_C_(0) 0ULL
//
-// RUN: true
#include <stdint.h>
diff --git a/test/Preprocessor/x86_target_features.c b/test/Preprocessor/x86_target_features.c
index 90a717b..f8574e2 100644
--- a/test/Preprocessor/x86_target_features.c
+++ b/test/Preprocessor/x86_target_features.c
@@ -1,35 +1,34 @@
// FIXME: Use -triple, not -ccc-host-triple.
-// RUN: clang -ccc-host-triple i386-unknown-unknown -march=core2 -msse4 -x c -E -dM -o %t %s &&
-// RUN: grep '#define __SSE2_MATH__ 1' %t &&
-// RUN: grep '#define __SSE2__ 1' %t &&
-// RUN: grep '#define __SSE3__ 1' %t &&
-// RUN: grep '#define __SSE4_1__ 1' %t &&
-// RUN: grep '#define __SSE4_2__ 1' %t &&
-// RUN: grep '#define __SSE_MATH__ 1' %t &&
-// RUN: grep '#define __SSE__ 1' %t &&
-// RUN: grep '#define __SSSE3__ 1' %t &&
+// RUN: clang -ccc-host-triple i386-unknown-unknown -march=core2 -msse4 -x c -E -dM -o %t %s
+// RUN: grep '#define __SSE2_MATH__ 1' %t
+// RUN: grep '#define __SSE2__ 1' %t
+// RUN: grep '#define __SSE3__ 1' %t
+// RUN: grep '#define __SSE4_1__ 1' %t
+// RUN: grep '#define __SSE4_2__ 1' %t
+// RUN: grep '#define __SSE_MATH__ 1' %t
+// RUN: grep '#define __SSE__ 1' %t
+// RUN: grep '#define __SSSE3__ 1' %t
-// RUN: clang -ccc-host-triple i386-unknown-unknown -march=core2 -msse4 -mno-sse2 -x c -E -dM -o %t %s &&
-// RUN: grep '#define __SSE2_MATH__ 1' %t | count 0 &&
-// RUN: grep '#define __SSE2__ 1' %t | count 0 &&
-// RUN: grep '#define __SSE3__ 1' %t | count 0 &&
-// RUN: grep '#define __SSE4_1__ 1' %t | count 0 &&
-// RUN: grep '#define __SSE4_2__ 1' %t | count 0 &&
-// RUN: grep '#define __SSE_MATH__ 1' %t &&
-// RUN: grep '#define __SSE__ 1' %t &&
-// RUN: grep '#define __SSSE3__ 1' %t | count 0 &&
+// RUN: clang -ccc-host-triple i386-unknown-unknown -march=core2 -msse4 -mno-sse2 -x c -E -dM -o %t %s
+// RUN: grep '#define __SSE2_MATH__ 1' %t | count 0
+// RUN: grep '#define __SSE2__ 1' %t | count 0
+// RUN: grep '#define __SSE3__ 1' %t | count 0
+// RUN: grep '#define __SSE4_1__ 1' %t | count 0
+// RUN: grep '#define __SSE4_2__ 1' %t | count 0
+// RUN: grep '#define __SSE_MATH__ 1' %t
+// RUN: grep '#define __SSE__ 1' %t
+// RUN: grep '#define __SSSE3__ 1' %t | count 0
-// RUN: clang -ccc-host-triple i386-unknown-unknown -march=pentium-m -x c -E -dM -o %t %s &&
-// RUN: grep '#define __SSE2_MATH__ 1' %t &&
-// RUN: grep '#define __SSE2__ 1' %t &&
-// RUN: grep '#define __SSE3__ 1' %t | count 0 &&
-// RUN: grep '#define __SSE4_1__ 1' %t | count 0 &&
-// RUN: grep '#define __SSE4_2__ 1' %t | count 0 &&
-// RUN: grep '#define __SSE_MATH__ 1' %t &&
-// RUN: grep '#define __SSE__ 1' %t &&
-// RUN: grep '#define __SSSE3__ 1' %t | count 0 &&
+// RUN: clang -ccc-host-triple i386-unknown-unknown -march=pentium-m -x c -E -dM -o %t %s
+// RUN: grep '#define __SSE2_MATH__ 1' %t
+// RUN: grep '#define __SSE2__ 1' %t
+// RUN: grep '#define __SSE3__ 1' %t | count 0
+// RUN: grep '#define __SSE4_1__ 1' %t | count 0
+// RUN: grep '#define __SSE4_2__ 1' %t | count 0
+// RUN: grep '#define __SSE_MATH__ 1' %t
+// RUN: grep '#define __SSE__ 1' %t
+// RUN: grep '#define __SSSE3__ 1' %t | count 0
-// RUN: true
diff --git a/test/Rewriter/objc-ivar-receiver-1.m b/test/Rewriter/objc-ivar-receiver-1.m
index c7ad05a..3898f71 100644
--- a/test/Rewriter/objc-ivar-receiver-1.m
+++ b/test/Rewriter/objc-ivar-receiver-1.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -rewrite-objc %s -o - &&
+// RUN: clang-cc -rewrite-objc %s -o -
// RUN: clang-cc -rewrite-objc %s -o - | grep 'newInv->_container'
@interface NSMutableArray
diff --git a/test/Sema/128bitint.c b/test/Sema/128bitint.c
index 2a18d90..a068d81 100644
--- a/test/Sema/128bitint.c
+++ b/test/Sema/128bitint.c
@@ -1,6 +1,9 @@
-// RUN: clang-cc -fsyntax-only -verify %s
+// RUN: clang-cc -fsyntax-only -verify -triple x86_64-apple-darwin9 %s
typedef int i128 __attribute__((__mode__(TI)));
typedef unsigned u128 __attribute__((__mode__(TI)));
int a[((i128)-1 ^ (i128)-2) == 1 ? 1 : -1];
int a[(u128)-1 > 1LL ? 1 : -1];
+
+// PR5435
+__uint128_t b = (__uint128_t)-1;
diff --git a/test/Sema/PR2727.c b/test/Sema/PR2727.c
index 52d8392..0829dc2 100644
--- a/test/Sema/PR2727.c
+++ b/test/Sema/PR2727.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -verify -fsyntax-only -std=c90 %s &&
+// RUN: clang-cc -verify -fsyntax-only -std=c90 %s
// RUN: clang-cc -verify -fsyntax-only -std=c99 %s
int f (int x)
diff --git a/test/Sema/PR2728.c b/test/Sema/PR2728.c
index 26c96fe..e8c2e26 100644
--- a/test/Sema/PR2728.c
+++ b/test/Sema/PR2728.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -verify -fsyntax-only -std=c90 %s &&
+// RUN: clang-cc -verify -fsyntax-only -std=c90 %s
// RUN: clang-cc -verify -fsyntax-only -std=c99 %s
struct s
diff --git a/test/Sema/attr-format_arg.c b/test/Sema/attr-format_arg.c
index 0830951..5f06f4b 100644
--- a/test/Sema/attr-format_arg.c
+++ b/test/Sema/attr-format_arg.c
@@ -1,6 +1,6 @@
// RUN: clang-cc -fsyntax-only -verify %s
-#include <stdio.h>
+int printf(const char *, ...);
const char* f(const char *s) __attribute__((format_arg(1)));
diff --git a/test/Sema/attr-malloc.c b/test/Sema/attr-malloc.c
index 1adcf07..6483ffc 100644
--- a/test/Sema/attr-malloc.c
+++ b/test/Sema/attr-malloc.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -verify -fsyntax-only %s &&
-// RUN: clang-cc -emit-llvm -o %t %s &&
+// RUN: clang -Xclang -verify -fsyntax-only %s
+// RUN: clang -emit-llvm -S -o %t %s
#include <stdlib.h>
@@ -16,7 +16,7 @@ __attribute((malloc)) int (*g)(); // expected-warning{{'malloc' attribute only a
__attribute((malloc))
void * xalloc(unsigned n) { return malloc(n); } // no-warning
-// RUN: grep 'define noalias .* @xalloc(' %t &&
+// RUN: grep 'define noalias .* @xalloc(' %t
#define malloc_like __attribute((__malloc__))
void * xalloc2(unsigned) malloc_like;
diff --git a/test/Sema/block-byref-args.c b/test/Sema/block-byref-args.c
index 39745d5..06bab12 100644
--- a/test/Sema/block-byref-args.c
+++ b/test/Sema/block-byref-args.c
@@ -1,6 +1,6 @@
// RUN: clang-cc %s -fsyntax-only -verify -fblocks
-#include <stdio.h>
+int printf(const char *, ...);
int main(int argc, char **argv) {
__block void(*bobTheFunction)(void);
diff --git a/test/Sema/block-storageclass.c b/test/Sema/block-storageclass.c
index 3d2527b..aacf8be 100644
--- a/test/Sema/block-storageclass.c
+++ b/test/Sema/block-storageclass.c
@@ -1,6 +1,6 @@
// RUN: clang-cc %s -fsyntax-only -verify -fblocks
-#include <stdio.h>
+int printf(const char *, ...);
void _Block_byref_release(void*src){}
int main() {
diff --git a/test/Sema/builtin-object-size.c b/test/Sema/builtin-object-size.c
index 4b15cb1..0c6d288 100644
--- a/test/Sema/builtin-object-size.c
+++ b/test/Sema/builtin-object-size.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fsyntax-only -verify %s &&
+// RUN: clang-cc -fsyntax-only -verify %s
// RUN: clang-cc -fsyntax-only -triple x86_64-apple-darwin9 -verify %s
int a[10];
diff --git a/test/Sema/callingconv.c b/test/Sema/callingconv.c
index 102115b..f65aab4 100644
--- a/test/Sema/callingconv.c
+++ b/test/Sema/callingconv.c
@@ -17,3 +17,7 @@ void __attribute__((fastcall)) test1(void) {
void __attribute__((fastcall)) test2(int a, ...) { // expected-error {{variadic function cannot use 'fastcall' calling convention}}
}
+
+void __attribute__((cdecl)) ctest0() {}
+
+void __attribute__((cdecl(1))) ctest1(float x) {} // expected-error {{attribute requires 0 argument(s)}}
diff --git a/test/Sema/check-increment.c b/test/Sema/check-increment.c
index 9809544..72eae06 100644
--- a/test/Sema/check-increment.c
+++ b/test/Sema/check-increment.c
@@ -1,6 +1,6 @@
// RUN: clang-cc -fsyntax-only -verify %s
-#include <stdio.h>
+int printf(const char *, ...);
typedef int *pint;
int main() {
int a[5] = {0};
diff --git a/test/Sema/compare.c b/test/Sema/compare.c
index 9cbbfba..01a216f 100644
--- a/test/Sema/compare.c
+++ b/test/Sema/compare.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fsyntax-only -pedantic -verify %s
+// RUN: clang-cc -triple x86_64-apple-darwin -fsyntax-only -pedantic -verify -Wsign-compare %s
int test(char *C) { // nothing here should warn.
return C != ((void*)0);
@@ -8,23 +8,194 @@ int test(char *C) { // nothing here should warn.
}
int ints(long a, unsigned long b) {
- return (a == b) + // expected-warning {{comparison of integers of different signs}}
- ((int)a == b) + // expected-warning {{comparison of integers of different signs}}
- ((short)a == b) + // expected-warning {{comparison of integers of different signs}}
- (a == (unsigned int) b) + // expected-warning {{comparison of integers of different signs}}
- (a == (unsigned short) b); // expected-warning {{comparison of integers of different signs}}
-
- enum Enum {B};
- return (a == B) +
- ((int)a == B) +
- ((short)a == B) +
- (a == (unsigned int) B) + // expected-warning {{comparison of integers of different signs}}
- (a == (unsigned short) B); // expected-warning {{comparison of integers of different signs}}
-
- // Should be able to prove all of these are non-negative.
- return (b == (long) B) +
- (b == (int) B) +
- (b == (short) B);
+ enum EnumA {A};
+ enum EnumB {B};
+ enum EnumC {C = 0x10000};
+ return
+ // (a,b)
+ (a == (unsigned long) b) + // expected-warning {{comparison of integers of different signs}}
+ (a == (unsigned int) b) +
+ (a == (unsigned short) b) +
+ (a == (unsigned char) b) +
+ ((long) a == b) + // expected-warning {{comparison of integers of different signs}}
+ ((int) a == b) + // expected-warning {{comparison of integers of different signs}}
+ ((short) a == b) + // expected-warning {{comparison of integers of different signs}}
+ ((signed char) a == b) + // expected-warning {{comparison of integers of different signs}}
+ ((long) a == (unsigned long) b) + // expected-warning {{comparison of integers of different signs}}
+ ((int) a == (unsigned int) b) + // expected-warning {{comparison of integers of different signs}}
+ ((short) a == (unsigned short) b) + // expected-warning {{comparison of integers of different signs}}
+ ((signed char) a == (unsigned char) b) + // expected-warning {{comparison of integers of different signs}}
+ (a < (unsigned long) b) + // expected-warning {{comparison of integers of different signs}}
+ (a < (unsigned int) b) +
+ (a < (unsigned short) b) +
+ (a < (unsigned char) b) +
+ ((long) a < b) + // expected-warning {{comparison of integers of different signs}}
+ ((int) a < b) + // expected-warning {{comparison of integers of different signs}}
+ ((short) a < b) + // expected-warning {{comparison of integers of different signs}}
+ ((signed char) a < b) + // expected-warning {{comparison of integers of different signs}}
+ ((long) a < (unsigned long) b) + // expected-warning {{comparison of integers of different signs}}
+ ((int) a < (unsigned int) b) + // expected-warning {{comparison of integers of different signs}}
+ ((short) a < (unsigned short) b) + // expected-warning {{comparison of integers of different signs}}
+ ((signed char) a < (unsigned char) b) + // expected-warning {{comparison of integers of different signs}}
+
+ // (A,b)
+ (A == (unsigned long) b) +
+ (A == (unsigned int) b) +
+ (A == (unsigned short) b) +
+ (A == (unsigned char) b) +
+ ((long) A == b) +
+ ((int) A == b) +
+ ((short) A == b) +
+ ((signed char) A == b) +
+ ((long) A == (unsigned long) b) +
+ ((int) A == (unsigned int) b) +
+ ((short) A == (unsigned short) b) +
+ ((signed char) A == (unsigned char) b) +
+ (A < (unsigned long) b) +
+ (A < (unsigned int) b) +
+ (A < (unsigned short) b) +
+ (A < (unsigned char) b) +
+ ((long) A < b) +
+ ((int) A < b) +
+ ((short) A < b) +
+ ((signed char) A < b) +
+ ((long) A < (unsigned long) b) +
+ ((int) A < (unsigned int) b) +
+ ((short) A < (unsigned short) b) +
+ ((signed char) A < (unsigned char) b) +
+
+ // (a,B)
+ (a == (unsigned long) B) +
+ (a == (unsigned int) B) +
+ (a == (unsigned short) B) +
+ (a == (unsigned char) B) +
+ ((long) a == B) +
+ ((int) a == B) +
+ ((short) a == B) +
+ ((signed char) a == B) +
+ ((long) a == (unsigned long) B) +
+ ((int) a == (unsigned int) B) +
+ ((short) a == (unsigned short) B) +
+ ((signed char) a == (unsigned char) B) +
+ (a < (unsigned long) B) + // expected-warning {{comparison of integers of different signs}}
+ (a < (unsigned int) B) +
+ (a < (unsigned short) B) +
+ (a < (unsigned char) B) +
+ ((long) a < B) +
+ ((int) a < B) +
+ ((short) a < B) +
+ ((signed char) a < B) +
+ ((long) a < (unsigned long) B) + // expected-warning {{comparison of integers of different signs}}
+ ((int) a < (unsigned int) B) + // expected-warning {{comparison of integers of different signs}}
+ ((short) a < (unsigned short) B) + // expected-warning {{comparison of integers of different signs}}
+ ((signed char) a < (unsigned char) B) + // expected-warning {{comparison of integers of different signs}}
+
+ // (C,b)
+ (C == (unsigned long) b) +
+ (C == (unsigned int) b) +
+ (C == (unsigned short) b) +
+ (C == (unsigned char) b) +
+ ((long) C == b) +
+ ((int) C == b) +
+ ((short) C == b) +
+ ((signed char) C == b) +
+ ((long) C == (unsigned long) b) +
+ ((int) C == (unsigned int) b) +
+ ((short) C == (unsigned short) b) +
+ ((signed char) C == (unsigned char) b) +
+ (C < (unsigned long) b) +
+ (C < (unsigned int) b) +
+ (C < (unsigned short) b) +
+ (C < (unsigned char) b) +
+ ((long) C < b) +
+ ((int) C < b) +
+ ((short) C < b) +
+ ((signed char) C < b) +
+ ((long) C < (unsigned long) b) +
+ ((int) C < (unsigned int) b) +
+ ((short) C < (unsigned short) b) +
+ ((signed char) C < (unsigned char) b) +
+
+ // (a,C)
+ (a == (unsigned long) C) +
+ (a == (unsigned int) C) +
+ (a == (unsigned short) C) +
+ (a == (unsigned char) C) +
+ ((long) a == C) +
+ ((int) a == C) +
+ ((short) a == C) +
+ ((signed char) a == C) +
+ ((long) a == (unsigned long) C) +
+ ((int) a == (unsigned int) C) +
+ ((short) a == (unsigned short) C) +
+ ((signed char) a == (unsigned char) C) +
+ (a < (unsigned long) C) + // expected-warning {{comparison of integers of different signs}}
+ (a < (unsigned int) C) +
+ (a < (unsigned short) C) +
+ (a < (unsigned char) C) +
+ ((long) a < C) +
+ ((int) a < C) +
+ ((short) a < C) +
+ ((signed char) a < C) +
+ ((long) a < (unsigned long) C) + // expected-warning {{comparison of integers of different signs}}
+ ((int) a < (unsigned int) C) + // expected-warning {{comparison of integers of different signs}}
+ ((short) a < (unsigned short) C) + // expected-warning {{comparison of integers of different signs}}
+ ((signed char) a < (unsigned char) C) + // expected-warning {{comparison of integers of different signs}}
+
+ // (0x80000,b)
+ (0x80000 == (unsigned long) b) +
+ (0x80000 == (unsigned int) b) +
+ (0x80000 == (unsigned short) b) +
+ (0x80000 == (unsigned char) b) +
+ ((long) 0x80000 == b) +
+ ((int) 0x80000 == b) +
+ ((short) 0x80000 == b) +
+ ((signed char) 0x80000 == b) +
+ ((long) 0x80000 == (unsigned long) b) +
+ ((int) 0x80000 == (unsigned int) b) +
+ ((short) 0x80000 == (unsigned short) b) +
+ ((signed char) 0x80000 == (unsigned char) b) +
+ (0x80000 < (unsigned long) b) +
+ (0x80000 < (unsigned int) b) +
+ (0x80000 < (unsigned short) b) +
+ (0x80000 < (unsigned char) b) +
+ ((long) 0x80000 < b) +
+ ((int) 0x80000 < b) +
+ ((short) 0x80000 < b) +
+ ((signed char) 0x80000 < b) +
+ ((long) 0x80000 < (unsigned long) b) +
+ ((int) 0x80000 < (unsigned int) b) +
+ ((short) 0x80000 < (unsigned short) b) +
+ ((signed char) 0x80000 < (unsigned char) b) +
+
+ // (a,0x80000)
+ (a == (unsigned long) 0x80000) +
+ (a == (unsigned int) 0x80000) +
+ (a == (unsigned short) 0x80000) +
+ (a == (unsigned char) 0x80000) +
+ ((long) a == 0x80000) +
+ ((int) a == 0x80000) +
+ ((short) a == 0x80000) +
+ ((signed char) a == 0x80000) +
+ ((long) a == (unsigned long) 0x80000) +
+ ((int) a == (unsigned int) 0x80000) +
+ ((short) a == (unsigned short) 0x80000) +
+ ((signed char) a == (unsigned char) 0x80000) +
+ (a < (unsigned long) 0x80000) + // expected-warning {{comparison of integers of different signs}}
+ (a < (unsigned int) 0x80000) +
+ (a < (unsigned short) 0x80000) +
+ (a < (unsigned char) 0x80000) +
+ ((long) a < 0x80000) +
+ ((int) a < 0x80000) +
+ ((short) a < 0x80000) +
+ ((signed char) a < 0x80000) +
+ ((long) a < (unsigned long) 0x80000) + // expected-warning {{comparison of integers of different signs}}
+ ((int) a < (unsigned int) 0x80000) + // expected-warning {{comparison of integers of different signs}}
+ ((short) a < (unsigned short) 0x80000) + // expected-warning {{comparison of integers of different signs}}
+ ((signed char) a < (unsigned char) 0x80000) + // expected-warning {{comparison of integers of different signs}}
+
+ 10
+ ;
}
int equal(char *a, const char *b) {
diff --git a/test/Sema/conditional-expr.c b/test/Sema/conditional-expr.c
index 3bfeae5d..8cac32c 100644
--- a/test/Sema/conditional-expr.c
+++ b/test/Sema/conditional-expr.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fsyntax-only -verify -pedantic %s
+// RUN: clang-cc -fsyntax-only -verify -pedantic -Wsign-compare %s
void foo() {
*(0 ? (double *)0 : (void *)0) = 0;
// FIXME: GCC doesn't consider the the following two statements to be errors.
diff --git a/test/Sema/const-eval.c b/test/Sema/const-eval.c
index 72db14c..39a24b3 100644
--- a/test/Sema/const-eval.c
+++ b/test/Sema/const-eval.c
@@ -68,3 +68,10 @@ EVAL_EXPR(32, (int*)0 != (int*)0 ? -1 : 1)
EVAL_EXPR(33, (void*)0 - (void*)0 == 0 ? 1 : -1)
void foo(void) {}
EVAL_EXPR(34, (foo == (void *)0) ? -1 : 1)
+
+// No PR. Mismatched bitwidths lead to a crash on second evaluation.
+const _Bool constbool = 0;
+EVAL_EXPR(35, constbool)
+EVAL_EXPR(36, constbool)
+
+EVAL_EXPR(37, (1,2.0) == 2.0)
diff --git a/test/Sema/conversion-64-32.c b/test/Sema/conversion-64-32.c
new file mode 100644
index 0000000..53830fd
--- /dev/null
+++ b/test/Sema/conversion-64-32.c
@@ -0,0 +1,5 @@
+// RUN: clang-cc -fsyntax-only -verify -Wshorten-64-to-32 -triple x86_64-apple-darwin %s
+
+int test0(long v) {
+ return v; // expected-warning {{implicit cast loses integer precision}}
+}
diff --git a/test/Sema/conversion.c b/test/Sema/conversion.c
new file mode 100644
index 0000000..bca23f8
--- /dev/null
+++ b/test/Sema/conversion.c
@@ -0,0 +1,237 @@
+// RUN: clang-cc -fsyntax-only -verify -Wconversion -triple x86_64-apple-darwin %s
+
+#define BIG 0x7f7f7f7f7f7f7f7fL
+
+void test0(char c, short s, int i, long l, long long ll) {
+ c = c;
+ c = s; // expected-warning {{implicit cast loses integer precision}}
+ c = i; // expected-warning {{implicit cast loses integer precision}}
+ c = l; // expected-warning {{implicit cast loses integer precision}}
+ s = c;
+ s = s;
+ s = i; // expected-warning {{implicit cast loses integer precision}}
+ s = l; // expected-warning {{implicit cast loses integer precision}}
+ i = c;
+ i = s;
+ i = i;
+ i = l; // expected-warning {{implicit cast loses integer precision}}
+ l = c;
+ l = s;
+ l = i;
+ l = l;
+
+ c = (char) 0;
+ c = (short) 0;
+ c = (int) 0;
+ c = (long) 0;
+ s = (char) 0;
+ s = (short) 0;
+ s = (int) 0;
+ s = (long) 0;
+ i = (char) 0;
+ i = (short) 0;
+ i = (int) 0;
+ i = (long) 0;
+ l = (char) 0;
+ l = (short) 0;
+ l = (int) 0;
+ l = (long) 0;
+
+ c = (char) BIG;
+ c = (short) BIG; // expected-warning {{implicit cast loses integer precision}}
+ c = (int) BIG; // expected-warning {{implicit cast loses integer precision}}
+ c = (long) BIG; // expected-warning {{implicit cast loses integer precision}}
+ s = (char) BIG;
+ s = (short) BIG;
+ s = (int) BIG; // expected-warning {{implicit cast loses integer precision}}
+ s = (long) BIG; // expected-warning {{implicit cast loses integer precision}}
+ i = (char) BIG;
+ i = (short) BIG;
+ i = (int) BIG;
+ i = (long) BIG; // expected-warning {{implicit cast loses integer precision}}
+ l = (char) BIG;
+ l = (short) BIG;
+ l = (int) BIG;
+ l = (long) BIG;
+}
+
+char test1(long long ll) {
+ return (long long) ll; // expected-warning {{implicit cast loses integer precision}}
+ return (long) ll; // expected-warning {{implicit cast loses integer precision}}
+ return (int) ll; // expected-warning {{implicit cast loses integer precision}}
+ return (short) ll; // expected-warning {{implicit cast loses integer precision}}
+ return (char) ll;
+ return (long long) BIG; // expected-warning {{implicit cast loses integer precision}}
+ return (long) BIG; // expected-warning {{implicit cast loses integer precision}}
+ return (int) BIG; // expected-warning {{implicit cast loses integer precision}}
+ return (short) BIG; // expected-warning {{implicit cast loses integer precision}}
+ return (char) BIG;
+}
+
+short test2(long long ll) {
+ return (long long) ll; // expected-warning {{implicit cast loses integer precision}}
+ return (long) ll; // expected-warning {{implicit cast loses integer precision}}
+ return (int) ll; // expected-warning {{implicit cast loses integer precision}}
+ return (short) ll;
+ return (char) ll;
+ return (long long) BIG; // expected-warning {{implicit cast loses integer precision}}
+ return (long) BIG; // expected-warning {{implicit cast loses integer precision}}
+ return (int) BIG; // expected-warning {{implicit cast loses integer precision}}
+ return (short) BIG;
+ return (char) BIG;
+}
+
+int test3(long long ll) {
+ return (long long) ll; // expected-warning {{implicit cast loses integer precision}}
+ return (long) ll; // expected-warning {{implicit cast loses integer precision}}
+ return (int) ll;
+ return (short) ll;
+ return (char) ll;
+ return (long long) BIG; // expected-warning {{implicit cast loses integer precision}}
+ return (long) BIG; // expected-warning {{implicit cast loses integer precision}}
+ return (int) BIG;
+ return (short) BIG;
+ return (char) BIG;
+}
+
+long test4(long long ll) {
+ return (long long) ll;
+ return (long) ll;
+ return (int) ll;
+ return (short) ll;
+ return (char) ll;
+ return (long long) BIG;
+ return (long) BIG;
+ return (int) BIG;
+ return (short) BIG;
+ return (char) BIG;
+}
+
+long long test5(long long ll) {
+ return (long long) ll;
+ return (long) ll;
+ return (int) ll;
+ return (short) ll;
+ return (char) ll;
+ return (long long) BIG;
+ return (long) BIG;
+ return (int) BIG;
+ return (short) BIG;
+ return (char) BIG;
+}
+
+void takes_char(char);
+void takes_short(short);
+void takes_int(int);
+void takes_long(long);
+void takes_longlong(long long);
+void takes_float(float);
+void takes_double(double);
+void takes_longdouble(long double);
+
+void test6(char v) {
+ takes_char(v);
+ takes_short(v);
+ takes_int(v);
+ takes_long(v);
+ takes_longlong(v);
+ takes_float(v);
+ takes_double(v);
+ takes_longdouble(v);
+}
+
+void test7(short v) {
+ takes_char(v); // expected-warning {{implicit cast loses integer precision}}
+ takes_short(v);
+ takes_int(v);
+ takes_long(v);
+ takes_longlong(v);
+ takes_float(v);
+ takes_double(v);
+ takes_longdouble(v);
+}
+
+void test8(int v) {
+ takes_char(v); // expected-warning {{implicit cast loses integer precision}}
+ takes_short(v); // expected-warning {{implicit cast loses integer precision}}
+ takes_int(v);
+ takes_long(v);
+ takes_longlong(v);
+ takes_float(v);
+ takes_double(v);
+ takes_longdouble(v);
+}
+
+void test9(long v) {
+ takes_char(v); // expected-warning {{implicit cast loses integer precision}}
+ takes_short(v); // expected-warning {{implicit cast loses integer precision}}
+ takes_int(v); // expected-warning {{implicit cast loses integer precision}}
+ takes_long(v);
+ takes_longlong(v);
+ takes_float(v);
+ takes_double(v);
+ takes_longdouble(v);
+}
+
+void test10(long long v) {
+ takes_char(v); // expected-warning {{implicit cast loses integer precision}}
+ takes_short(v); // expected-warning {{implicit cast loses integer precision}}
+ takes_int(v); // expected-warning {{implicit cast loses integer precision}}
+ takes_long(v);
+ takes_longlong(v);
+ takes_float(v);
+ takes_double(v);
+ takes_longdouble(v);
+}
+
+void test11(float v) {
+ takes_char(v); // expected-warning {{implicit cast turns floating-point number into integer}}
+ takes_short(v); // expected-warning {{implicit cast turns floating-point number into integer}}
+ takes_int(v); // expected-warning {{implicit cast turns floating-point number into integer}}
+ takes_long(v); // expected-warning {{implicit cast turns floating-point number into integer}}
+ takes_longlong(v); // expected-warning {{implicit cast turns floating-point number into integer}}
+ takes_float(v);
+ takes_double(v);
+ takes_longdouble(v);
+}
+
+void test12(double v) {
+ takes_char(v); // expected-warning {{implicit cast turns floating-point number into integer}}
+ takes_short(v); // expected-warning {{implicit cast turns floating-point number into integer}}
+ takes_int(v); // expected-warning {{implicit cast turns floating-point number into integer}}
+ takes_long(v); // expected-warning {{implicit cast turns floating-point number into integer}}
+ takes_longlong(v); // expected-warning {{implicit cast turns floating-point number into integer}}
+ takes_float(v); // expected-warning {{implicit cast loses floating-point precision}}
+ takes_double(v);
+ takes_longdouble(v);
+}
+
+void test13(long double v) {
+ takes_char(v); // expected-warning {{implicit cast turns floating-point number into integer}}
+ takes_short(v); // expected-warning {{implicit cast turns floating-point number into integer}}
+ takes_int(v); // expected-warning {{implicit cast turns floating-point number into integer}}
+ takes_long(v); // expected-warning {{implicit cast turns floating-point number into integer}}
+ takes_longlong(v); // expected-warning {{implicit cast turns floating-point number into integer}}
+ takes_float(v); // expected-warning {{implicit cast loses floating-point precision}}
+ takes_double(v); // expected-warning {{implicit cast loses floating-point precision}}
+ takes_longdouble(v);
+}
+
+void test14(long l) {
+ // Fine because of the boolean whitelist.
+ char c;
+ c = (l == 4);
+ c = ((l <= 4) && (l >= 0));
+ c = ((l <= 4) && (l >= 0)) || (l > 20);
+}
+
+void test15(char c) {
+ c = c + 1 + c * 2;
+ c = (short) c + 1 + c * 2; // expected-warning {{implicit cast loses integer precision}}
+}
+
+// PR 5422
+extern void *test16_external;
+void test16(void) {
+ int a = (unsigned long) &test16_external; // expected-warning {{implicit cast loses integer precision}}
+}
diff --git a/test/Sema/expr-comma-c89.c b/test/Sema/expr-comma-c89.c
index b2b17dc..ffe8b69 100644
--- a/test/Sema/expr-comma-c89.c
+++ b/test/Sema/expr-comma-c89.c
@@ -1,7 +1,6 @@
// RUN: clang-cc %s -fsyntax-only -verify -std=c99
// rdar://6095180
-#include <assert.h>
struct s { char c[17]; };
extern struct s foo(void);
diff --git a/test/Sema/expr-comma.c b/test/Sema/expr-comma.c
index 6407986..3a05130 100644
--- a/test/Sema/expr-comma.c
+++ b/test/Sema/expr-comma.c
@@ -1,7 +1,6 @@
// RUN: clang-cc %s -fsyntax-only -verify -std=c89
// rdar://6095180
-#include <assert.h>
struct s { char c[17]; };
extern struct s foo(void);
diff --git a/test/Sema/format-attr-pr4470.c b/test/Sema/format-attr-pr4470.c
index c03c573..24eece8 100644
--- a/test/Sema/format-attr-pr4470.c
+++ b/test/Sema/format-attr-pr4470.c
@@ -1,7 +1,7 @@
// RUN: clang-cc -fsyntax-only -verify -Wformat=2 %s
-#include <stdio.h>
#include <stdarg.h>
+int vprintf(const char *, va_list);
const char *foo(const char *format) __attribute__((format_arg(1)));
diff --git a/test/Sema/format-strings.c b/test/Sema/format-strings.c
index 797e53c..0a9fcce 100644
--- a/test/Sema/format-strings.c
+++ b/test/Sema/format-strings.c
@@ -1,17 +1,20 @@
// RUN: clang-cc -fsyntax-only -verify -Wformat-nonliteral %s
-// Define this to get vasprintf on Linux
-#define _GNU_SOURCE
-
-#include <stdio.h>
#include <stdarg.h>
+typedef __typeof(sizeof(int)) size_t;
+typedef struct _FILE FILE;
+int fprintf(FILE *, const char *restrict, ...);
+int printf(const char *restrict, ...);
+int snprintf(char *restrict, size_t, const char *restrict, ...);
+int sprintf(char *restrict, const char *restrict, ...);
+int vasprintf(char **, const char *, va_list);
+int vfprintf(FILE *, const char *restrict, va_list);
+int vprintf(const char *restrict, va_list);
+int vsnprintf(char *, size_t, const char *, va_list);
+int vsprintf(char *restrict, const char *restrict, va_list);
char * global_fmt;
-#if defined(_WIN32) || defined(_WIN64)
-extern int snprintf(char*, size_t, const char*, ...);
-#endif
-
void check_string_literal( FILE* fp, const char* s, char *buf, ... ) {
char * b;
diff --git a/test/Sema/i-c-e.c b/test/Sema/i-c-e.c
index de27966..6e14833 100644
--- a/test/Sema/i-c-e.c
+++ b/test/Sema/i-c-e.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc %s -fsyntax-only -verify -pedantic -fpascal-strings
+// RUN: clang %s -fsyntax-only -Xclang -verify -pedantic -fpascal-strings
#include <stdint.h>
#include <limits.h>
diff --git a/test/Sema/implicit-builtin-redecl.c b/test/Sema/implicit-builtin-redecl.c
index 36513ba..fc51312 100644
--- a/test/Sema/implicit-builtin-redecl.c
+++ b/test/Sema/implicit-builtin-redecl.c
@@ -23,4 +23,4 @@ int f3() {
return index << 2;
}
-typedef int rindex; \ No newline at end of file
+typedef int rindex;
diff --git a/test/Sema/implicit-def.c b/test/Sema/implicit-def.c
index 2c25946..3b31b99 100644
--- a/test/Sema/implicit-def.c
+++ b/test/Sema/implicit-def.c
@@ -1,4 +1,4 @@
-/* RUN: clang-cc -fsyntax-only %s -std=c89 &&
+/* RUN: clang-cc -fsyntax-only %s -std=c89
* RUN: not clang-cc -fsyntax-only %s -std=c99 -pedantic-errors
*/
diff --git a/test/Sema/parentheses.c b/test/Sema/parentheses.c
index a8ad260..f9f647c 100644
--- a/test/Sema/parentheses.c
+++ b/test/Sema/parentheses.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -Wparentheses -fsyntax-only -verify %s &&
+// RUN: clang-cc -Wparentheses -fsyntax-only -verify %s
// RUN: clang-cc -Wparentheses -fixit %s -o - | clang-cc -Wparentheses -Werror -
// Test the various warnings under -Wparentheses
diff --git a/test/Sema/pointer-conversion.c b/test/Sema/pointer-conversion.c
new file mode 100644
index 0000000..5f41ff6
--- /dev/null
+++ b/test/Sema/pointer-conversion.c
@@ -0,0 +1,10 @@
+//RUN: clang-cc -fsyntax-only -verify %s
+
+char * c;
+char const ** c2 = &c; // expected-warning {{initializing, 'char const **' and 'char **' have different qualifiers in nested pointer types}}
+
+typedef char dchar;
+dchar *** c3 = &c2; // expected-warning {{initializing, 'dchar ***' and 'char const ***' have different qualifiers in nested pointer types}}
+
+volatile char * c4;
+char ** c5 = &c4; // expected-warning {{initializing, 'char **' and 'char volatile **' have different qualifiers in nested pointer types}}
diff --git a/test/Sema/pragma-pack-4.c b/test/Sema/pragma-pack-4.c
index f6f107d..3ccaf7e 100644
--- a/test/Sema/pragma-pack-4.c
+++ b/test/Sema/pragma-pack-4.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i686-apple-darwin9 %s -fsyntax-only -verify &&
+// RUN: clang-cc -triple i686-apple-darwin9 %s -fsyntax-only -verify
// RUN: clang-cc -triple x86_64-apple-darwin9 %s -fsyntax-only -verify
// rdar://problem/7095436
diff --git a/test/Sema/return.c b/test/Sema/return.c
index cdd3105..ad75cf1 100644
--- a/test/Sema/return.c
+++ b/test/Sema/return.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc %s -fsyntax-only -verify -fblocks
+// RUN: clang %s -fsyntax-only -Xclang -verify -fblocks
// clang emits the following warning by default.
// With GCC, -pedantic, -Wreturn-type or -Wall are required to produce the
diff --git a/test/Sema/shift.c b/test/Sema/shift.c
index 2516d1b..fdfebc5 100644
--- a/test/Sema/shift.c
+++ b/test/Sema/shift.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -Wall -fsyntax-only -verify %s
+// RUN: clang -Wall -fsyntax-only -Xclang -verify %s
#include <limits.h>
diff --git a/test/Sema/ucn-cstring.c b/test/Sema/ucn-cstring.c
index 6d021fd..fb9a3b6 100644
--- a/test/Sema/ucn-cstring.c
+++ b/test/Sema/ucn-cstring.c
@@ -1,6 +1,6 @@
// RUN: clang-cc %s -verify -fsyntax-only -pedantic
-#include <stdio.h>
+int printf(const char *, ...);
int main(void) {
int a[sizeof("hello \u2192 \u2603 \u2190 world") == 24 ? 1 : -1];
diff --git a/test/Sema/varargs.c b/test/Sema/varargs.c
index 8d2f0b1..e928997 100644
--- a/test/Sema/varargs.c
+++ b/test/Sema/varargs.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fsyntax-only -verify %s &&
+// RUN: clang-cc -fsyntax-only -verify %s
// RUN: clang-cc -fsyntax-only -verify %s -triple x86_64-apple-darwin9
void f1(int a)
diff --git a/test/Sema/wchar.c b/test/Sema/wchar.c
index 1637600..e201c7e 100644
--- a/test/Sema/wchar.c
+++ b/test/Sema/wchar.c
@@ -1,12 +1,20 @@
-// RUN: clang-cc %s -fsyntax-only -verify
-#include <wchar.h>
+// RUN: clang %s -fsyntax-only -Xclang -verify
+// RUN: clang %s -fsyntax-only -fshort-wchar -Xclang -verify -DSHORT_WCHAR
-int check_wchar_size[sizeof(*L"") == sizeof(wchar_t) ? 1 : -1];
+typedef __WCHAR_TYPE__ wchar_t;
+#if defined(_WIN32) || defined(_M_IX86) || defined(__CYGWIN__) \
+ || defined(_M_X64) || defined(SHORT_WCHAR)
+ #define WCHAR_T_TYPE unsigned short
+#else
+ #define WCHAR_T_TYPE int
+#endif
+
+int check_wchar_size[sizeof(*L"") == sizeof(wchar_t) ? 1 : -1];
+
void foo() {
- int t1[] = L"x";
+ WCHAR_T_TYPE t1[] = L"x";
wchar_t tab[] = L"x";
-
- int t2[] = "x"; // expected-error {{initialization}}
+ WCHAR_T_TYPE t2[] = "x"; // expected-error {{initialization}}
char t3[] = L"x"; // expected-error {{initialization}}
}
diff --git a/test/Sema/x86-intrinsics-headers.c b/test/Sema/x86-intrinsics-headers.c
index dd7dd5c..5b43e2b 100644
--- a/test/Sema/x86-intrinsics-headers.c
+++ b/test/Sema/x86-intrinsics-headers.c
@@ -1,5 +1,5 @@
-// RUN: clang -fsyntax-only %s &&
-// RUN: clang -fsyntax-only -fno-lax-vector-conversions %s &&
+// RUN: clang -fsyntax-only %s
+// RUN: clang -fsyntax-only -fno-lax-vector-conversions %s
// RUN: clang -fsyntax-only -x c++ %s
#if defined(i386) || defined(__x86_64__)
diff --git a/test/SemaCXX/__null.cpp b/test/SemaCXX/__null.cpp
index 4672801..cf78514 100644
--- a/test/SemaCXX/__null.cpp
+++ b/test/SemaCXX/__null.cpp
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple x86_64-unknown-unknown %s -fsyntax-only -verify &&
+// RUN: clang-cc -triple x86_64-unknown-unknown %s -fsyntax-only -verify
// RUN: clang-cc -triple i686-unknown-unknown %s -fsyntax-only -verify
void f() {
diff --git a/test/SemaCXX/arrow-operator.cpp b/test/SemaCXX/arrow-operator.cpp
index 9c46e96..08b3cd4 100644
--- a/test/SemaCXX/arrow-operator.cpp
+++ b/test/SemaCXX/arrow-operator.cpp
@@ -16,7 +16,10 @@ struct C : A, B {
struct D : A { };
-void f(C &c, D& d) {
+struct E; // expected-note {{forward declaration of 'struct E'}}
+
+void f(C &c, D& d, E& e) {
c->f(); // expected-error{{use of overloaded operator '->' is ambiguous}}
d->f();
-} \ No newline at end of file
+ e->f(); // expected-error{{incomplete definition of type}}
+}
diff --git a/test/SemaCXX/builtins.cpp b/test/SemaCXX/builtins.cpp
new file mode 100644
index 0000000..9e9d152
--- /dev/null
+++ b/test/SemaCXX/builtins.cpp
@@ -0,0 +1,7 @@
+// RUN: clang-cc %s -fsyntax-only -verify
+typedef const struct __CFString * CFStringRef;
+#define CFSTR __builtin___CFStringMakeConstantString
+
+void f() {
+ (void)CFStringRef(CFSTR("Hello"));
+} \ No newline at end of file
diff --git a/test/SemaCXX/cast-conversion.cpp b/test/SemaCXX/cast-conversion.cpp
index cbc24ae..3b6a9d6 100644
--- a/test/SemaCXX/cast-conversion.cpp
+++ b/test/SemaCXX/cast-conversion.cpp
@@ -19,3 +19,28 @@ int main () {
// expected-warning {{expression result unused}}
}
+template<class T>
+struct X0 {
+ X0(const T &);
+};
+
+template<class T>
+X0<T> make_X0(const T &Val) {
+ return X0<T>(Val);
+}
+
+void test_X0() {
+ const char array[2];
+ make_X0(array);
+}
+
+// PR5210 recovery
+class C {
+protected:
+ template <int> float* &f0(); // expected-note{{candidate}}
+ template <unsigned> float* &f0(); // expected-note{{candidate}}
+
+ void f1() {
+ static_cast<float*>(f0<0>()); // expected-error{{ambiguous}}
+ }
+};
diff --git a/test/SemaCXX/compare.cpp b/test/SemaCXX/compare.cpp
index 806b078..e38b6b3 100644
--- a/test/SemaCXX/compare.cpp
+++ b/test/SemaCXX/compare.cpp
@@ -1,15 +1,195 @@
-// RUN: clang-cc -fsyntax-only -pedantic -verify %s
+// Force x86-64 because some of our heuristics are actually based
+// on integer sizes.
+
+// RUN: clang-cc -triple x86_64-apple-darwin -fsyntax-only -pedantic -verify -Wsign-compare %s
int test0(long a, unsigned long b) {
- enum Enum {B};
- return (a == B) + // expected-warning {{comparison of integers of different signs}}
- ((int)a == B) + // expected-warning {{comparison of integers of different signs}}
- ((short)a == B) + // expected-warning {{comparison of integers of different signs}}
- (a == (unsigned int) B) + // expected-warning {{comparison of integers of different signs}}
- (a == (unsigned short) B); // expected-warning {{comparison of integers of different signs}}
-
- // Should be able to prove all of these are non-negative.
- return (b == (long) B) +
- (b == (int) B) +
- (b == (short) B);
+ enum EnumA {A};
+ enum EnumB {B};
+ enum EnumC {C = 0x10000};
+ return
+ // (a,b)
+ (a == (unsigned long) b) + // expected-warning {{comparison of integers of different signs}}
+ (a == (unsigned int) b) +
+ (a == (unsigned short) b) +
+ (a == (unsigned char) b) +
+ ((long) a == b) + // expected-warning {{comparison of integers of different signs}}
+ ((int) a == b) + // expected-warning {{comparison of integers of different signs}}
+ ((short) a == b) + // expected-warning {{comparison of integers of different signs}}
+ ((signed char) a == b) + // expected-warning {{comparison of integers of different signs}}
+ ((long) a == (unsigned long) b) + // expected-warning {{comparison of integers of different signs}}
+ ((int) a == (unsigned int) b) + // expected-warning {{comparison of integers of different signs}}
+ ((short) a == (unsigned short) b) + // expected-warning {{comparison of integers of different signs}}
+ ((signed char) a == (unsigned char) b) + // expected-warning {{comparison of integers of different signs}}
+ (a < (unsigned long) b) + // expected-warning {{comparison of integers of different signs}}
+ (a < (unsigned int) b) +
+ (a < (unsigned short) b) +
+ (a < (unsigned char) b) +
+ ((long) a < b) + // expected-warning {{comparison of integers of different signs}}
+ ((int) a < b) + // expected-warning {{comparison of integers of different signs}}
+ ((short) a < b) + // expected-warning {{comparison of integers of different signs}}
+ ((signed char) a < b) + // expected-warning {{comparison of integers of different signs}}
+ ((long) a < (unsigned long) b) + // expected-warning {{comparison of integers of different signs}}
+ ((int) a < (unsigned int) b) + // expected-warning {{comparison of integers of different signs}}
+ ((short) a < (unsigned short) b) + // expected-warning {{comparison of integers of different signs}}
+ ((signed char) a < (unsigned char) b) + // expected-warning {{comparison of integers of different signs}}
+
+ // (A,b)
+ (A == (unsigned long) b) +
+ (A == (unsigned int) b) +
+ (A == (unsigned short) b) +
+ (A == (unsigned char) b) +
+ ((long) A == b) +
+ ((int) A == b) +
+ ((short) A == b) +
+ ((signed char) A == b) +
+ ((long) A == (unsigned long) b) +
+ ((int) A == (unsigned int) b) +
+ ((short) A == (unsigned short) b) +
+ ((signed char) A == (unsigned char) b) +
+ (A < (unsigned long) b) +
+ (A < (unsigned int) b) +
+ (A < (unsigned short) b) + // expected-warning {{comparison of integers of different signs}}
+ (A < (unsigned char) b) + // expected-warning {{comparison of integers of different signs}}
+ ((long) A < b) +
+ ((int) A < b) +
+ ((short) A < b) +
+ ((signed char) A < b) +
+ ((long) A < (unsigned long) b) +
+ ((int) A < (unsigned int) b) +
+ ((short) A < (unsigned short) b) +
+ ((signed char) A < (unsigned char) b) +
+
+ // (a,B)
+ (a == (unsigned long) B) +
+ (a == (unsigned int) B) +
+ (a == (unsigned short) B) +
+ (a == (unsigned char) B) +
+ ((long) a == B) +
+ ((int) a == B) +
+ ((short) a == B) +
+ ((signed char) a == B) +
+ ((long) a == (unsigned long) B) +
+ ((int) a == (unsigned int) B) +
+ ((short) a == (unsigned short) B) +
+ ((signed char) a == (unsigned char) B) +
+ (a < (unsigned long) B) + // expected-warning {{comparison of integers of different signs}}
+ (a < (unsigned int) B) +
+ (a < (unsigned short) B) +
+ (a < (unsigned char) B) +
+ ((long) a < B) +
+ ((int) a < B) + // expected-warning {{comparison of integers of different signs}}
+ ((short) a < B) + // expected-warning {{comparison of integers of different signs}}
+ ((signed char) a < B) + // expected-warning {{comparison of integers of different signs}}
+ ((long) a < (unsigned long) B) + // expected-warning {{comparison of integers of different signs}}
+ ((int) a < (unsigned int) B) + // expected-warning {{comparison of integers of different signs}}
+ ((short) a < (unsigned short) B) + // expected-warning {{comparison of integers of different signs}}
+ ((signed char) a < (unsigned char) B) + // expected-warning {{comparison of integers of different signs}}
+
+ // (C,b)
+ (C == (unsigned long) b) +
+ (C == (unsigned int) b) +
+ (C == (unsigned short) b) +
+ (C == (unsigned char) b) +
+ ((long) C == b) +
+ ((int) C == b) +
+ ((short) C == b) +
+ ((signed char) C == b) +
+ ((long) C == (unsigned long) b) +
+ ((int) C == (unsigned int) b) +
+ ((short) C == (unsigned short) b) +
+ ((signed char) C == (unsigned char) b) +
+ (C < (unsigned long) b) +
+ (C < (unsigned int) b) +
+ (C < (unsigned short) b) + // expected-warning {{comparison of integers of different signs}}
+ (C < (unsigned char) b) + // expected-warning {{comparison of integers of different signs}}
+ ((long) C < b) +
+ ((int) C < b) +
+ ((short) C < b) +
+ ((signed char) C < b) +
+ ((long) C < (unsigned long) b) +
+ ((int) C < (unsigned int) b) +
+ ((short) C < (unsigned short) b) +
+ ((signed char) C < (unsigned char) b) +
+
+ // (a,C)
+ (a == (unsigned long) C) +
+ (a == (unsigned int) C) +
+ (a == (unsigned short) C) +
+ (a == (unsigned char) C) +
+ ((long) a == C) +
+ ((int) a == C) +
+ ((short) a == C) +
+ ((signed char) a == C) +
+ ((long) a == (unsigned long) C) +
+ ((int) a == (unsigned int) C) +
+ ((short) a == (unsigned short) C) +
+ ((signed char) a == (unsigned char) C) +
+ (a < (unsigned long) C) + // expected-warning {{comparison of integers of different signs}}
+ (a < (unsigned int) C) +
+ (a < (unsigned short) C) +
+ (a < (unsigned char) C) +
+ ((long) a < C) +
+ ((int) a < C) + // expected-warning {{comparison of integers of different signs}}
+ ((short) a < C) + // expected-warning {{comparison of integers of different signs}}
+ ((signed char) a < C) + // expected-warning {{comparison of integers of different signs}}
+ ((long) a < (unsigned long) C) + // expected-warning {{comparison of integers of different signs}}
+ ((int) a < (unsigned int) C) + // expected-warning {{comparison of integers of different signs}}
+ ((short) a < (unsigned short) C) + // expected-warning {{comparison of integers of different signs}}
+ ((signed char) a < (unsigned char) C) + // expected-warning {{comparison of integers of different signs}}
+
+ // (0x80000,b)
+ (0x80000 == (unsigned long) b) +
+ (0x80000 == (unsigned int) b) +
+ (0x80000 == (unsigned short) b) +
+ (0x80000 == (unsigned char) b) +
+ ((long) 0x80000 == b) +
+ ((int) 0x80000 == b) +
+ ((short) 0x80000 == b) +
+ ((signed char) 0x80000 == b) +
+ ((long) 0x80000 == (unsigned long) b) +
+ ((int) 0x80000 == (unsigned int) b) +
+ ((short) 0x80000 == (unsigned short) b) +
+ ((signed char) 0x80000 == (unsigned char) b) +
+ (0x80000 < (unsigned long) b) +
+ (0x80000 < (unsigned int) b) +
+ (0x80000 < (unsigned short) b) +
+ (0x80000 < (unsigned char) b) +
+ ((long) 0x80000 < b) +
+ ((int) 0x80000 < b) +
+ ((short) 0x80000 < b) +
+ ((signed char) 0x80000 < b) +
+ ((long) 0x80000 < (unsigned long) b) +
+ ((int) 0x80000 < (unsigned int) b) +
+ ((short) 0x80000 < (unsigned short) b) +
+ ((signed char) 0x80000 < (unsigned char) b) +
+
+ // (a,0x80000)
+ (a == (unsigned long) 0x80000) +
+ (a == (unsigned int) 0x80000) +
+ (a == (unsigned short) 0x80000) +
+ (a == (unsigned char) 0x80000) +
+ ((long) a == 0x80000) +
+ ((int) a == 0x80000) +
+ ((short) a == 0x80000) +
+ ((signed char) a == 0x80000) +
+ ((long) a == (unsigned long) 0x80000) +
+ ((int) a == (unsigned int) 0x80000) +
+ ((short) a == (unsigned short) 0x80000) +
+ ((signed char) a == (unsigned char) 0x80000) +
+ (a < (unsigned long) 0x80000) + // expected-warning {{comparison of integers of different signs}}
+ (a < (unsigned int) 0x80000) +
+ (a < (unsigned short) 0x80000) +
+ (a < (unsigned char) 0x80000) +
+ ((long) a < 0x80000) +
+ ((int) a < 0x80000) +
+ ((short) a < 0x80000) +
+ ((signed char) a < 0x80000) +
+ ((long) a < (unsigned long) 0x80000) + // expected-warning {{comparison of integers of different signs}}
+ ((int) a < (unsigned int) 0x80000) + // expected-warning {{comparison of integers of different signs}}
+ ((short) a < (unsigned short) 0x80000) + // expected-warning {{comparison of integers of different signs}}
+ ((signed char) a < (unsigned char) 0x80000) + // expected-warning {{comparison of integers of different signs}}
+
+ 10
+ ;
}
diff --git a/test/SemaCXX/composite-pointer-type.cpp b/test/SemaCXX/composite-pointer-type.cpp
index ebc40c1..1eec525 100644
--- a/test/SemaCXX/composite-pointer-type.cpp
+++ b/test/SemaCXX/composite-pointer-type.cpp
@@ -32,4 +32,14 @@ int ptrcmp1(void *a, int *b) {
}
int ptrcmp2(long *a, int *b) {
return a < b; // expected-error{{distinct}}
-} \ No newline at end of file
+}
+
+// PR5509 - Multi-level pointers
+int f2() {
+ typedef int *IntPtr;
+ typedef IntPtr *IntPtrPtr;
+ typedef IntPtr const *IntPtrConstPtr;
+ IntPtrConstPtr i = 0;
+ IntPtrPtr j = 0;
+ return i != j;
+}
diff --git a/test/SemaCXX/conditional-expr.cpp b/test/SemaCXX/conditional-expr.cpp
index da2dd67..f76472bf 100644
--- a/test/SemaCXX/conditional-expr.cpp
+++ b/test/SemaCXX/conditional-expr.cpp
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fsyntax-only -verify -faccess-control -std=c++0x %s
+// RUN: clang-cc -fsyntax-only -verify -faccess-control -std=c++0x -Wsign-compare %s
// C++ rules for ?: are a lot stricter than C rules, and have to take into
// account more conversion options.
diff --git a/test/SemaCXX/constructor-initializer.cpp b/test/SemaCXX/constructor-initializer.cpp
index 20cf35b..4318601 100644
--- a/test/SemaCXX/constructor-initializer.cpp
+++ b/test/SemaCXX/constructor-initializer.cpp
@@ -99,7 +99,9 @@ struct Current : Derived {
// FIXME. This is bad message!
struct M { // expected-note {{candidate function}} \
- // expected-note {{candidate function}}
+ // expected-note {{candidate function}} \
+ // expected-note {{declared here}} \
+ // expected-note {{declared here}}
M(int i, int j); // expected-note {{candidate function}} \
// // expected-note {{candidate function}}
};
@@ -110,9 +112,10 @@ struct N : M {
M m1;
};
-struct P : M { // expected-error {{default constructor for 'struct M' is missing in initialization of base class}}
- P() { }
- M m; // expected-error {{default constructor for 'struct M' is missing in initialization of member}}
+struct P : M {
+ P() { } // expected-error {{base class 'struct M'}} \
+ // expected-error {{member 'm'}}
+ M m; // expected-note {{member is declared here}}
};
struct Q {
@@ -155,3 +158,18 @@ class CopyConstructorTest {
B(B), // expected-warning {{field is uninitialized when used here}}
C(rhs.C || C) { } // expected-warning {{field is uninitialized when used here}}
};
+
+// Make sure we aren't marking default constructors when we shouldn't be.
+template<typename T>
+struct NDC {
+ T &ref;
+
+ NDC() { }
+ NDC(T &ref) : ref(ref) { }
+};
+
+struct X0 : NDC<int> {
+ X0(int &ref) : NDC<int>(ref), ndc(ref) { }
+
+ NDC<int> ndc;
+};
diff --git a/test/SemaCXX/conversion-function.cpp b/test/SemaCXX/conversion-function.cpp
index 6182678..c0c318e 100644
--- a/test/SemaCXX/conversion-function.cpp
+++ b/test/SemaCXX/conversion-function.cpp
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fsyntax-only -verify %s
+// RUN: clang-cc -fsyntax-only -verify %s
class X {
public:
operator bool();
@@ -93,3 +93,31 @@ void f(Yb& a) {
char ch = a; // OK. calls Yb::operator char();
}
+// Test conversion + copy construction.
+class AutoPtrRef { };
+
+class AutoPtr {
+ // FIXME: Using 'unavailable' since we do not have access control yet.
+ // FIXME: The error message isn't so good.
+ AutoPtr(AutoPtr &) __attribute__((unavailable));
+
+public:
+ AutoPtr();
+ AutoPtr(AutoPtrRef);
+
+ operator AutoPtrRef();
+};
+
+AutoPtr make_auto_ptr();
+
+AutoPtr test_auto_ptr(bool Cond) {
+ AutoPtr p1( make_auto_ptr() );
+
+ AutoPtr p;
+ if (Cond)
+ return p; // expected-error{{incompatible type returning}}
+
+ return AutoPtr();
+}
+
+
diff --git a/test/SemaCXX/decltype-this.cpp b/test/SemaCXX/decltype-this.cpp
index fc00106..c6bf299 100644
--- a/test/SemaCXX/decltype-this.cpp
+++ b/test/SemaCXX/decltype-this.cpp
@@ -1,4 +1,5 @@
-// RUN: clang-cc -fsyntax-only -verify -std=c++0x %t
+// RUN: clang-cc -fsyntax-only -verify -std=c++0x %s
+
template<typename T, typename U> struct is_same {
static const bool value = false;
};
diff --git a/test/SemaCXX/default-constructor-initializers.cpp b/test/SemaCXX/default-constructor-initializers.cpp
index 6cbb978..6adcdca 100644
--- a/test/SemaCXX/default-constructor-initializers.cpp
+++ b/test/SemaCXX/default-constructor-initializers.cpp
@@ -9,18 +9,18 @@ struct X2 : X1 { // expected-note {{'struct X2' declared here}} \
X2(int);
};
-struct X3 : public X2 {
+struct X3 : public X2 { // expected-error {{must explicitly initialize the base class 'struct X2'}}
};
-X3 x3; // expected-error {{cannot define the implicit default constructor for 'struct X3', because base class 'struct X2' does not have any default constructor}}
+X3 x3; // expected-note {{first required here}}
-struct X4 {
+struct X4 { // expected-error {{must explicitly initialize the member 'x2'}} \
+ // expected-error {{must explicitly initialize the reference member 'rx2'}}
X2 x2; // expected-note {{member is declared here}}
X2 & rx2; // expected-note {{declared at}}
};
-X4 x4; // expected-error {{cannot define the implicit default constructor for 'struct X4', because member's type 'struct X2' does not have any default constructor}} \
- // expected-error {{cannot define the implicit default constructor for 'struct X4', because reference member 'rx2' cannot be default-initialized}}
+X4 x4; // expected-note {{first required here}}
struct Y1 { // has no implicit default constructor
@@ -45,12 +45,12 @@ Y4 y4;
// More tests
-struct Z1 {
+struct Z1 { // expected-error {{must explicitly initialize the reference member 'z'}} \
+ // expected-error {{must explicitly initialize the const member 'c1'}}
int& z; // expected-note {{declared at}}
const int c1; // expected-note {{declared at}}
volatile int v1;
};
-Z1 z1; // expected-error {{cannot define the implicit default constructor for 'struct Z1', because reference member 'z' cannot be default-initialized}} \
- // expected-error {{cannot define the implicit default constructor for 'struct Z1', because const member 'c1' cannot be default-initialized}}
+Z1 z1; // expected-note {{first required here}}
diff --git a/test/SemaCXX/dependent-types.cpp b/test/SemaCXX/dependent-types.cpp
index b2a5c45..3003125 100644
--- a/test/SemaCXX/dependent-types.cpp
+++ b/test/SemaCXX/dependent-types.cpp
@@ -4,7 +4,7 @@ template<typename T, int Size> void f() {
T x1;
T* x2;
T& x3; // expected-error{{declaration of reference variable 'x3' requires an initializer}}
- T x4[]; // expected-error{{variable has incomplete type 'T []'}}
+ T x4[]; // expected-error{{needs an explicit size or an initializer}}
T x5[Size];
int x6[Size];
}
diff --git a/test/SemaCXX/format-attribute.cpp b/test/SemaCXX/format-attribute.cpp
new file mode 100644
index 0000000..a21ebe1
--- /dev/null
+++ b/test/SemaCXX/format-attribute.cpp
@@ -0,0 +1,8 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+// PR5521
+struct A { void a(const char*,...) __attribute((format(printf,2,3))); };
+void b(A x) {
+ x.a("%d", 3);
+}
+struct X { void a(const char*,...) __attribute((format(printf,1,3))); }; // expected-error {{format argument not a string type}}
diff --git a/test/SemaCXX/friend-class-nodecl.cpp b/test/SemaCXX/friend-class-nodecl.cpp
index de12eaf..13330f8 100644
--- a/test/SemaCXX/friend-class-nodecl.cpp
+++ b/test/SemaCXX/friend-class-nodecl.cpp
@@ -1,4 +1,4 @@
-// RUN: clang-cc -ast-print %s -o %t &&
+// RUN: clang-cc -ast-print %s -o %t
// RUN: not grep '^ *class B' %t
// Tests that the tag decls in friend declarations aren't added to the
diff --git a/test/SemaCXX/linkage-spec.cpp b/test/SemaCXX/linkage-spec.cpp
index b4c72f5..fc9b3ab 100644
--- a/test/SemaCXX/linkage-spec.cpp
+++ b/test/SemaCXX/linkage-spec.cpp
@@ -32,4 +32,11 @@ extern "C++" {
int foo(int x) { return x; }
};
}
-} \ No newline at end of file
+}
+
+// PR5430
+namespace pr5430 {
+ extern "C" void func(void);
+}
+using namespace pr5430;
+extern "C" void pr5430::func(void) { }
diff --git a/test/SemaCXX/member-expr.cpp b/test/SemaCXX/member-expr.cpp
index 069f526..cd13bcc 100644
--- a/test/SemaCXX/member-expr.cpp
+++ b/test/SemaCXX/member-expr.cpp
@@ -28,8 +28,7 @@ struct B {
A *f0();
};
int f0(B *b) {
- return b->f0->f0; // expected-error{{member reference base type 'struct A *()' is not a structure or union}} \
- // expected-note{{perhaps you meant to call this function}}
+ return b->f0->f0; // expected-error{{perhaps you meant to call this function}}
}
int i;
diff --git a/test/SemaCXX/member-pointer-size.cpp b/test/SemaCXX/member-pointer-size.cpp
index f86e72b..952027d 100644
--- a/test/SemaCXX/member-pointer-size.cpp
+++ b/test/SemaCXX/member-pointer-size.cpp
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple x86_64-unknown-unknown %s -fsyntax-only -verify &&
+// RUN: clang-cc -triple x86_64-unknown-unknown %s -fsyntax-only -verify
// RUN: clang-cc -triple i686-unknown-unknown %s -fsyntax-only -verify
#include <stddef.h>
diff --git a/test/SemaCXX/new-delete.cpp b/test/SemaCXX/new-delete.cpp
index 6f3e9ef..ededfc0 100644
--- a/test/SemaCXX/new-delete.cpp
+++ b/test/SemaCXX/new-delete.cpp
@@ -119,13 +119,13 @@ void test_delete_conv(X0 x0, X1 x1, X2 x2) {
// PR4782
class X3 {
public:
- static void operator delete(void * mem, unsigned long size);
+ static void operator delete(void * mem, size_t size);
};
class X4 {
public:
static void release(X3 *x);
- static void operator delete(void * mem, unsigned long size);
+ static void operator delete(void * mem, size_t size);
};
@@ -137,3 +137,56 @@ class X5 {
public:
void Destroy() const { delete this; }
};
+
+class Base {
+public:
+ static int operator new(signed char) throw(); // expected-error {{'operator new' takes type size_t}} \
+ // expected-error {{operator new' must return type 'void *'}}
+ static int operator new[] (signed char) throw(); // expected-error {{'operator new[]' takes type size_t}} \
+ // expected-error {{operator new[]' must return type 'void *'}}
+};
+
+class Tier {};
+class Comp : public Tier {};
+
+class Thai : public Base {
+public:
+ Thai(const Tier *adoptDictionary);
+};
+
+void loadEngineFor() {
+ const Comp *dict;
+ new Thai(dict);
+}
+
+template <class T> struct TBase {
+ void* operator new(T size, int); // expected-error {{'operator new' takes type size_t}}
+};
+
+TBase<int> t1; // expected-note {{in instantiation of template class 'struct TBase<int>' requested here}}
+
+class X6 {
+public:
+ static void operator delete(void*, int); // expected-note {{member found by ambiguous name lookup}}
+};
+
+class X7 {
+public:
+ static void operator delete(void*, int); // expected-note {{member found by ambiguous name lookup}}
+};
+
+class X8 : public X6, public X7 {
+};
+
+void f(X8 *x8) {
+ delete x8; // expected-error {{member 'operator delete' found in multiple base classes of different types}}
+}
+
+class X9 {
+ static void operator delete(void*, int); // expected-note {{'operator delete' declared here}}
+ static void operator delete(void*, float); // expected-note {{'operator delete' declared here}}
+};
+
+void f(X9 *x9) {
+ delete x9; // expected-error {{no suitable member 'operator delete' in 'X9'}}
+}
diff --git a/test/SemaCXX/overload-call.cpp b/test/SemaCXX/overload-call.cpp
index 94f352e..3a0bf30 100644
--- a/test/SemaCXX/overload-call.cpp
+++ b/test/SemaCXX/overload-call.cpp
@@ -278,3 +278,16 @@ float& db_rebind(Z&);
void db_rebind_test(Z2 z2) {
float& f1 = db_rebind(z2);
}
+
+class string { };
+class opt : public string { };
+
+struct SR {
+ SR(const string&);
+};
+
+void f(SR) { }
+
+void g(opt o) {
+ f(o);
+}
diff --git a/test/SemaCXX/overloaded-builtin-operators.cpp b/test/SemaCXX/overloaded-builtin-operators.cpp
index 13777da..fd0cbc6 100644
--- a/test/SemaCXX/overloaded-builtin-operators.cpp
+++ b/test/SemaCXX/overloaded-builtin-operators.cpp
@@ -175,3 +175,16 @@ void test_dr425(A a) {
(void)(1.0f * a); // expected-error{{ambiguous}} \
// expected-note 81{{candidate}}
}
+
+// pr5432
+enum e {X};
+
+const int a[][2] = {{1}};
+
+int test_pr5432() {
+ return a[X][X];
+}
+
+void f() {
+ (void)__extension__(A());
+}
diff --git a/test/SemaCXX/overloaded-operator.cpp b/test/SemaCXX/overloaded-operator.cpp
index 750038d..7762667 100644
--- a/test/SemaCXX/overloaded-operator.cpp
+++ b/test/SemaCXX/overloaded-operator.cpp
@@ -164,7 +164,11 @@ struct Callable2 {
double& operator()(...) const;
};
-void test_callable(Callable c, Callable2 c2, const Callable2& c2c) {
+struct DerivesCallable : public Callable {
+};
+
+void test_callable(Callable c, Callable2 c2, const Callable2& c2c,
+ DerivesCallable dc) {
int &ir = c(1);
float &fr = c(1, 3.14159, 17, 42);
@@ -175,6 +179,9 @@ void test_callable(Callable c, Callable2 c2, const Callable2& c2c) {
int &ir2 = c2();
int &ir3 = c2(1);
double &fr2 = c2c();
+
+ int &ir4 = dc(17);
+ double &fr3 = dc(3.14159f);
}
typedef float FLOAT;
diff --git a/test/SemaCXX/pseudo-destructors.cpp b/test/SemaCXX/pseudo-destructors.cpp
index 1f05e81..0850c44 100644
--- a/test/SemaCXX/pseudo-destructors.cpp
+++ b/test/SemaCXX/pseudo-destructors.cpp
@@ -37,4 +37,4 @@ typedef int Integer;
void destroy_without_call(int *ip) {
ip->~Integer; // expected-error{{called immediately}}
-} \ No newline at end of file
+}
diff --git a/test/SemaCXX/static-cast.cpp b/test/SemaCXX/static-cast.cpp
index d816c05..d396272 100644
--- a/test/SemaCXX/static-cast.cpp
+++ b/test/SemaCXX/static-cast.cpp
@@ -1,11 +1,10 @@
// RUN: clang-cc -fsyntax-only -verify -faccess-control %s
-
struct A {};
struct B : public A {}; // Single public base.
struct C1 : public virtual B {}; // Single virtual base.
struct C2 : public virtual B {};
struct D : public C1, public C2 {}; // Diamond
-struct E : private A {}; // Single private base. expected-note 2 {{'private' inheritance specifier here}}
+struct E : private A {}; // Single private base. expected-note 3 {{'private' inheritance specifier here}}
struct F : public C1 {}; // Single path to B with virtual.
struct G1 : public B {};
struct G2 : public B {};
@@ -57,8 +56,8 @@ void t_529_2()
// Bad code below
(void)static_cast<void*>((const int*)0); // expected-error {{static_cast from 'int const *' to 'void *' is not allowed}}
- //(void)static_cast<A*>((E*)0); // {{static_cast from 'struct E *' to 'struct A *' is not allowed}}
- //(void)static_cast<A*>((H*)0); // {{static_cast from 'struct H *' to 'struct A *' is not allowed}}
+ (void)static_cast<A*>((E*)0); // expected-error {{inaccessible base class 'struct A'}}
+ (void)static_cast<A*>((H*)0); // expected-error {{ambiguous conversion}}
(void)static_cast<int>((int*)0); // expected-error {{static_cast from 'int *' to 'int' is not allowed}}
(void)static_cast<A**>((B**)0); // expected-error {{static_cast from 'struct B **' to 'struct A **' is not allowed}}
(void)static_cast<char&>(i); // expected-error {{non-const lvalue reference to type 'char' cannot be initialized with a value of type 'int'}}
@@ -144,3 +143,38 @@ namespace pr5261 {
};
outer<int> EntryList;
}
+
+
+// Initialization by constructor
+struct X0;
+
+struct X1 {
+ X1();
+ X1(X1&);
+ X1(const X0&);
+
+ operator X0() const;
+};
+
+struct X0 { };
+
+void test_ctor_init() {
+ (void)static_cast<X1>(X1());
+}
+
+// Casting away constness
+struct X2 {
+};
+
+struct X3 : X2 {
+};
+
+struct X4 {
+ typedef const X3 X3_typedef;
+
+ void f() const {
+ (void)static_cast<X3_typedef*>(x2);
+ }
+
+ const X2 *x2;
+};
diff --git a/test/SemaCXX/using-decl-1.cpp b/test/SemaCXX/using-decl-1.cpp
index 37e101e..42deb27 100644
--- a/test/SemaCXX/using-decl-1.cpp
+++ b/test/SemaCXX/using-decl-1.cpp
@@ -17,3 +17,24 @@ namespace N {
void f(int) { } // expected-error{{redefinition}}
}
+
+namespace N {
+ void f(double);
+ void f(long);
+}
+
+struct X0 {
+ void operator()(int);
+ void operator()(long);
+};
+
+struct X1 : X0 {
+ // FIXME: give this operator() a 'float' parameter to test overloading
+ // behavior. It currently fails.
+ void operator()();
+ using X0::operator();
+
+ void test() {
+ (*this)(1);
+ }
+};
diff --git a/test/SemaCXX/using-decl-templates.cpp b/test/SemaCXX/using-decl-templates.cpp
index 1a53704..684009b 100644
--- a/test/SemaCXX/using-decl-templates.cpp
+++ b/test/SemaCXX/using-decl-templates.cpp
@@ -2,12 +2,12 @@
template<typename T> struct A {
void f() { }
- struct N { };
+ struct N { }; // expected-note{{target of using declaration}}
};
template<typename T> struct B : A<T> {
using A<T>::f;
- using A<T>::N;
+ using A<T>::N; // expected-error{{dependent using declaration resolved to type without 'typename'}}
using A<T>::foo; // expected-error{{no member named 'foo'}}
using A<double>::f; // expected-error{{using declaration refers into 'A<double>::', which is not a base class of 'B'}}
diff --git a/test/SemaCXX/value-initialization.cpp b/test/SemaCXX/value-initialization.cpp
index 29d866f..25d7084 100644
--- a/test/SemaCXX/value-initialization.cpp
+++ b/test/SemaCXX/value-initialization.cpp
@@ -1,10 +1,10 @@
// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x
-struct A {
+struct A { // expected-error {{implicit default constructor for 'struct A' must explicitly initialize the const member 'i'}}
const int i; // expected-note {{declared at}}
virtual void f() { }
};
int main () {
- (void)A(); // expected-error {{cannot define the implicit default constructor for 'struct A', because const member 'i' cannot be default-initialized}}
+ (void)A(); // expected-note {{first required here}}
}
diff --git a/test/SemaCXX/vararg-default-arg.cpp b/test/SemaCXX/vararg-default-arg.cpp
new file mode 100644
index 0000000..5ba0320
--- /dev/null
+++ b/test/SemaCXX/vararg-default-arg.cpp
@@ -0,0 +1,10 @@
+// RUN: clang-cc %s -verify -fsyntax-only
+// PR5462
+
+void f1(void);
+void f2(const char * = __null, ...);
+
+void f1(void)
+{
+ f2();
+}
diff --git a/test/SemaCXX/vararg-non-pod.cpp b/test/SemaCXX/vararg-non-pod.cpp
index 390f58b..977df14 100644
--- a/test/SemaCXX/vararg-non-pod.cpp
+++ b/test/SemaCXX/vararg-non-pod.cpp
@@ -65,4 +65,4 @@ void t5()
E e(10, c); // expected-warning{{cannot pass object of non-POD type 'class C' through variadic constructor; call will abort at runtime}}
(void)E(10, c); // expected-warning{{cannot pass object of non-POD type 'class C' through variadic constructor; call will abort at runtime}}
-} \ No newline at end of file
+}
diff --git a/test/SemaCXX/warn-for-var-in-else.cpp b/test/SemaCXX/warn-for-var-in-else.cpp
index f73c606..c46b306 100644
--- a/test/SemaCXX/warn-for-var-in-else.cpp
+++ b/test/SemaCXX/warn-for-var-in-else.cpp
@@ -2,6 +2,7 @@
// rdar://6425550
int bar();
void do_something(int);
+int *get_ptr();
int foo() {
if (int X = bar()) {
@@ -25,7 +26,20 @@ bool foo2() {
do_something(B); // expected-warning{{'B' is always false in this context}}
} else if (B2) { // expected-warning{{'B2' is always false in this context}}
do_something(B); // expected-warning{{'B' is always false in this context}}
+ do_something(B2); // expected-warning{{'B2' is always false in this context}}
}
return B; // expected-warning{{'B' is always false in this context}}
}
}
+
+void foo3() {
+ if (int *P1 = get_ptr())
+ do_something(*P1);
+ else if (int *P2 = get_ptr()) {
+ do_something(*P1); // expected-warning{{'P1' is always NULL in this context}}
+ do_something(*P2);
+ } else {
+ do_something(*P1); // expected-warning{{'P1' is always NULL in this context}}
+ do_something(*P2); // expected-warning{{'P2' is always NULL in this context}}
+ }
+}
diff --git a/test/SemaCXX/warn-unused-variables.cpp b/test/SemaCXX/warn-unused-variables.cpp
index d8b9a00..0198636 100644
--- a/test/SemaCXX/warn-unused-variables.cpp
+++ b/test/SemaCXX/warn-unused-variables.cpp
@@ -4,3 +4,31 @@ template<typename T> void f() {
T t;
t = 17;
}
+
+// PR5407
+struct A { A(); };
+struct B { ~B(); };
+void f() {
+ A a;
+ B b;
+}
+
+// PR5531
+namespace PR5531 {
+ struct A {
+ };
+
+ struct B {
+ B(int);
+ };
+
+ struct C {
+ ~C();
+ };
+
+ void test() {
+ A();
+ B(17);
+ C();
+ }
+}
diff --git a/test/SemaObjC/atomoic-property-synnthesis-rules.m b/test/SemaObjC/atomoic-property-synnthesis-rules.m
new file mode 100644
index 0000000..429d6c0
--- /dev/null
+++ b/test/SemaObjC/atomoic-property-synnthesis-rules.m
@@ -0,0 +1,369 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+/*
+ Conditions for warning:
+ 1. the property is atomic
+ 2. the current @implementation contains an @synthesize for the property
+ 3. the current @implementation contains a hand-written setter XOR getter
+ 4. the property is read-write
+
+ Cases marked WARN should warn one the following:
+ warning: Atomic property 'x' has a synthesized setter and a
+ manually-implemented getter, which may break atomicity.
+ warning: Atomic property 'x' has a synthesized getter and a
+ manually-implemented setter, which may break atomicity.
+
+ Cases not marked WARN only satisfy the indicated subset
+ of the conditions required to warn.
+
+ There should be 8 warnings.
+*/
+
+@interface Foo
+{
+ /* 12 4 */ int GetSet;
+ /* WARN */ int Get;
+ /* WARN */ int Set;
+ /* 12 4 */ int None;
+ /* 2 4 */ int GetSet_Nonatomic;
+ /* 234 */ int Get_Nonatomic;
+ /* 234 */ int Set_Nonatomic;
+ /* 2 4 */ int None_Nonatomic;
+
+ /* 12 */ int GetSet_ReadOnly;
+ /* 123 */ int Get_ReadOnly;
+ /* 123 */ int Set_ReadOnly;
+ /* 12 */ int None_ReadOnly;
+ /* 2 */ int GetSet_Nonatomic_ReadOnly;
+ /* 23 */ int Get_Nonatomic_ReadOnly;
+ /* 23 */ int Set_Nonatomic_ReadOnly;
+ /* 2 */ int None_Nonatomic_ReadOnly;
+
+ /* 12 4 */ int GetSet_ReadWriteInExt;
+ /* WARN */ int Get_ReadWriteInExt;
+ /* WARN */ int Set_ReadWriteInExt;
+ /* 12 4 */ int None_ReadWriteInExt;
+ /* 2 4 */ int GetSet_Nonatomic_ReadWriteInExt;
+ /* 234 */ int Get_Nonatomic_ReadWriteInExt;
+ /* 234 */ int Set_Nonatomic_ReadWriteInExt;
+ /* 2 4 */ int None_Nonatomic_ReadWriteInExt;
+
+
+ /* 12 4 */ int GetSet_LateSynthesize;
+ /* WARN */ int Get_LateSynthesize;
+ /* WARN */ int Set_LateSynthesize;
+ /* 12 4 */ int None_LateSynthesize;
+ /* 2 4 */ int GetSet_Nonatomic_LateSynthesize;
+ /* 234 */ int Get_Nonatomic_LateSynthesize;
+ /* 234 */ int Set_Nonatomic_LateSynthesize;
+ /* 2 4 */ int None_Nonatomic_LateSynthesize;
+
+ /* 12 */ int GetSet_ReadOnly_LateSynthesize;
+ /* 123 */ int Get_ReadOnly_LateSynthesize;
+ /* 123 */ int Set_ReadOnly_LateSynthesize;
+ /* 12 */ int None_ReadOnly_LateSynthesize;
+ /* 2 */ int GetSet_Nonatomic_ReadOnly_LateSynthesize;
+ /* 23 */ int Get_Nonatomic_ReadOnly_LateSynthesize;
+ /* 23 */ int Set_Nonatomic_ReadOnly_LateSynthesize;
+ /* 2 */ int None_Nonatomic_ReadOnly_LateSynthesize;
+
+ /* 12 4 */ int GetSet_ReadWriteInExt_LateSynthesize;
+ /* WARN */ int Get_ReadWriteInExt_LateSynthesize;
+ /* WARN */ int Set_ReadWriteInExt_LateSynthesize;
+ /* 12 4 */ int None_ReadWriteInExt_LateSynthesize;
+ /* 2 4 */ int GetSet_Nonatomic_ReadWriteInExt_LateSynthesize;
+ /* 234 */ int Get_Nonatomic_ReadWriteInExt_LateSynthesize;
+ /* 234 */ int Set_Nonatomic_ReadWriteInExt_LateSynthesize;
+ /* 2 4 */ int None_Nonatomic_ReadWriteInExt_LateSynthesize;
+
+
+ /* 1 4 */ int GetSet_NoSynthesize;
+ /* 1 34 */ int Get_NoSynthesize;
+ /* 1 34 */ int Set_NoSynthesize;
+ /* 1 4 */ int None_NoSynthesize;
+ /* 4 */ int GetSet_Nonatomic_NoSynthesize;
+ /* 34 */ int Get_Nonatomic_NoSynthesize;
+ /* 34 */ int Set_Nonatomic_NoSynthesize;
+ /* 4 */ int None_Nonatomic_NoSynthesize;
+
+ /* 1 */ int GetSet_ReadOnly_NoSynthesize;
+ /* 1 3 */ int Get_ReadOnly_NoSynthesize;
+ /* 1 3 */ int Set_ReadOnly_NoSynthesize;
+ /* 1 */ int None_ReadOnly_NoSynthesize;
+ /* */ int GetSet_Nonatomic_ReadOnly_NoSynthesize;
+ /* 3 */ int Get_Nonatomic_ReadOnly_NoSynthesize;
+ /* 3 */ int Set_Nonatomic_ReadOnly_NoSynthesize;
+ /* */ int None_Nonatomic_ReadOnly_NoSynthesize;
+
+ /* 1 4 */ int GetSet_ReadWriteInExt_NoSynthesize;
+ /* 1 34 */ int Get_ReadWriteInExt_NoSynthesize;
+ /* 1 34 */ int Set_ReadWriteInExt_NoSynthesize;
+ /* 1 4 */ int None_ReadWriteInExt_NoSynthesize;
+ /* 4 */ int GetSet_Nonatomic_ReadWriteInExt_NoSynthesize;
+ /* 34 */ int Get_Nonatomic_ReadWriteInExt_NoSynthesize;
+ /* 34 */ int Set_Nonatomic_ReadWriteInExt_NoSynthesize;
+ /* 4 */ int None_Nonatomic_ReadWriteInExt_NoSynthesize;
+}
+
+// read-write - might warn
+@property int GetSet;
+@property int Get; // expected-note {{property declared here}}
+@property int Set; // expected-note {{property declared here}}
+@property int None;
+@property(nonatomic) int GetSet_Nonatomic;
+@property(nonatomic) int Get_Nonatomic;
+@property(nonatomic) int Set_Nonatomic;
+@property(nonatomic) int None_Nonatomic;
+
+// read-only - must not warn
+@property(readonly) int GetSet_ReadOnly;
+@property(readonly) int Get_ReadOnly;
+@property(readonly) int Set_ReadOnly;
+@property(readonly) int None_ReadOnly;
+@property(nonatomic,readonly) int GetSet_Nonatomic_ReadOnly;
+@property(nonatomic,readonly) int Get_Nonatomic_ReadOnly;
+@property(nonatomic,readonly) int Set_Nonatomic_ReadOnly;
+@property(nonatomic,readonly) int None_Nonatomic_ReadOnly;
+
+// read-only in class, read-write in class extension - might warn
+@property(readonly) int GetSet_ReadWriteInExt;
+@property(readonly) int Get_ReadWriteInExt; // expected-note {{property declared here}}
+@property(readonly) int Set_ReadWriteInExt; // expected-note {{property declared here}}
+@property(readonly) int None_ReadWriteInExt;
+@property(nonatomic,readonly) int GetSet_Nonatomic_ReadWriteInExt;
+@property(nonatomic,readonly) int Get_Nonatomic_ReadWriteInExt;
+@property(nonatomic,readonly) int Set_Nonatomic_ReadWriteInExt;
+@property(nonatomic,readonly) int None_Nonatomic_ReadWriteInExt;
+
+
+// same as above, but @synthesize follows the hand-written methods - might warn
+@property int GetSet_LateSynthesize;
+@property int Get_LateSynthesize; // expected-note {{property declared here}}
+@property int Set_LateSynthesize; // expected-note {{property declared here}}
+@property int None_LateSynthesize;
+@property(nonatomic) int GetSet_Nonatomic_LateSynthesize;
+@property(nonatomic) int Get_Nonatomic_LateSynthesize;
+@property(nonatomic) int Set_Nonatomic_LateSynthesize;
+@property(nonatomic) int None_Nonatomic_LateSynthesize;
+
+@property(readonly) int GetSet_ReadOnly_LateSynthesize;
+@property(readonly) int Get_ReadOnly_LateSynthesize;
+@property(readonly) int Set_ReadOnly_LateSynthesize;
+@property(readonly) int None_ReadOnly_LateSynthesize;
+@property(nonatomic,readonly) int GetSet_Nonatomic_ReadOnly_LateSynthesize;
+@property(nonatomic,readonly) int Get_Nonatomic_ReadOnly_LateSynthesize;
+@property(nonatomic,readonly) int Set_Nonatomic_ReadOnly_LateSynthesize;
+@property(nonatomic,readonly) int None_Nonatomic_ReadOnly_LateSynthesize;
+
+@property(readonly) int GetSet_ReadWriteInExt_LateSynthesize;
+@property(readonly) int Get_ReadWriteInExt_LateSynthesize; // expected-note {{property declared here}}
+@property(readonly) int Set_ReadWriteInExt_LateSynthesize; // expected-note {{property declared here}}
+@property(readonly) int None_ReadWriteInExt_LateSynthesize;
+@property(nonatomic,readonly) int GetSet_Nonatomic_ReadWriteInExt_LateSynthesize;
+@property(nonatomic,readonly) int Get_Nonatomic_ReadWriteInExt_LateSynthesize;
+@property(nonatomic,readonly) int Set_Nonatomic_ReadWriteInExt_LateSynthesize;
+@property(nonatomic,readonly) int None_Nonatomic_ReadWriteInExt_LateSynthesize;
+
+
+// same as above, but with no @synthesize - must not warn
+@property int GetSet_NoSynthesize;
+@property int Get_NoSynthesize;
+@property int Set_NoSynthesize;
+@property int None_NoSynthesize;
+@property(nonatomic) int GetSet_Nonatomic_NoSynthesize;
+@property(nonatomic) int Get_Nonatomic_NoSynthesize;
+@property(nonatomic) int Set_Nonatomic_NoSynthesize;
+@property(nonatomic) int None_Nonatomic_NoSynthesize;
+
+@property(readonly) int GetSet_ReadOnly_NoSynthesize;
+@property(readonly) int Get_ReadOnly_NoSynthesize;
+@property(readonly) int Set_ReadOnly_NoSynthesize;
+@property(readonly) int None_ReadOnly_NoSynthesize;
+@property(nonatomic,readonly) int GetSet_Nonatomic_ReadOnly_NoSynthesize;
+@property(nonatomic,readonly) int Get_Nonatomic_ReadOnly_NoSynthesize;
+@property(nonatomic,readonly) int Set_Nonatomic_ReadOnly_NoSynthesize;
+@property(nonatomic,readonly) int None_Nonatomic_ReadOnly_NoSynthesize;
+
+@property(readonly) int GetSet_ReadWriteInExt_NoSynthesize;
+@property(readonly) int Get_ReadWriteInExt_NoSynthesize;
+@property(readonly) int Set_ReadWriteInExt_NoSynthesize;
+@property(readonly) int None_ReadWriteInExt_NoSynthesize;
+@property(nonatomic,readonly) int GetSet_Nonatomic_ReadWriteInExt_NoSynthesize;
+@property(nonatomic,readonly) int Get_Nonatomic_ReadWriteInExt_NoSynthesize;
+@property(nonatomic,readonly) int Set_Nonatomic_ReadWriteInExt_NoSynthesize;
+@property(nonatomic,readonly) int None_Nonatomic_ReadWriteInExt_NoSynthesize;
+
+@end
+
+
+@interface Foo ()
+
+@property(readwrite) int GetSet_ReadWriteInExt;
+@property(readwrite) int Get_ReadWriteInExt;
+@property(readwrite) int Set_ReadWriteInExt;
+@property(readwrite) int None_ReadWriteInExt;
+@property(nonatomic,readwrite) int GetSet_Nonatomic_ReadWriteInExt;
+@property(nonatomic,readwrite) int Get_Nonatomic_ReadWriteInExt;
+@property(nonatomic,readwrite) int Set_Nonatomic_ReadWriteInExt;
+@property(nonatomic,readwrite) int None_Nonatomic_ReadWriteInExt;
+
+@property(readwrite) int GetSet_ReadWriteInExt_LateSynthesize;
+@property(readwrite) int Get_ReadWriteInExt_LateSynthesize;
+@property(readwrite) int Set_ReadWriteInExt_LateSynthesize;
+@property(readwrite) int None_ReadWriteInExt_LateSynthesize;
+@property(nonatomic,readwrite) int GetSet_Nonatomic_ReadWriteInExt_LateSynthesize;
+@property(nonatomic,readwrite) int Get_Nonatomic_ReadWriteInExt_LateSynthesize;
+@property(nonatomic,readwrite) int Set_Nonatomic_ReadWriteInExt_LateSynthesize;
+@property(nonatomic,readwrite) int None_Nonatomic_ReadWriteInExt_LateSynthesize;
+
+@property(readwrite) int GetSet_ReadWriteInExt_NoSynthesize;
+@property(readwrite) int Get_ReadWriteInExt_NoSynthesize;
+@property(readwrite) int Set_ReadWriteInExt_NoSynthesize;
+@property(readwrite) int None_ReadWriteInExt_NoSynthesize;
+@property(nonatomic,readwrite) int GetSet_Nonatomic_ReadWriteInExt_NoSynthesize;
+@property(nonatomic,readwrite) int Get_Nonatomic_ReadWriteInExt_NoSynthesize;
+@property(nonatomic,readwrite) int Set_Nonatomic_ReadWriteInExt_NoSynthesize;
+@property(nonatomic,readwrite) int None_Nonatomic_ReadWriteInExt_NoSynthesize;
+
+@end
+
+@implementation Foo
+
+@synthesize GetSet, Get, Set, None, GetSet_Nonatomic, Get_Nonatomic, Set_Nonatomic, None_Nonatomic;
+@synthesize GetSet_ReadOnly, Get_ReadOnly, Set_ReadOnly, None_ReadOnly, GetSet_Nonatomic_ReadOnly, Get_Nonatomic_ReadOnly, Set_Nonatomic_ReadOnly, None_Nonatomic_ReadOnly;
+@synthesize GetSet_ReadWriteInExt, Get_ReadWriteInExt, Set_ReadWriteInExt, None_ReadWriteInExt, GetSet_Nonatomic_ReadWriteInExt, Get_Nonatomic_ReadWriteInExt, Set_Nonatomic_ReadWriteInExt, None_Nonatomic_ReadWriteInExt;
+
+#define GET(x) \
+ -(int) x { return self->x; }
+#define SET(x) \
+ -(void) set##x:(int)value { self->x = value; }
+
+GET(GetSet)
+SET(GetSet)
+GET(Get) // expected-warning {{writable atomic property 'Get' cannot pair a synthesized setter/getter with a user defined setter/getter}}
+SET(Set) // expected-warning {{writable atomic property 'Set' cannot pair a synthesized setter/getter with a user defined setter/getter}}
+GET(GetSet_Nonatomic)
+SET(GetSet_Nonatomic)
+GET(Get_Nonatomic)
+SET(Set_Nonatomic)
+
+GET(GetSet_ReadOnly)
+SET(GetSet_ReadOnly)
+GET(Get_ReadOnly)
+SET(Set_ReadOnly)
+GET(GetSet_Nonatomic_ReadOnly)
+SET(GetSet_Nonatomic_ReadOnly)
+GET(Get_Nonatomic_ReadOnly)
+SET(Set_Nonatomic_ReadOnly)
+
+GET(GetSet_ReadWriteInExt)
+SET(GetSet_ReadWriteInExt)
+GET(Get_ReadWriteInExt) // expected-warning {{writable atomic property 'Get_ReadWriteInExt' cannot pair a synthesized setter/getter with a user defined setter/getter}}
+SET(Set_ReadWriteInExt) // expected-warning {{writable atomic property 'Set_ReadWriteInExt' cannot pair a synthesized setter/getter with a user defined setter/getter}}
+GET(GetSet_Nonatomic_ReadWriteInExt)
+SET(GetSet_Nonatomic_ReadWriteInExt)
+GET(Get_Nonatomic_ReadWriteInExt)
+SET(Set_Nonatomic_ReadWriteInExt)
+
+
+GET(GetSet_LateSynthesize)
+SET(GetSet_LateSynthesize)
+GET(Get_LateSynthesize) // expected-warning {{writable atomic property 'Get_LateSynthesize' cannot pair a synthesized setter/getter with a user defined setter/getter}}
+SET(Set_LateSynthesize) // expected-warning {{writable atomic property 'Set_LateSynthesize' cannot pair a synthesized setter/getter with a user defined setter/getter}}
+GET(GetSet_Nonatomic_LateSynthesize)
+SET(GetSet_Nonatomic_LateSynthesize)
+GET(Get_Nonatomic_LateSynthesize)
+SET(Set_Nonatomic_LateSynthesize)
+
+GET(GetSet_ReadOnly_LateSynthesize)
+SET(GetSet_ReadOnly_LateSynthesize)
+GET(Get_ReadOnly_LateSynthesize)
+SET(Set_ReadOnly_LateSynthesize)
+GET(GetSet_Nonatomic_ReadOnly_LateSynthesize)
+SET(GetSet_Nonatomic_ReadOnly_LateSynthesize)
+GET(Get_Nonatomic_ReadOnly_LateSynthesize)
+SET(Set_Nonatomic_ReadOnly_LateSynthesize)
+
+GET(GetSet_ReadWriteInExt_LateSynthesize)
+SET(GetSet_ReadWriteInExt_LateSynthesize)
+GET(Get_ReadWriteInExt_LateSynthesize) // expected-warning {{writable atomic property 'Get_ReadWriteInExt_LateSynthesize' cannot pair a synthesized setter/getter with a user defined setter/getter}}
+SET(Set_ReadWriteInExt_LateSynthesize) // expected-warning {{writable atomic property 'Set_ReadWriteInExt_LateSynthesize' cannot pair a synthesized setter/getter with a user defined setter/getter}}
+GET(GetSet_Nonatomic_ReadWriteInExt_LateSynthesize)
+SET(GetSet_Nonatomic_ReadWriteInExt_LateSynthesize)
+GET(Get_Nonatomic_ReadWriteInExt_LateSynthesize)
+SET(Set_Nonatomic_ReadWriteInExt_LateSynthesize)
+
+
+GET(GetSet_NoSynthesize)
+SET(GetSet_NoSynthesize)
+GET(Get_NoSynthesize)
+SET(Set_NoSynthesize)
+GET(GetSet_Nonatomic_NoSynthesize)
+SET(GetSet_Nonatomic_NoSynthesize)
+GET(Get_Nonatomic_NoSynthesize)
+SET(Set_Nonatomic_NoSynthesize)
+
+GET(GetSet_ReadOnly_NoSynthesize)
+SET(GetSet_ReadOnly_NoSynthesize)
+GET(Get_ReadOnly_NoSynthesize)
+SET(Set_ReadOnly_NoSynthesize)
+GET(GetSet_Nonatomic_ReadOnly_NoSynthesize)
+SET(GetSet_Nonatomic_ReadOnly_NoSynthesize)
+GET(Get_Nonatomic_ReadOnly_NoSynthesize)
+SET(Set_Nonatomic_ReadOnly_NoSynthesize)
+
+GET(GetSet_ReadWriteInExt_NoSynthesize)
+SET(GetSet_ReadWriteInExt_NoSynthesize)
+GET(Get_ReadWriteInExt_NoSynthesize)
+SET(Set_ReadWriteInExt_NoSynthesize)
+GET(GetSet_Nonatomic_ReadWriteInExt_NoSynthesize)
+SET(GetSet_Nonatomic_ReadWriteInExt_NoSynthesize)
+GET(Get_Nonatomic_ReadWriteInExt_NoSynthesize)
+SET(Set_Nonatomic_ReadWriteInExt_NoSynthesize)
+
+
+// late synthesize - follows getter/setter implementations
+
+@synthesize GetSet_LateSynthesize, Get_LateSynthesize, Set_LateSynthesize, None_LateSynthesize, GetSet_Nonatomic_LateSynthesize, Get_Nonatomic_LateSynthesize, Set_Nonatomic_LateSynthesize, None_Nonatomic_LateSynthesize;
+@synthesize GetSet_ReadOnly_LateSynthesize, Get_ReadOnly_LateSynthesize, Set_ReadOnly_LateSynthesize, None_ReadOnly_LateSynthesize, GetSet_Nonatomic_ReadOnly_LateSynthesize, Get_Nonatomic_ReadOnly_LateSynthesize, Set_Nonatomic_ReadOnly_LateSynthesize, None_Nonatomic_ReadOnly_LateSynthesize;
+@synthesize GetSet_ReadWriteInExt_LateSynthesize, Get_ReadWriteInExt_LateSynthesize, Set_ReadWriteInExt_LateSynthesize, None_ReadWriteInExt_LateSynthesize, GetSet_Nonatomic_ReadWriteInExt_LateSynthesize, Get_Nonatomic_ReadWriteInExt_LateSynthesize, Set_Nonatomic_ReadWriteInExt_LateSynthesize, None_Nonatomic_ReadWriteInExt_LateSynthesize;
+
+// no synthesize - use dynamic instead
+
+@dynamic GetSet_NoSynthesize, Get_NoSynthesize, Set_NoSynthesize, None_NoSynthesize, GetSet_Nonatomic_NoSynthesize, Get_Nonatomic_NoSynthesize, Set_Nonatomic_NoSynthesize, None_Nonatomic_NoSynthesize;
+@dynamic GetSet_ReadOnly_NoSynthesize, Get_ReadOnly_NoSynthesize, Set_ReadOnly_NoSynthesize, None_ReadOnly_NoSynthesize, GetSet_Nonatomic_ReadOnly_NoSynthesize, Get_Nonatomic_ReadOnly_NoSynthesize, Set_Nonatomic_ReadOnly_NoSynthesize, None_Nonatomic_ReadOnly_NoSynthesize;
+@dynamic GetSet_ReadWriteInExt_NoSynthesize, Get_ReadWriteInExt_NoSynthesize, Set_ReadWriteInExt_NoSynthesize, None_ReadWriteInExt_NoSynthesize, GetSet_Nonatomic_ReadWriteInExt_NoSynthesize, Get_Nonatomic_ReadWriteInExt_NoSynthesize, Set_Nonatomic_ReadWriteInExt_NoSynthesize, None_Nonatomic_ReadWriteInExt_NoSynthesize;
+
+@end
+
+/*
+// the following method should cause a warning along the lines of
+// :warning: Atomic property 'x' cannot pair a synthesized setter/getter with a manually implemented setter/getter
+- (void) setX: (int) aValue
+{
+ x = aValue;
+}
+
+// no warning 'cause this is nonatomic
+- (void) setY: (int) aValue
+{
+ y = aValue;
+}
+
+// the following method should cause a warning along the lines of
+// :warning: Atomic property 'x' cannot pair a synthesized setter/getter with a manually implemented setter/getter
+- (int) j
+{
+ return j;
+}
+
+// no warning 'cause this is nonatomic
+- (int) k
+{
+ return k;
+}
+@end
+*/
+int main (int argc, const char * argv[]) {
+ return 0;
+}
diff --git a/test/SemaObjC/call-super-2.m b/test/SemaObjC/call-super-2.m
index a481cff..afd35a8 100644
--- a/test/SemaObjC/call-super-2.m
+++ b/test/SemaObjC/call-super-2.m
@@ -6,6 +6,7 @@ typedef struct objc_object *id;
id objc_getClass(const char *s);
@interface Object
+- (id) initWithInt: (int) i;
@end
@protocol Func
@@ -28,6 +29,7 @@ id objc_getClass(const char *s);
- (int) instance_func5;
- (int) instance_func6;
- (int) instance_func7;
+- (id) initWithInt: (int) i;
@end
@implementation Derived
@@ -94,5 +96,13 @@ id objc_getClass(const char *s);
{
return [objc_getClass("Derived") class_func1];
}
+- (id) initWithInt: (int) i
+{
+ // Don't warn about parentheses here.
+ if (self = [super initWithInt: i]) {
+ [self instance_func1];
+ }
+ return self;
+}
@end
diff --git a/test/SemaObjC/class-method-lookup.m b/test/SemaObjC/class-method-lookup.m
index cba9382..6f745d4 100644
--- a/test/SemaObjC/class-method-lookup.m
+++ b/test/SemaObjC/class-method-lookup.m
@@ -40,7 +40,7 @@
id foo(void) {
Object *obj;
id obj2 = obj;
- [obj setWindow:nil]; // expected-warning {{Object may not respond to 'setWindow:'}}
+ [obj setWindow:nil]; // expected-warning {{Object may not respond to 'setWindow:'}}
return obj;
}
diff --git a/test/SemaObjC/compare-qualified-id.m b/test/SemaObjC/compare-qualified-id.m
index 86845c0..22bec50 100644
--- a/test/SemaObjC/compare-qualified-id.m
+++ b/test/SemaObjC/compare-qualified-id.m
@@ -23,11 +23,12 @@ extern NSString * const NSTaskDidTerminateNotification;
- (NSString *)evaluateAsStringInContext:(XCPropertyExpansionContext *)context withNestingState:(const void *)state;
@end
-@implementation XCPropertyExpansionContext
+@implementation XCPropertyExpansionContext // expected-warning {{method definition for 'copyWithZone:' not found}} \
+ // expected-warning {{incomplete implementation}}
- (NSString *)expandedValueForProperty:(NSString *)property {
id <XCPropertyValues> cachedValueNode = [_propNamesToPropValuesCache objectForKey:property]; // expected-warning {{method '-objectForKey:' not found (return type defaults to 'id')}}
if (cachedValueNode == ((void *)0)) { }
NSString * expandedValue = [cachedValueNode evaluateAsStringInContext:self withNestingState:((void *)0)];
return expandedValue;
}
-
+@end
diff --git a/test/SemaObjC/continuation-class-err.m b/test/SemaObjC/continuation-class-err.m
index 262b786..4559696 100644
--- a/test/SemaObjC/continuation-class-err.m
+++ b/test/SemaObjC/continuation-class-err.m
@@ -7,11 +7,13 @@
}
@property(readonly) id object; // expected-note {{property declared here}}
@property(readwrite, assign) id object1; // expected-note {{property declared here}}
+@property (readonly) int indentLevel;
@end
@interface ReadOnly ()
@property(readwrite, copy) id object; // expected-warning {{property attribute in continuation class does not match the primary class}}
@property(readonly) id object1; // expected-error {{property declaration in continuation class of 'ReadOnly' is to change a 'readonly' property to 'readwrite'}}
+@property (readwrite, assign) int indentLevel; // OK. assign the the default in any case.
@end
@protocol Proto
diff --git a/test/SemaObjC/deref-interface.m b/test/SemaObjC/deref-interface.m
index 1c85918..57750a5 100644
--- a/test/SemaObjC/deref-interface.m
+++ b/test/SemaObjC/deref-interface.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple x86_64-apple-darwin9 -verify -fsyntax-only %s
+// RUN: clang-cc -fobjc-nonfragile-abi -verify -fsyntax-only %s
@interface NSView
- (id)initWithView:(id)realView;
diff --git a/test/SemaObjC/idiomatic-parentheses.m b/test/SemaObjC/idiomatic-parentheses.m
new file mode 100644
index 0000000..b4c52fa
--- /dev/null
+++ b/test/SemaObjC/idiomatic-parentheses.m
@@ -0,0 +1,35 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+// Don't warn about some common ObjC idioms unless we have -Wparentheses on.
+// <rdar://problem/7382435>
+
+@interface Object
+- (id) init;
+- (id) initWithInt: (int) i;
+- (void) iterate: (id) coll;
+- (id) nextObject;
+@end
+
+@implementation Object
+- (id) init {
+ if (self = [self init]) {
+ }
+ return self;
+}
+
+- (id) initWithInt: (int) i {
+ if (self = [self initWithInt: i]) {
+ }
+ return self;
+}
+
+- (void) iterate: (id) coll {
+ id cur;
+ while (cur = [coll nextObject]) {
+ }
+}
+
+- (id) nextObject {
+ return self;
+}
+@end
diff --git a/test/SemaObjC/ivar-sem-check-2.m b/test/SemaObjC/ivar-sem-check-2.m
index ba6b389..a5a830d 100644
--- a/test/SemaObjC/ivar-sem-check-2.m
+++ b/test/SemaObjC/ivar-sem-check-2.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fsyntax-only -triple x86_64-apple-darwin10 -verify %s
+// RUN: clang-cc -fsyntax-only -fobjc-nonfragile-abi -verify %s
@interface Super {
id value2; // expected-note {{previously declared 'value2' here}}
diff --git a/test/SemaObjC/method-arg-decay.m b/test/SemaObjC/method-arg-decay.m
index 7fd07d2..e81bcdf 100644
--- a/test/SemaObjC/method-arg-decay.m
+++ b/test/SemaObjC/method-arg-decay.m
@@ -72,7 +72,9 @@ extern NSMutableArray *XCFindPossibleKeyModules(PBXModule *module, BOOL useExpos
}
- (PBXModule *) moduleForTab:(NSTabViewItem *)item;
@end
-@implementation XCPerspectiveModule
+@implementation XCPerspectiveModule // expected-warning {{method definition for 'moduleForTab:' not found}} \
+ // expected-warning {{method definition for 'performAction:withSelection:' not found}} \
+ // expected-warning {{incomplete implementation}}
+ (void) openForProjectDocument:(PBXProjectDocument *)projectDocument {
}
- (PBXModule *) type:(Class)type inPerspective:(id)perspectiveIdentifer matchingFunction:(BOOL (void *, void *))comparator usingData:(void *)data {
@@ -94,3 +96,4 @@ extern NSMutableArray *XCFindPossibleKeyModules(PBXModule *module, BOOL useExpos
prompts++;
return (BOOL)0;
}
+@end
diff --git a/test/SemaObjC/objc-string-constant.m b/test/SemaObjC/objc-string-constant.m
index d27a46a..c6461dd 100644
--- a/test/SemaObjC/objc-string-constant.m
+++ b/test/SemaObjC/objc-string-constant.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc %s -verify -fsyntax-only
+// RUN: clang-cc -Wsemicolon-before-method-body %s -verify -fsyntax-only
#define nil 0 /* id of Nil instance */
diff --git a/test/SemaObjC/property-category-1.m b/test/SemaObjC/property-category-1.m
index 6695239..fa9d4c8 100644
--- a/test/SemaObjC/property-category-1.m
+++ b/test/SemaObjC/property-category-1.m
@@ -24,6 +24,7 @@
- (void) myAnotherobjectSetter : (int)val {
_Anotherobject = val;
}
+- (int) Anotherobject { return _Anotherobject; }
@end
int main(int argc, char **argv) {
diff --git a/test/SemaObjC/property-nonfragile-abi.m b/test/SemaObjC/property-nonfragile-abi.m
index e2de77d..8352091 100644
--- a/test/SemaObjC/property-nonfragile-abi.m
+++ b/test/SemaObjC/property-nonfragile-abi.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fsyntax-only -triple x86_64-apple-darwin9 -verify %s
+// RUN: clang-cc -fsyntax-only -fobjc-nonfragile-abi -verify %s
typedef signed char BOOL;
diff --git a/test/SemaObjC/sizeof-interface.m b/test/SemaObjC/sizeof-interface.m
index 140a980..aeb1b3f 100644
--- a/test/SemaObjC/sizeof-interface.m
+++ b/test/SemaObjC/sizeof-interface.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple x86_64-apple-darwin9 -verify -fsyntax-only %s
+// RUN: clang-cc -fobjc-nonfragile-abi -verify -fsyntax-only %s
@class I0;
diff --git a/test/SemaObjC/static-ivar-ref-1.m b/test/SemaObjC/static-ivar-ref-1.m
index 6b1a312..7e07c7c 100644
--- a/test/SemaObjC/static-ivar-ref-1.m
+++ b/test/SemaObjC/static-ivar-ref-1.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-unknown-unknown -ast-print %s &&
+// RUN: clang-cc -triple i386-unknown-unknown -ast-print %s
// RUN: clang-cc -triple x86_64-apple-darwin10 -ast-print %s
@interface current
diff --git a/test/SemaObjC/string.m b/test/SemaObjC/string.m
index 3f078f6..3c09c3c 100644
--- a/test/SemaObjC/string.m
+++ b/test/SemaObjC/string.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc %s -verify -fsyntax-only &&
+// RUN: clang-cc %s -verify -fsyntax-only
// RUN: clang-cc %s -verify -fsyntax-only -DDECLAREIT
// a declaration of NSConstantString is not required.
diff --git a/test/SemaObjC/synthesized-ivar.m b/test/SemaObjC/synthesized-ivar.m
index de44857..305629b 100644
--- a/test/SemaObjC/synthesized-ivar.m
+++ b/test/SemaObjC/synthesized-ivar.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fsyntax-only -triple x86_64-apple-darwin9 -verify %s
+// RUN: clang-cc -fsyntax-only -fobjc-nonfragile-abi -verify %s
@interface I
{
}
diff --git a/test/SemaObjC/unused.m b/test/SemaObjC/unused.m
index bbe3109..4e85894 100644
--- a/test/SemaObjC/unused.m
+++ b/test/SemaObjC/unused.m
@@ -1,5 +1,6 @@
// RUN: clang-cc %s -verify -Wunused -fsyntax-only
-#include <stdio.h>
+
+int printf(const char *, ...);
@interface Greeter
+ (void) hello;
@@ -7,7 +8,7 @@
@implementation Greeter
+ (void) hello {
- fprintf(stdout, "Hello, World!\n");
+ printf("Hello, World!\n");
}
@end
diff --git a/test/SemaObjC/warn-selector-selection.m b/test/SemaObjC/warn-selector-selection.m
index 4ab89b7..4918de7 100644
--- a/test/SemaObjC/warn-selector-selection.m
+++ b/test/SemaObjC/warn-selector-selection.m
@@ -10,5 +10,5 @@
void foo(void) {
Object *obj;
- [obj setWindow:0]; // expected-warning{{Object may not respond to 'setWindow:'}}
+ [obj setWindow:0]; // expected-warning{{Object may not respond to 'setWindow:'}}
}
diff --git a/test/SemaTemplate/class-template-decl.cpp b/test/SemaTemplate/class-template-decl.cpp
index d2e90c1..a816312 100644
--- a/test/SemaTemplate/class-template-decl.cpp
+++ b/test/SemaTemplate/class-template-decl.cpp
@@ -41,15 +41,13 @@ struct test {}; // expected-note{{previous definition}}
template<typename T>
struct test : T {}; // expected-error{{redefinition}}
-#if 0
-// FIXME: parse template declarations in these scopes, so that we can
-// complain about the one at function scope.
class X {
public:
template<typename T> class C;
};
void f() {
- template<typename T> class X;
+ template<typename T> class X; // expected-error{{expression}}
}
-#endif
+
+template<typename T> class X1 { } var; // expected-error{{declared as a template}}
diff --git a/test/SemaTemplate/class-template-spec.cpp b/test/SemaTemplate/class-template-spec.cpp
index 4cd43b4..2808404 100644
--- a/test/SemaTemplate/class-template-spec.cpp
+++ b/test/SemaTemplate/class-template-spec.cpp
@@ -19,7 +19,7 @@ int test_specs(A<float, float> *a1, A<float, int> *a2) {
int test_incomplete_specs(A<double, double> *a1,
A<double> *a2)
{
- (void)a1->x; // expected-error{{incomplete definition of type 'A<double, double>'}}
+ (void)a1->x; // expected-error{{member access into incomplete type}}
(void)a2->x; // expected-error{{implicit instantiation of undefined template 'struct A<double, int>'}}
}
@@ -104,3 +104,8 @@ Foo<int>* v;
Foo<int>& F() { return *v; }
template <typename T> class Foo {};
Foo<int> x;
+
+
+// Template template parameters
+template<template<class T> class Wibble>
+class Wibble<int> { }; // expected-error{{cannot specialize a template template parameter}}
diff --git a/test/SemaTemplate/constructor-template.cpp b/test/SemaTemplate/constructor-template.cpp
index 79bf7c5..12c6f8b9 100644
--- a/test/SemaTemplate/constructor-template.cpp
+++ b/test/SemaTemplate/constructor-template.cpp
@@ -1,5 +1,4 @@
// RUN: clang-cc -fsyntax-only -verify %s
-
struct X0 { // expected-note{{candidate}}
X0(int); // expected-note{{candidate}}
template<typename T> X0(T);
@@ -52,3 +51,34 @@ template<class C> struct A {};
template <> struct A<int>{A(const A<int>&);};
struct B { A<int> x; B(B& a) : x(a.x) {} };
+struct X2 {
+ X2();
+ X2(X2&);
+ template<typename T> X2(T);
+};
+
+X2 test(bool Cond, X2 x2) {
+ if (Cond)
+ return x2; // okay, uses copy constructor
+
+ return X2(); // expected-error{{incompatible type}}
+}
+
+struct X3 {
+ template<typename T> X3(T);
+};
+
+template<> X3::X3(X3); // expected-error{{must pass its first argument by reference}}
+
+struct X4 {
+ X4();
+ ~X4();
+ X4(X4&);
+ template<typename T> X4(const T&, int = 17);
+};
+
+X4 test_X4(bool Cond, X4 x4) {
+ X4 a(x4, 17); // okay, constructor template
+ X4 b(x4); // okay, copy constructor
+ return X4(); // expected-error{{incompatible type}}
+}
diff --git a/test/SemaTemplate/deduction.cpp b/test/SemaTemplate/deduction.cpp
new file mode 100644
index 0000000..7b7e18f
--- /dev/null
+++ b/test/SemaTemplate/deduction.cpp
@@ -0,0 +1,83 @@
+// RUN: clang-cc -fsyntax-only %s
+
+// Template argument deduction with template template parameters.
+template<typename T, template<T> class A>
+struct X0 {
+ static const unsigned value = 0;
+};
+
+template<template<int> class A>
+struct X0<int, A> {
+ static const unsigned value = 1;
+};
+
+template<int> struct X0i;
+template<long> struct X0l;
+int array_x0a[X0<long, X0l>::value == 0? 1 : -1];
+int array_x0b[X0<int, X0i>::value == 1? 1 : -1];
+
+template<typename T, typename U>
+struct is_same {
+ static const bool value = false;
+};
+
+template<typename T>
+struct is_same<T, T> {
+ static const bool value = true;
+};
+
+template<typename T> struct allocator { };
+template<typename T, typename Alloc = allocator<T> > struct vector {};
+
+// Fun with meta-lambdas!
+struct _1 {};
+struct _2 {};
+
+// Replaces all occurrences of _1 with Arg1 and _2 with Arg2 in T.
+template<typename T, typename Arg1, typename Arg2>
+struct Replace {
+ typedef T type;
+};
+
+// Replacement of the whole type.
+template<typename Arg1, typename Arg2>
+struct Replace<_1, Arg1, Arg2> {
+ typedef Arg1 type;
+};
+
+template<typename Arg1, typename Arg2>
+struct Replace<_2, Arg1, Arg2> {
+ typedef Arg2 type;
+};
+
+// Replacement through cv-qualifiers
+template<typename T, typename Arg1, typename Arg2>
+struct Replace<const T, Arg1, Arg2> {
+ typedef typename Replace<T, Arg1, Arg2>::type const type;
+};
+
+// Replacement of templates
+template<template<typename> class TT, typename T1, typename Arg1, typename Arg2>
+struct Replace<TT<T1>, Arg1, Arg2> {
+ typedef TT<typename Replace<T1, Arg1, Arg2>::type> type;
+};
+
+template<template<typename, typename> class TT, typename T1, typename T2,
+ typename Arg1, typename Arg2>
+struct Replace<TT<T1, T2>, Arg1, Arg2> {
+ typedef TT<typename Replace<T1, Arg1, Arg2>::type,
+ typename Replace<T2, Arg1, Arg2>::type> type;
+};
+
+// Just for kicks...
+template<template<typename, typename> class TT, typename T1,
+ typename Arg1, typename Arg2>
+struct Replace<TT<T1, _2>, Arg1, Arg2> {
+ typedef TT<typename Replace<T1, Arg1, Arg2>::type, Arg2> type;
+};
+
+int array0[is_same<Replace<_1, int, float>::type, int>::value? 1 : -1];
+int array1[is_same<Replace<const _1, int, float>::type, const int>::value? 1 : -1];
+int array2[is_same<Replace<vector<_1>, int, float>::type, vector<int> >::value? 1 : -1];
+int array3[is_same<Replace<vector<const _1>, int, float>::type, vector<const int> >::value? 1 : -1];
+int array4[is_same<Replace<vector<int, _2>, double, float>::type, vector<int, float> >::value? 1 : -1];
diff --git a/test/SemaTemplate/default-arguments.cpp b/test/SemaTemplate/default-arguments.cpp
index 33677aa..0247ddc 100644
--- a/test/SemaTemplate/default-arguments.cpp
+++ b/test/SemaTemplate/default-arguments.cpp
@@ -1,5 +1,4 @@
// RUN: clang-cc -fsyntax-only -verify %s
-
template<typename T, int N = 2> struct X; // expected-note{{template is declared here}}
X<int, 1> *x1;
@@ -42,3 +41,83 @@ template<>
struct B<void> {
typedef B<void*> type;
};
+
+// Nested default arguments for template parameters.
+template<typename T> struct X1 { };
+
+template<typename T>
+struct X2 {
+ template<typename U = typename X1<T>::type> // expected-error{{no type named}}
+ struct Inner1 { };
+
+ template<T Value = X1<T>::value> // expected-error{{no member named 'value'}}
+ struct NonType1 { };
+
+ template<T Value>
+ struct Inner2 { };
+
+ template<typename U>
+ struct Inner3 {
+ template<typename X = T, typename V = U>
+ struct VeryInner { };
+
+ template<T Value1 = sizeof(T), T Value2 = sizeof(U),
+ T Value3 = Value1 + Value2>
+ struct NonType2 { };
+ };
+};
+
+X2<int> x2i;
+X2<int>::Inner1<float> x2iif;
+
+X2<int>::Inner1<> x2bad; // expected-note{{instantiation of default argument}}
+
+X2<int>::NonType1<'a'> x2_nontype1;
+X2<int>::NonType1<> x2_nontype1_bad; // expected-note{{instantiation of default argument}}
+
+// Check multi-level substitution into template type arguments
+X2<int>::Inner3<float>::VeryInner<> vi;
+X2<char>::Inner3<int>::NonType2<> x2_deep_nontype;
+
+template<typename T, typename U>
+struct is_same { static const bool value = false; };
+
+template<typename T>
+struct is_same<T, T> { static const bool value = true; };
+
+int array1[is_same<__typeof__(vi),
+ X2<int>::Inner3<float>::VeryInner<int, float> >::value? 1 : -1];
+
+int array2[is_same<__typeof(x2_deep_nontype),
+ X2<char>::Inner3<int>::NonType2<sizeof(char), sizeof(int),
+ sizeof(char)+sizeof(int)> >::value? 1 : -1];
+
+// Template template parameter defaults
+template<template<typename T> class X = X2> struct X3 { };
+int array3[is_same<X3<>, X3<X2> >::value? 1 : -1];
+
+struct add_pointer {
+ template<typename T>
+ struct apply {
+ typedef T* type;
+ };
+};
+
+template<typename T, template<typename> class X = T::template apply>
+ struct X4;
+int array4[is_same<X4<add_pointer>,
+ X4<add_pointer, add_pointer::apply> >::value? 1 : -1];
+
+template<int> struct X5 {}; // expected-note{{has a different type 'int'}}
+template<long> struct X5b {};
+template<typename T,
+ template<T> class B = X5> // expected-error{{template template argument has different}} \
+ // expected-note{{previous non-type template parameter}}
+ struct X6 {};
+
+X6<int> x6a;
+X6<long> x6b; // expected-note{{while checking a default template argument}}
+X6<long, X5b> x6c;
+
+
+template<template<class> class X = B<int> > struct X7; // expected-error{{must be a class template}}
diff --git a/test/SemaTemplate/default-expr-arguments.cpp b/test/SemaTemplate/default-expr-arguments.cpp
index 9c0f1ec..34ac2d9 100644
--- a/test/SemaTemplate/default-expr-arguments.cpp
+++ b/test/SemaTemplate/default-expr-arguments.cpp
@@ -65,8 +65,8 @@ void test_x0(X0<int> xi) {
xi.f(17);
}
-struct NotDefaultConstructible { // expected-note{{candidate}}
- NotDefaultConstructible(int); // expected-note{{candidate}}
+struct NotDefaultConstructible { // expected-note 2{{candidate}}
+ NotDefaultConstructible(int); // expected-note 2{{candidate}}
};
void test_x0_not_default_constructible(X0<NotDefaultConstructible> xn) {
@@ -85,6 +85,18 @@ void test_X1() {
X1<int> x1;
}
+template<typename T>
+struct X2 {
+ void operator()(T = T()); // expected-error{{no matching}}
+};
+
+void test_x2(X2<int> x2i, X2<NotDefaultConstructible> x2n) {
+ x2i();
+ x2i(17);
+ x2n(NotDefaultConstructible(17));
+ x2n(); // expected-note{{in instantiation of default function argument}}
+}
+
// PR5283
namespace PR5283 {
template<typename T> struct A {
@@ -108,3 +120,27 @@ struct D {
};
D::D() { } // expected-note {{in instantiation of default function argument expression for 'A<int *>' required he}}
}
+
+// PR5301
+namespace pr5301 {
+ void f(int, int = 0);
+
+ template <typename T>
+ void g(T, T = 0);
+
+ template <int I>
+ void i(int a = I);
+
+ template <typename T>
+ void h(T t) {
+ f(0);
+ g(1);
+ g(t);
+ i<2>();
+ }
+
+ void test() {
+ h(0);
+ }
+}
+
diff --git a/test/SemaTemplate/enum-argument.cpp b/test/SemaTemplate/enum-argument.cpp
index 101a1d0..1d782df 100644
--- a/test/SemaTemplate/enum-argument.cpp
+++ b/test/SemaTemplate/enum-argument.cpp
@@ -5,3 +5,19 @@ template <Enum v> struct C {
typedef C<v> Self;
};
template struct C<val>;
+
+template<typename T>
+struct get_size {
+ static const unsigned value = sizeof(T);
+};
+
+template<typename T>
+struct X0 {
+ enum {
+ Val1 = get_size<T>::value,
+ Val2,
+ SumOfValues = Val1 + Val2
+ };
+};
+
+X0<int> x0i;
diff --git a/test/SemaTemplate/example-dynarray.cpp b/test/SemaTemplate/example-dynarray.cpp
index 2b752b4..6f3e58e 100644
--- a/test/SemaTemplate/example-dynarray.cpp
+++ b/test/SemaTemplate/example-dynarray.cpp
@@ -1,4 +1,4 @@
-// RUN: clang-cc -emit-llvm-only %s
+// RUN: clang -emit-llvm -S -o %t %s
#include <stddef.h>
#include <stdlib.h>
#include <assert.h>
diff --git a/test/SemaTemplate/instantiate-attr.cpp b/test/SemaTemplate/instantiate-attr.cpp
new file mode 100644
index 0000000..08ba9c3
--- /dev/null
+++ b/test/SemaTemplate/instantiate-attr.cpp
@@ -0,0 +1,7 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+template <typename T>
+struct A {
+ char a __attribute__((aligned(16)));
+};
+int a[sizeof(A<int>) == 16 ? 1 : -1];
+
diff --git a/test/SemaTemplate/instantiate-decl-init.cpp b/test/SemaTemplate/instantiate-decl-init.cpp
new file mode 100644
index 0000000..d957f2d
--- /dev/null
+++ b/test/SemaTemplate/instantiate-decl-init.cpp
@@ -0,0 +1,22 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+// PR5426 - the non-dependent obj would be fully processed and wrapped in a
+// CXXConstructExpr at definition time, which would lead to a failure at
+// instantiation time.
+struct arg {
+ arg();
+};
+
+struct oldstylemove {
+ oldstylemove(oldstylemove&);
+ oldstylemove(const arg&);
+};
+
+template <typename T>
+void fn(T t, const arg& arg) {
+ oldstylemove obj(arg);
+}
+
+void test() {
+ fn(1, arg());
+}
diff --git a/test/SemaTemplate/instantiate-member-pointers.cpp b/test/SemaTemplate/instantiate-member-pointers.cpp
index b3ddb3f..d2c9e6b 100644
--- a/test/SemaTemplate/instantiate-member-pointers.cpp
+++ b/test/SemaTemplate/instantiate-member-pointers.cpp
@@ -1,5 +1,4 @@
// RUN: clang-cc -fsyntax-only -verify %s
-
struct Y {
int x;
};
@@ -25,3 +24,32 @@ struct X2 {
template struct X2<int, Y>;
template struct X2<int&, Y>; // expected-note{{instantiation}}
template struct X2<const void, Y>; // expected-note{{instantiation}}
+
+template<typename T, typename Class, T Class::*Ptr>
+struct X3 {
+ X3<T, Class, Ptr> &operator=(const T& value) {
+ return *this;
+ }
+};
+
+X3<int, Y, &Y::x> x3;
+
+typedef int Y::*IntMember;
+
+template<IntMember Member>
+struct X4 {
+ X3<int, Y, Member> member;
+
+ int &getMember(Y& y) { return y.*Member; }
+};
+
+int &get_X4(X4<&Y::x> x4, Y& y) {
+ return x4.getMember(y);
+}
+
+template<IntMember Member>
+void accept_X4(X4<Member>);
+
+void test_accept_X4(X4<&Y::x> x4) {
+ accept_X4(x4);
+}
diff --git a/test/SemaTemplate/instantiate-member-template.cpp b/test/SemaTemplate/instantiate-member-template.cpp
index 36f3b6f..95556bc 100644
--- a/test/SemaTemplate/instantiate-member-template.cpp
+++ b/test/SemaTemplate/instantiate-member-template.cpp
@@ -103,3 +103,16 @@ void test_X1(int *ip, int i, double *dp) {
X1<int*>::Inner4<int>::value = 17;
i = X1<int*>::Inner4<int&>::value; // expected-note{{instantiation}}
}
+
+
+template<typename T>
+struct X2 {
+ template<T *Ptr> // expected-error{{pointer to a reference}}
+ struct Inner;
+
+ template<T Value> // expected-error{{cannot have type 'float'}}
+ struct Inner2;
+};
+
+X2<int&> x2a; // expected-note{{instantiation}}
+X2<float> x2b; // expected-note{{instantiation}}
diff --git a/test/SemaTemplate/instantiate-overloaded-arrow.cpp b/test/SemaTemplate/instantiate-overloaded-arrow.cpp
new file mode 100644
index 0000000..7f0ef0c
--- /dev/null
+++ b/test/SemaTemplate/instantiate-overloaded-arrow.cpp
@@ -0,0 +1,20 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+// PR5488
+
+struct X {
+ int x;
+};
+
+struct Iter {
+ X* operator->();
+};
+
+template <typename T>
+void Foo() {
+ (void)Iter()->x;
+}
+
+void Func() {
+ Foo<int>();
+}
+
diff --git a/test/SemaTemplate/instantiate-template-template-parm.cpp b/test/SemaTemplate/instantiate-template-template-parm.cpp
index b158251..30ba113 100644
--- a/test/SemaTemplate/instantiate-template-template-parm.cpp
+++ b/test/SemaTemplate/instantiate-template-template-parm.cpp
@@ -1,5 +1,4 @@
// RUN: clang-cc -fsyntax-only -verify %s
-
template<template<typename T> class MetaFun, typename Value>
struct apply {
typedef typename MetaFun<Value>::type type;
@@ -19,3 +18,29 @@ int i;
apply<add_pointer, int>::type ip = &i;
apply<add_reference, int>::type ir = i;
apply<add_reference, float>::type fr = i; // expected-error{{non-const lvalue reference to type 'float' cannot be initialized with a value of type 'int'}}
+
+// Template template parameters
+template<int> struct B; // expected-note{{has a different type 'int'}}
+
+template<typename T,
+ template<T Value> class X> // expected-error{{cannot have type 'float'}} \
+ // expected-note{{with type 'long'}}
+struct X0 { };
+
+X0<int, B> x0b1;
+X0<float, B> x0b2; // expected-note{{while substituting}}
+X0<long, B> x0b3; // expected-error{{template template argument has different template parameters}}
+
+template<template<int V> class TT> // expected-note{{parameter with type 'int'}}
+struct X1 { };
+
+template<typename T, template<T V> class TT>
+struct X2 {
+ X1<TT> x1; // expected-error{{has different template parameters}}
+};
+
+template<int V> struct X3i { };
+template<long V> struct X3l { }; // expected-note{{different type 'long'}}
+
+X2<int, X3i> x2okay;
+X2<long, X3l> x2bad; // expected-note{{instantiation}}
diff --git a/test/SemaTemplate/instantiate-using-decl.cpp b/test/SemaTemplate/instantiate-using-decl.cpp
index fd9010f..a1cf355 100644
--- a/test/SemaTemplate/instantiate-using-decl.cpp
+++ b/test/SemaTemplate/instantiate-using-decl.cpp
@@ -1,5 +1,7 @@
// RUN: clang-cc -fsyntax-only -verify %s
+namespace N { }
+
template<typename T>
struct A {
void f();
@@ -10,6 +12,7 @@ struct B : A<T> {
using A<T>::f;
void g() {
+ using namespace N;
f();
}
};
diff --git a/test/SemaTemplate/instantiation-default-2.cpp b/test/SemaTemplate/instantiation-default-2.cpp
index 740832c..4d9a0e2 100644
--- a/test/SemaTemplate/instantiation-default-2.cpp
+++ b/test/SemaTemplate/instantiation-default-2.cpp
@@ -15,4 +15,4 @@ Constant<float (*)(int, double), &f> *c5;
Constant<float (*)(int, int), f> *c6; // expected-error{{non-type template argument of type 'float (*)(int, double)' cannot be converted to a value of type 'float (*)(int, int)'}}
-Constant<float, 0> *c7; // expected-note{{in instantiation of default argument for 'Constant<float>' required here}}
+Constant<float, 0> *c7; // expected-note{{while substituting}}
diff --git a/test/SemaTemplate/member-function-template.cpp b/test/SemaTemplate/member-function-template.cpp
index 83bf16c..1d46d31 100644
--- a/test/SemaTemplate/member-function-template.cpp
+++ b/test/SemaTemplate/member-function-template.cpp
@@ -49,3 +49,27 @@ void test_X_f0_explicit(X x, int i, long l) {
// PR4608
class A { template <class x> x a(x z) { return z+y; } int y; };
+// PR5419
+struct Functor {
+ template <typename T>
+ bool operator()(const T& v) const {
+ return true;
+ }
+};
+
+void test_Functor(Functor f) {
+ f(1);
+}
+
+// Instantiation on ->
+template<typename T>
+struct X1 {
+ template<typename U> U& get();
+};
+
+template<typename T> struct X2; // expected-note{{here}}
+
+void test_incomplete_access(X1<int> *x1, X2<int> *x2) {
+ float &fr = x1->get<float>();
+ (void)x2->get<float>(); // expected-error{{implicit instantiation of undefined template}}
+}
diff --git a/test/SemaTemplate/nested-name-spec-template.cpp b/test/SemaTemplate/nested-name-spec-template.cpp
index 1bdc7a8..e936640 100644
--- a/test/SemaTemplate/nested-name-spec-template.cpp
+++ b/test/SemaTemplate/nested-name-spec-template.cpp
@@ -28,11 +28,8 @@ N::M::Promote<int>::type *ret_intptr5(int* ip) { return ip; }
::N::M::Promote<int>::type *ret_intptr6(int* ip) { return ip; }
-N::M::template; // expected-error{{expected template name after 'template' keyword in nested name specifier}} \
- // expected-error{{expected unqualified-id}}
-
-N::M::template Promote; // expected-error{{expected '<' after 'template Promote' in nested name specifier}} \
-// expected-error{{C++ requires a type specifier for all declarations}}
+N::M::template; // expected-error{{expected unqualified-id}}
+N::M::template Promote; // expected-error{{expected unqualified-id}}
namespace N {
template<typename T> struct A;
@@ -49,13 +46,9 @@ struct ::N::A<int>::X {
int foo;
};
-#if 0
-// FIXME: the following crashes the parser, because Sema has no way to
-// communicate that the "dependent" template-name N::template B doesn't
-// actually refer to a template.
template<typename T>
struct TestA {
- typedef typename N::template B<T>::type type; // xpected-error{{'B' following the 'template' keyword does not refer to a template}}
- // FIXME: should show what B *does* refer to.
+ typedef typename N::template B<T>::type type; // expected-error{{'B' following the 'template' keyword does not refer to a template}} \
+ // expected-error{{identifier or template-id}} \
+ // expected-error{{expected member name}}
};
-#endif
diff --git a/test/SemaTemplate/nested-template.cpp b/test/SemaTemplate/nested-template.cpp
index 4d94818..e18329c 100644
--- a/test/SemaTemplate/nested-template.cpp
+++ b/test/SemaTemplate/nested-template.cpp
@@ -108,3 +108,21 @@ struct X1 {
template<typename, bool = false> struct B { };
};
template struct X1<int>::B<bool>;
+
+// Template template parameters
+template<typename T>
+struct X2 {
+ template<template<class U, T Value> class> // expected-error{{cannot have type 'float'}} \
+ // expected-note{{previous non-type template}}
+ struct Inner { };
+};
+
+template<typename T,
+ int Value> // expected-note{{template non-type parameter}}
+ struct X2_arg;
+
+X2<int>::Inner<X2_arg> x2i1;
+X2<float> x2a; // expected-note{{instantiation}}
+X2<long>::Inner<X2_arg> x2i3; // expected-error{{template template argument has different}}
+
+
diff --git a/test/SemaTemplate/operator-template.cpp b/test/SemaTemplate/operator-template.cpp
index 7039e0e..dc44d04 100644
--- a/test/SemaTemplate/operator-template.cpp
+++ b/test/SemaTemplate/operator-template.cpp
@@ -11,6 +11,6 @@ int a0(A<int> x) { return x == 1; }
template<class X>struct B{typedef X Y;};
template<class X>bool operator==(B<X>*,typename B<X>::Y); // \
expected-error{{overloaded 'operator==' must have at least one parameter of class or enumeration type}} \
-expected-note{{in instantiation of member function}}
+expected-note{{in instantiation of function template specialization}}
int a(B<int> x) { return operator==(&x,1); }
diff --git a/test/SemaTemplate/temp_arg_nontype.cpp b/test/SemaTemplate/temp_arg_nontype.cpp
index a661158..bde92be 100644
--- a/test/SemaTemplate/temp_arg_nontype.cpp
+++ b/test/SemaTemplate/temp_arg_nontype.cpp
@@ -10,8 +10,7 @@ A<int> *a2; // expected-error{{template argument for non-type template parameter
A<1 >> 2> *a3; // expected-warning{{use of right-shift operator ('>>') in template argument will require parentheses in C++0x}}
// C++ [temp.arg.nontype]p5:
-A<A> *a4; // expected-error{{must have an integral or enumeration type}} \
- // FIXME: the error message above is a bit lame
+A<A> *a4; // expected-error{{must be an expression}}
enum E { Enumerator = 17 };
A<E> *a5; // expected-error{{template argument for non-type template parameter must be an expression}}
diff --git a/test/SemaTemplate/temp_arg_template.cpp b/test/SemaTemplate/temp_arg_template.cpp
index f2ee66b..ada244b 100644
--- a/test/SemaTemplate/temp_arg_template.cpp
+++ b/test/SemaTemplate/temp_arg_template.cpp
@@ -26,12 +26,9 @@ B<X> *a6; // expected-error{{template template argument has different template p
C<Y> *a7;
C<Ylong> *a8; // expected-error{{template template argument has different template parameters than its corresponding template template parameter}}
-template<typename T> void f(int); // expected-note{{function template}}
+template<typename T> void f(int);
-// FIXME: we're right to provide an error message, but it should say
-// that we need a class template. We won't get this right until name
-// lookup of 'f' returns a TemplateDecl.
-A<f> *a9; // expected-error{{template argument does not refer to}}
+A<f> *a9; // expected-error{{must be a class template}}
// FIXME: The code below is ill-formed, because of the evil digraph '<:'.
// We should provide a much better error message than we currently do.
diff --git a/test/SemaTemplate/value-dependent-null-pointer-constant.cpp b/test/SemaTemplate/value-dependent-null-pointer-constant.cpp
index 8bde127..110c380 100644
--- a/test/SemaTemplate/value-dependent-null-pointer-constant.cpp
+++ b/test/SemaTemplate/value-dependent-null-pointer-constant.cpp
@@ -26,4 +26,4 @@ struct A { };
template <typename T> void f(T *t)
{
(void)static_cast<void*>(static_cast<A*>(t));
-} \ No newline at end of file
+}
diff --git a/test/lit.cfg b/test/lit.cfg
index 9b274fe..6fa6742 100644
--- a/test/lit.cfg
+++ b/test/lit.cfg
@@ -13,8 +13,7 @@ config.name = 'Clang'
# For now we require '&&' between commands, until they get globally killed and
# the test runner updated.
execute_external = platform.system() != 'Windows'
-config.test_format = lit.formats.ShTest(execute_external,
- require_and_and = True)
+config.test_format = lit.formats.ShTest(execute_external)
# suffixes: A list of file extensions to treat as test files.
config.suffixes = ['.c', '.cpp', '.m', '.mm']
@@ -66,8 +65,9 @@ if config.test_exec_root is None:
#
# FIXME: I debated (i.e., wrote and threw away) adding logic to
# automagically generate the lit.site.cfg if we are in some kind of fresh
- # build situation. This means knowing how to invoke the build system
- # though, and I decided it was too much magic.
+ # build situation. This means knowing how to invoke the build system though,
+ # and I decided it was too much magic. We should solve this by just having
+ # the .cfg files generated during the configuration step.
llvm_config = lit.util.which('llvm-config', config.environment['PATH'])
if not llvm_config:
diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in
index c88c90b..0d452ef 100644
--- a/test/lit.site.cfg.in
+++ b/test/lit.site.cfg.in
@@ -7,5 +7,14 @@ config.llvm_libs_dir = "@LLVM_LIBS_DIR@"
config.clang_obj_root = "@CLANG_BINARY_DIR@"
config.target_triple = "@TARGET_TRIPLE@"
+# Support substitution of the tools and libs dirs with user parameters. This is
+# used when we can't determine the tool dir at configuration time.
+try:
+ config.llvm_tools_dir = config.llvm_tools_dir % lit.params
+ config.llvm_libs_dir = config.llvm_libs_dir % lit.params
+except KeyError,e:
+ key, = e.args
+ lit.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key))
+
# Let the main config do the real work.
lit.load_config(config, "@CLANG_SOURCE_DIR@/test/lit.cfg")
OpenPOWER on IntegriCloud